All Frameworks Class Hierarchy This Framework Indexes
KnowledgeInterfaces Class CATKweInstanceAdapter
Usage: you can derive this class.
public class CATKweInstanceAdapter
Class to be used as an adapter for objects that want to be used through Knowledge Expert and Search.
First of all, it is an adapter of CATIParmPublisher interface. This interface is used
by a feature to publish its parameters so that they can be used in F(x).
It is also an adapter of CATIInstance. This interface is used by Knowledge Expert to
identify an object through its type. It is also used by GenerativeKnwoledge and the search
of CATIA
In addition to that, the object may implement CATIInstance to give access
to its attributes. It may also implement CATIDynamicAttributes and CATIAttributesDescription
to support the ability for a user to add dynamic attributes on it.
Note that it is also an adapter of CATIInstancesProvider which is the interface to implement
to provide the instances of your hierarchy and to be thus used by Knowledge Expert
In addition to extension, you must create the TIE object with
- TIEchain_CATIParmPublisher
- TIEchain_CATIInstance
Constructor and Destructor Index
- o
CATKweInstanceAdapter()
-
- o
~CATKweInstanceAdapter()
-
Method Index
- o
AddInstanceListener(CATIInstanceListener_var&)
- Description: adds a listener to the object.
- o
AdviseAttributeChanged(CATUnicodeString&,CATIValue_var&)
- Description: propagates an attribute changed information on an instance to all its listeners.
- o
AdviseDynamicAttributeAdded(CATUnicodeString&,CATIValue_var&)
- Description: propagates an attribute creation information on an instance to all its listeners.
- o
AdviseDynamicAttributeRemoved(CATUnicodeString&,CATIValue_var&)
- Description: propagates an attribute deletion information on an instance to all its listeners.
- o
AdviseDynamicAttributeRenamed(CATUnicodeString&,CATUnicodeString&)
- Description: propagates an attribute rename information on an instance to all its listeners.
- o
AdviseModification()
- Description: propagates a modification information on an instance to all its listeners.
- o
AdviseRemoved()
- Description: propagates a remove information on an instance to all its listeners.
- o
AdviseSpecificEvent(CATBaseUnknown_var&,CATListValCATBaseUnknown_var&)
- Propagates a specific event that occured on the instance.
- o
AdviseTypeChanged()
- Description: propagates a change type information on an instance to all its listeners.
- o
GetOwner()
- Description: returns the owner of the object.
- o
GetType()
- Returns the type of the object.
- o
GetValueInternal(CATUnicodeString&)
- Description: Gets an attributes value.
- o
GetValue(CATUnicodeString&)
- Description: Gets an attributes value.
- o
IsSupporting(CATIType_var&)
- Description: Tests if an object supports a given type.
- o
ListSupportedTypesInternal(CATListValCATIType_var&)
- Description: fills the list of types supported by this object in addition to the one returned by Type method.
- o
ListSupportedTypes(CATListValCATIType_var&)
- Description: fills the list of types supported by this object.
- o
RemoveInstanceListener(CATIInstanceListener_var&)
- Description: removes a listener to the object.
- o
SetValueInternal(CATUnicodeString&,CATIValue_var&)
- Description: Sets an attributes value.
- o
SetValue(CATUnicodeString&,CATIValue_var&)
- Description: Sets an attributes value.
- o
TypeInternal()
- Description: Returns the main type of an object.
- o
Type()
- Description: Returns the main type of an object.
Constructor and Destructor
o CATKweInstanceAdapter
| public CATKweInstanceAdapter( | ) |
-
o ~CATKweInstanceAdapter
| public virtual ~CATKweInstanceAdapter( | ) |
-
Methods
o AddInstanceListener
| public AddInstanceListener( | const | iListener) |
-
Description: adds a listener to the object.
The Listerner is called back when events are raised by the object.
Default implementation works very well. You shouldn't overide this method.
- Parameters:
-
- iListerner
- listener to be called back.
o AdviseAttributeChanged
| public virtual AdviseAttributeChanged( | const | iKey, |
| const | iValue) |
-
Description: propagates an attribute changed information on an instance to all its listeners.
if the name of attribute is different of the name of parm, you must overload this method to
call AdviseAttributeChanged with the attribute name.
- Parameters:
-
- iKey
- Parm Name
- iValue
o AdviseDynamicAttributeAdded
| public AdviseDynamicAttributeAdded( | const | iKey, |
| const | iValue) |
-
Description: propagates an attribute creation information on an instance to all its listeners.
- Parameters:
-
- iKey
- attribute added
- iValue
- value added
o AdviseDynamicAttributeRemoved
| public AdviseDynamicAttributeRemoved( | const | iKey, |
| const | iValue) |
-
Description: propagates an attribute deletion information on an instance to all its listeners.
- Parameters:
-
- iAttributes
- instance where attribute is deleted
- iKey
- attribute deleted
- iValue
- value deleted
o AdviseDynamicAttributeRenamed
| public AdviseDynamicAttributeRenamed( | const | iKey, |
| const | iNewKey) |
-
Description: propagates an attribute rename information on an instance to all its listeners.
- Parameters:
-
- iAttributes
- instance where attribute is renamed
- iKey
- attribute renamed
- iValue
- value renamed
o AdviseModification
| public AdviseModification( | ) |
-
Description: propagates a modification information on an instance to all its listeners.
o AdviseRemoved
-
Description: propagates a remove information on an instance to all its listeners.
o AdviseSpecificEvent
| public AdviseSpecificEvent( | const | iEvent, |
| const | iList) |
-
Propagates a specific event that occured on the instance.
- Parameters:
-
- iEvent
- Event that happened.
- iList
- List of values carried by the event.
o AdviseTypeChanged
| public AdviseTypeChanged( | ) |
-
Description: propagates a change type information on an instance to all its listeners.
o GetOwner
| public virtual GetOwner( | ) |
-
Description: returns the owner of the object.
Default implementation returns NULL
o GetType
-
Returns the type of the object.
This type is used to check that the formula (rule or check) syntax is correct.
If your object implements CATIInstance, the classical implementation returns the CATIInstance::Type method.
If not, usually the implementation consists in calling CATGlobalFunctions::GetTypeDictionary()->FindTypeSafe("TypeName","PackageName",oType)
Default implementation returns CATIInstance::Type method.
- Returns:
- the main type of the object. It is also a CATIType.
o GetValueInternal
| protected virtual GetValueInternal( | const | iKey) |
-
Description: Gets an attributes value. Must be re-implemented when deriving
from this adapter.
Default implementation gets parameter with GetParmFromName and valuates value
GetParmFromName scans the direct children
Default implementation also tries to get value through feature extensions if any
using the CATIInstanceExtension::GetValue method.
If you override this method, you should call this one at the end to be
able to access those kind of attributes.
- Parameters:
-
- iKey:
- the name of the attribute.
- Returns:
- iValue: the value of the attribute (an AddRef is done) It can return NULL.
o GetValue
| public GetValue( | const | iKey) |
-
Description: Gets an attributes value.
Default implementation gets parameter with GetParmFromName and valuates value
GetParmFromName scans the direct children
Default implementation also tries to get value through feature extensions if any
using the CATIInstanceExtension::GetValue method.
If you override this method, you should call this one at the end to be
able to access those kind of attributes.
- Parameters:
-
- iKey:
- the name of the attribute.
- Returns:
- iValue: the value of the attribute (an AddRef is done) It can return NULL.
o IsSupporting
| public IsSupporting( | const | iType) |
-
Description: Tests if an object supports a given type.
- Parameters:
-
- iType
- type that we want to check.
An AddRef is done.
Default implementation returns self if type belongs to the supported types
Usually you shouldn't need to override this method.
- Returns:
- the instance supporting this type (may be NULL or self)
o ListSupportedTypesInternal
| protected virtual ListSupportedTypesInternal( | | oListOfCATIType) |
-
Description: fills the list of types supported by this object in addition to the one returned by Type method.
Default implementation adds nothing.
- Parameters:
-
- oListOfCATIType
- this list is filled.
o ListSupportedTypes
| public ListSupportedTypes( | | oListOfCATIType) |
-
Description: fills the list of types supported by this object.
Default implementation returns a list containing main Type first returned by Type method.
and the list of types returned by ListSupportedTypesInternal.
- Parameters:
-
- oListOfCATIType
- this list is filled.
o RemoveInstanceListener
| public RemoveInstanceListener( | const | iListener) |
-
Description: removes a listener to the object.
The Listerner is called back when events are raised by the object.
Default implementation works very well. You shouldn't overide this method.
- Parameters:
-
- iListerner
- listener to be called back.
o SetValueInternal
| protected virtual SetValueInternal( | const | iKey, |
| const | iValue) |
-
Description: Sets an attributes value. Must be re-implemented when deriving
from this adapter.
Default implementation gets parameter with GetParmFromName and valuates value
GetParmFromName scans the direct children
Default implementation also tries to set value through feature extensions if any
using the CATIInstanceExtension::SetValue method.
If you override this method, you should call this one at the end to be
able to access those kind of attributes.
- Parameters:
-
- iKey:
- the name of the attribute.
- iValue:
- the value of the attribute.
- Returns:
- E_NOTIMPL if this method is overridden but that the SetValue is not done by your implementation. S_OK if the override has done the valuation.
E_FAIL otherwise.
o SetValue
| public SetValue( | const | iKey, |
| const | iValue) |
-
Description: Sets an attributes value.
Default implementation gets parameter with GetParmFromName and valuates value
GetParmFromName scans the direct children
Default implementation also tries to set value through feature extensions if any
using the CATIInstanceExtension::SetValue method.
If you override this method, you should call this one at the end to be
able to access those kind of attributes.
- Parameters:
-
- iKey:
- the name of the attribute.
- iValue:
- the value of the attribute.
o TypeInternal
| protected virtual TypeInternal( | ) |
-
Description: Returns the main type of an object.
An AddRef must be done. This method must be re-implemented.
The classic implementation of this method is to use
CATGlobalFunctions::GetTypeDictionary()->FindSafe("MyType","MyPackage",oType)
and return oType after having done an AddRef.
This method finds a type by its name and loads the package in which the type
is defined if needed.
this method is called by the Type() method.
If you do not want to specify an accurate type, you can return NULL and Type method
will return the type Feature
- Returns:
- the main type of the object.
o Type
-
Description: Returns the main type of an object.
An AddRef is done. Warning : Do not redefined this method.
Default implementation returns GetType().
- Returns:
- the main type of the object.
This object is included in the file: CATKweInstanceAdapter.h
If needed, your Imakefile.mk should include the module: KnowledgeItf