All Frameworks Class Hierarchy This Framework Previous Next Indexes
KnowledgeInterfaces Class CATParmPublisherAdapter
System.IUnknown
|
+---System.IDispatch
|
+---System.CATBaseUnknown
|
+---KnowledgeInterfaces.CATIParmPublisher
|
+---CATParmPublisherAdapter
Usage: you can derive this class.
public class CATParmPublisherAdapter
CAA Adapter to CATIParmPublisher Interface.
Role: This class should be derived to implement features extension to CATIParmPublisher.
CATIParmPublisher is the interface used by Knowledgeware to have access to all the parameters
and relations of a feature.
It is also used on some objects to add user parameters and relations to features
This default implementation uses an attribute of kind tk_list(tk_component) to store
relations and user parameters.
You should override method returning the attribute key where those objects will be stored and appended.
You can use this attribute to aggregate the own parameters of your feature
or you can override GetAllChildren and GetDirectChildren to return your parameters
- See also:
- CATIParmPublisher
Constructor and Destructor Index
- o
CATParmPublisherAdapter()
- Constructs the extension.
- o
~CATParmPublisherAdapter()
- Deletes the extension.
Method Index
- o
AllowUserAppend()
- Indicates if this publisher allow the use of Append (and RemoveChild) method.
- o
Append(CATISpecObject_var&)
- Appends a user parameter or a relation to this feature.
- o
GetAllChildren(CATClassId,CATListValCATISpecObject_var&)
- Scan all the children (recursive) of this feature answering a given interface.
- o
GetContainer()
- This method has to return the associated container of the publisher.
- o
GetDirectChildren(CATClassId,CATListValCATISpecObject_var&)
- Scan the direct children of this feature answering a given interface.
- o
RemoveChild(CATISpecObject_var&)
- Removes a user parameter or a relation from this feature.
- o
VisitChildren(CATIVisitor*,int)
- This method is another one to browse publishers hierarchy (recursively or not).
Constructor and Destructor
o CATParmPublisherAdapter
public CATParmPublisherAdapter( | ) |
-
Constructs the extension.
o ~CATParmPublisherAdapter
public virtual ~CATParmPublisherAdapter( | ) |
-
Deletes the extension.
Methods
o AllowUserAppend
public virtual boolean AllowUserAppend( | )const |
-
Indicates if this publisher allow the use of Append (and RemoveChild) method.
It is mostly used to prevent those operations if the object implementing the
interface isn't able to manage it.
Default implementation is FALSE.
- Returns:
- Legal values: TRUE Append and Remove of objects are authorized
FALSE Append and Remove of objects are not authorized.
o Append
public virtual void Append( | const CATISpecObject_var& | iFeatureToAppend) |
-
Appends a user parameter or a relation to this feature.
Default implementation does nothing.
- Parameters:
-
- iFeatureToAppend
- relation or parameter to append
o GetAllChildren
public virtual void GetAllChildren( | CATClassId | iIntfName, |
| CATListValCATISpecObject_var& | iList) |
-
Scan all the children (recursive) of this feature answering a given interface.
Default implementation does nothing.
Old method. Better use visit children.
If you have your own parameters or components, you should override this method, ask for this method to get the direct
children added by a user,
and then add your own parameters to the list in a recursive manner.
- Parameters:
-
- iIntfName
- name of the interface asked.
- iList
- list where parameters and relations will be added
o GetContainer
-
This method has to return the associated container of the publisher.
It is used to create the user parameters when AllowUserAppend returns True.
In this case, you should implement this method.
Default implementation returns NULL.
- Returns:
- The container
o GetDirectChildren
public virtual void GetDirectChildren( | CATClassId | iIntfName, |
| CATListValCATISpecObject_var& | iList) |
-
Scan the direct children of this feature answering a given interface.
Default implementation does nothing.
Old method. Better use VisitChildren.
If you have your own parameters, you should override this method, ask for this method to get the direct
children added by a user,
and then add your own parameters to the list.
- Parameters:
-
- iIntfName
- name of the interface asked.
- iList
- list where parameters and relations will be added
o RemoveChild
public virtual void RemoveChild( | const CATISpecObject_var& | iFeatureToRemove) |
-
Removes a user parameter or a relation from this feature.
Default implementation does nothing.
- Parameters:
-
- iFeatureToRemove
- relation or parameter to remove
o VisitChildren
public virtual void VisitChildren( | CATIVisitor* | iVisitor, |
| const int | recur | = 0) |
-
This method is another one to browse publishers hierarchy (recursively or not). The choice of good instances is delegated to the given visitor
(it can put good instances in a list, or keep only one, depending on the goal of the "visit").
The default implementation doesn't handle new litterals (based on spec attributes). If you want your publisher to publish such litterals, you have to
overload this method. The principle is to visit each published instance and if the visit is recursive, to call VisitChildren on each instance implementing CATIParmPublisher.
Remember that if the method Visit doesn't succeed, it means that the visit can end.
This object is included in the file: CATParmPublisherAdapter.h
If needed, your Imakefile.mk should include the module: KnowledgeItf