All Frameworks Class Hierarchy This Framework Previous Next Indexes
KnowledgeInterfaces Class CATKweInstanceAdapter
System.IUnknown
|
+---System.IDispatch
|
+---System.CATBaseUnknown
|
+---KnowledgeInterfaces.CATIParmPublisher
|
+---KnowledgeInterfaces.CATParmPublisherAdapter
|
+---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
GetValue(CATUnicodeString&)
- Description: Gets an attributes value.
- o
GetValueInternal(CATUnicodeString&)
- Description: Gets an attributes value.
- o
IsSupporting(CATIType_var&)
- Description: Tests if an object supports a given type.
- o
ListSupportedTypes(CATListValCATIType_var&)
- Description: fills the list of types supported by this object.
- o
ListSupportedTypesInternal(CATListValCATIType_var&)
- Description: fills the list of types supported by this object in addition to the one returned by Type method.
- o
RemoveInstanceListener(CATIInstanceListener_var&)
- Description: removes a listener to the object.
- o
SetValue(CATUnicodeString&,CATIValue_var&)
- Description: Sets an attributes value.
- o
SetValueInternal(CATUnicodeString&,CATIValue_var&)
- Description: Sets an attributes value.
- o
Type()
- Description: Returns the main type of an object.
- o
TypeInternal()
- Description: Returns the main type of an object.
Constructor and Destructor
o CATKweInstanceAdapter
public CATKweInstanceAdapter( | ) |
-
o ~CATKweInstanceAdapter
public virtual ~CATKweInstanceAdapter( | ) |
-
Methods
o AddInstanceListener
public HRESULT AddInstanceListener( | const CATIInstanceListener_var& | 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
-
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
-
Description: propagates an attribute creation information on an instance to all its listeners.
- Parameters:
-
- iKey
- attribute added
- iValue
- value added
o AdviseDynamicAttributeRemoved
-
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
-
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 HRESULT 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
-
Propagates a specific event that occured on the instance.
- Parameters:
-
- iEvent
- Event that happened.
- iList
- List of values carried by the event.
o AdviseTypeChanged
-
Description: propagates a change type information on an instance to all its listeners.
o 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 GetValue
-
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 GetValueInternal
-
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 IsSupporting
public CATIInstance* IsSupporting( | const CATIType_var& | iType)const |
-
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 ListSupportedTypes
public HRESULT ListSupportedTypes( | CATListValCATIType_var& | oListOfCATIType)const |
-
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 ListSupportedTypesInternal
protected virtual HRESULT ListSupportedTypesInternal( | CATListValCATIType_var& | oListOfCATIType)const |
-
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 RemoveInstanceListener
public HRESULT RemoveInstanceListener( | const CATIInstanceListener_var& | 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 SetValue
-
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 SetValueInternal
-
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 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.
o TypeInternal
protected virtual CATIType* TypeInternal( | )const |
-
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.
This object is included in the file: CATKweInstanceAdapter.h
If needed, your Imakefile.mk should include the module: KnowledgeItf