CATMecModExtendItf CATMmrReplaceAdapter

Usage: you can derive this class.


public class CATMmrReplaceAdapter

Adapter class for the CATIReplace interface.
usage: The implementation should include the additional method GetRequestedBehavior.

See also:


Constructor and Destructor Index


o CATMmrReplaceAdapter()
Constructs a CATMmrReplaceAdapter.
o ~CATMmrReplaceAdapter()

Method Index


o GetRequestedBehavior(CATUnicodeString&,CATListPtrIID**,int*)
Method to describe expected behavior on object valuating an attribute.
o IsElementValidForReplace(CATUnicodeString&,CATBaseUnknown_var&,CATUnicodeString&,int&,CATBaseUnknown_var&)
Determine wether the candidate element is allowed to replace the existing one.
o Replace(CATUnicodeString&,CATBaseUnknown_var&,CATBaseUnknown_var&)
Valuates a given attribute with an other object.

Constructor and Destructor


o CATMmrReplaceAdapter
public CATMmrReplaceAdapter()
Constructs a CATMmrReplaceAdapter.
o ~CATMmrReplaceAdapter
public virtual ~CATMmrReplaceAdapter()

Methods


o GetRequestedBehavior
protected virtual GetRequestedBehavior( const iAttributeName,
oBehaviorArray,
oBehaviorSize)
Method to describe expected behavior on object valuating an attribute. Returns for a given attribute the expected behavior of its valuating objects. Usage:
Elements must be created as follows :

CATListPtrIID * value = new CATListPtrIID[2];
// Way #1.
CATListPtrIID subList (3);
subList[1] = &IID_CATIHello;
subList[2] = &IID_CATIBonjour;
subList[3] = &IID_CATIBuenosDias;
value[0] = subList;
// Way #2.
value[1].Append(&IID_CATIAufwiedersehen);
value[1].Append(&IID_CATIArrivederci);

To sum up: result = [ { CATIHello, CATIBonjour, CATIBuenosDias },
{ CATIAufwiedersehen, CATIArrivederci } ]

The result will be translated as
( CATIHello AND CATIBonjour AND CATIBuenosDias ) OR ( CATIAufwiedersehen AND CATIArrivederci )
Parameters:
iAttrName
name of the concerned attribute.
oBehaviorArray
Array of lists of interfaces in the CATListPtrIID[] format.
This list is a combination of interfaces that must be implemented by any object valuating the attribute.
oBehaviorSize
The size of the array of lists of interfaces in the CATListPtrIID[] format.
o IsElementValidForReplace
public virtual IsElementValidForReplace( const iName,
const iElement,
oMessage,
oElementValidity,
const iOldValue=NULL_var)
Determine wether the candidate element is allowed to replace the existing one.
Parameters:
iName
name of attribute which value has to be replace.
iElement
candidate element for replace.
oMessage
explains returned HRESULT.
Legal values:
"No adhesion to CATIAttrBehavior" if this doesn't implement CATIAttrBehavior. then rc is E_NOTIMPL .
"Element is invalid " if element is invalid for replace, then rc is E_FAILED .
oElementValidity

Legal values : 0 if element is not valid ,
1 if element is valid .
iOldValue
position of the feature to replace if the attribute is a list.
Returns:
HRESULT
Legal values : S_OK , E_FAIL , E_NOTIMPL
o Replace
public virtual Replace( const name_of_role,
new_element,
const old_value=NULL_var )
Valuates a given attribute with an other object.
Parameters:
iName
name of the attribute which value has to be replace.
iElement
candidate element for replace.
iOldValue
position of the feature to replace if the attribute is a list.
Returns:
HRESULT
Legal values : S_OK , E_FAIL , E_NOTIMPL

This object is included in the file: CATMmrReplaceAdapter.h
If needed, your Imakefile.mk should include the module: CATMecModExtendItf

Copyright © 1999-2014, Dassault Systèmes. All rights reserved.