All Frameworks  Class Hierarchy  This Framework  Indexes   

ObjectSpecsModeler Class CATSpecReplaceExt

Usage: you can derive this class.


public class CATSpecReplaceExt

Base class to give implementation for CATIReplace.
usage: Only IsElementValidForReplace method needs to be overloaded. To subscribe to replace, this object also has to implement CATIAttrBehavior.

See also:
CATIReplace, CATIAttrBehavior


Constructor and Destructor Index


o CATSpecReplaceExt()
Constructs a CATSpecReplaceExt.
o ~CATSpecReplaceExt()

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 CATSpecReplaceExt
public CATSpecReplaceExt()
Constructs a CATSpecReplaceExt.
o ~CATSpecReplaceExt
public virtual ~CATSpecReplaceExt()

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:
Output values must be valuated as follows :
   oBehaviorArray = new CATListPtrIID[2];
   oBehaviorArraySize = 2;
   // Way #1.
   CATListPtrIID subList (3);
   subList[1] = &IID_CATIHello;
   subList[2] = &IID_CATIBonjour;
   subList[3] = &IID_CATIBuenosDias;
   oBehaviorArray[0] = subList;
   // Way #2.
   oBehaviorArray[1].Append(&IID_CATIAufwiedersehen);
   oBehaviorArray[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 iAttributeName,
const iElement,
oMessage,
oElementValidity,
const iOldValue=NULL_var)
Determine wether the candidate element is allowed to replace the existing one.
Parameters:
iAttributeName
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 iAttributeName,
new_element,
const old_value=NULL_var )
Valuates a given attribute with an other object.
Parameters:
iAttributeName
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: CATSpecReplaceExt.h
If needed, your Imakefile.mk should include the module: CATObjectSpecsModeler

Copyright © 2003, Dassault Systèmes. All rights reserved.