FeatureModelerExt class CATFmAttributeValue

Usage: you must use this class as is. You should never derive it.


public class CATFmAttributeValue

Class representing the value of a Feature Attribute.

Role: A CATFmAttributeValue is a variant object able to hold all the types of values a Feature Attribute can bear.

The types supported are represented by the enumeration CATFmAttributeAndValueKind.

A CATFmAttributeValue is always a list of values, a single value being represented by a list of cardinality 1.

Index of list operations start at 1.

Methods that always succeed return a reference to the modified instance which allows to chain operations.


Constructor and Destructor Index


o CATFmAttributeValue()
Constructs an empty CATFmAttributeValue.
o CATFmAttributeValue(int)
Constructs a CATFmAttributeValue instance from an integer.
o CATFmAttributeValue(double)
Constructs a CATFmAttributeValue instance from a double.
o CATFmAttributeValue(CATUnicodeString&)
Constructs a CATFmAttributeValue instance from an unicode string.
o CATFmAttributeValue(CATFmAttributeValue&)
Copy constructor.
o ~CATFmAttributeValue()
Destructor.

Method Index


o Append(CATFmAttributeValue&)
Appends a CATFmAttributeValue instance at the end of the list.
o BuildFromCArrayOfBoolean(CATBoolean*,int)
Assigns a C array of boolean to a CATFmAttributeValue instance.
o BuildFromCArrayOfByte(unsigned char*,int)
Assigns a C array of byte to a CATFmAttributeValue instance.
o BuildFromCArrayOfDouble(double*,int)
Assigns a C array of double to a CATFmAttributeValue instance.
o BuildFromCArrayOfInt(int*,int)
Assigns a C array of integer to a CATFmAttributeValue instance.
o BuildFromCArrayOfString(CATUnicodeString*,int)
Assigns a C array of CATUnicodeString to a CATFmAttributeValue instance.
o BuildFromListOfDouble(CATRawColldouble&)
Assigns a CATRawColldouble list of double to a CATFmAttributeValue instance.
o BuildFromListOfFeatures(CATListValCATBaseUnknown_var&)
Assigns a CATListValCATBaseUnknown_var list of feature to a CATFmAttributeValue instance.
o BuildFromListOfInt(CATRawCollint&,CATFmAttributeAndValueKind)
Assigns a CATRawCollint list of integer to a CATFmAttributeValue instance.
o BuildFromListOfString(CATListValCATUnicodeString&)
Assigns a CATListValCATUnicodeString list of string to a CATFmAttributeValue instance.
o Clear()
Resets a CATFmAttributeValue to default value.
o ConvertToCArrayOfBoolean(CATBoolean*,int)
Converts a CATFmAttributeValue instance to a C array of boolean.
o ConvertToCArrayOfByte(unsigned char*,int)
Converts a CATFmAttributeValue instance to a C array of byte.
o ConvertToCArrayOfDouble(double*,int)
Converts a CATFmAttributeValue instance to a C array of double.
o ConvertToCArrayOfInt(int*,int)
Converts a CATFmAttributeValue instance to a C array of integer.
o ConvertToCArrayOfString(CATUnicodeString*,int)
Converts a CATFmAttributeValue instance to a C array of
o ConvertToListOfDouble(CATRawColldouble&)
Converts a CATFmAttributeValue instance to a CATRawColldouble list of double.
o ConvertToListOfFeatures(CATListValCATBaseUnknown_var&)
Converts a CATFmAttributeValue instance to a CATListValCATBaseUnknown_var list of string.
o ConvertToListOfInt(CATRawCollint&)
Converts a CATFmAttributeValue instance to a CATRawCollint list of integer.
o ConvertToListOfString(CATListValCATUnicodeString&)
Converts a CATFmAttributeValue instance to a CATListValCATUnicodeString list of string.
o CreateEmptyList(CATFmAttributeAndValueKind)
Creates a CATFmAttributeValue instance of type iKind and cardinality 0.
o Get(int,CATFmAttributeValue&)
Retrieves the value at index iIndex of a CATFmAttributeValue instance.
o GetBoolean(CATBoolean&)
Retrieves the boolean value held by a CATFmAttributeValue instance.
o GetByte(unsigned char&)
Retrieves the byte value held by a CATFmAttributeValue instance.
o GetDouble(double&)
Retrieves the double value held by a CATFmAttributeValue instance.
o GetExternalObject(CATOmbObjectInContext_var&)
Retrieves the CATOmbObjectInContext instance value held by a CATFmAttributeValue instance.
o GetFeature()
Retrieves the feature held by a CATFmAttributeValue instance.
o GetFeature(CATFmFeatureFacade&)
Retrieves the feature held by a CATFmAttributeValue instance.
o GetInteger(int&)
Retrieves the integer value held by a CATFmAttributeValue instance.
o GetLinkFacade(PLMPublicLinkFacade&)
Retrieve the PLMPublicLinkFacade instance associated to a CATFmAttributeValue instance.
o GetString(CATUnicodeString&)
Retrieves the string value held by a CATFmAttributeValue instance.
o Insert(int,CATFmAttributeValue&)
Inserts a CATFmAttributeValue instance at index iIndex.
o Kind()
Gets the kind of a CATFmAttributeValue instance.
o QueryInterfaceOnFeature(IID&,void**)
Retrieves an interface pointer on the feature held by a CATFmAttributeValue instance.
o Remove(int)
Removes index iIndex from the list.
o Set(int,CATFmAttributeValue&)
Assigns a CATFmAttributeValue instance at index iIndex.
o SetBoolean(CATBoolean)
Assigns a boolean value to a CATFmAttributeValue instance.
o SetByte(unsigned char)
Assigns a byte value to a CATFmAttributeValue instance.
o SetDouble(double)
Assigns a double value to a CATFmAttributeValue instance.
o SetExternalObject(CATOmbObjectInContext*)
Assigns a CATOmbObjectInContext instance to a CATFmAttributeValue.
o SetFeature(CATBaseUnknown*)
Assigns a feature to a CATFmAttributeValue instance.
o SetFeature(CATFmFeatureFacade&)
Assigns the feature held by a CATFmFeatureFacade to a CATFmAttributeValue instance.
o SetInteger(int)
Assigns an integer value to a CATFmAttributeValue instance.
o SetString(CATUnicodeString&)
Assigns a string value to a CATFmAttributeValue instance.
o Size()
Gets the cardinality of a CATFmAttributeValue instance.
o Swap(CATFmAttributeValue&,CATFmAttributeValue&)
Swaps the values of two CATFmAttributeValue instances.
o operator !=(CATFmAttributeValue&)
Inequality operator.
o operator =(CATFmAttributeValue&)
Assignment operator from a CATFmAttributeValue instance.
o operator ==(CATFmAttributeValue&)
Equality operator.
o operator [](int)
Subscripting operator.

Constructor and Destructor


o CATFmAttributeValue
public CATFmAttributeValue()
Constructs an empty CATFmAttributeValue.
An empty (or void) CATFmAttributeValue instance is of type CATFmKind_void and of cardinality 0.
o CATFmAttributeValue
public CATFmAttributeValue(int iValue)
Constructs a CATFmAttributeValue instance from an integer.
Resulting CATFmAttributeValue instance will be of type CATFmKind_int and of cardinality 1.
Parameters:
iValue
[in] The integer value to assign.
o CATFmAttributeValue
public CATFmAttributeValue(double iValue)
Constructs a CATFmAttributeValue instance from a double.
Resulting CATFmAttributeValue instance will be of type CATFmKind_double and of cardinality 1.
Parameters:
iValue
[in] The double value to assign.
o CATFmAttributeValue
public CATFmAttributeValue( const CATUnicodeString& iValue)
Constructs a CATFmAttributeValue instance from an unicode string.
Resulting CATFmAttributeValue instance will be of type CATFmKind_string and of cardinality 1.
Parameters:
iValue
[in] The
CATUnicodeString to assign.
o CATFmAttributeValue
public CATFmAttributeValue( const CATFmAttributeValue& iValue)
Copy constructor.
Parameters:
iValue
[in] The CATFmAttributeValue to copy. Notice that thanks to copy-on-write mechanisms, copy is almost free.
o ~CATFmAttributeValue
public ~CATFmAttributeValue()
Destructor.

Methods


o Append
public CATFmAttributeValue& Append( const CATFmAttributeValue& iValue)
Appends a CATFmAttributeValue instance at the end of the list.
This method is a shortcut for Insert after the last index of the list.
Parameters:
iValue
[in] The value to append.
Returns:
A reference to this instance.
o BuildFromCArrayOfBoolean
public CATFmAttributeValue& BuildFromCArrayOfBoolean( const CATBoolean* iArrayOfBoolean,
int iSize)
Assigns a C array of boolean to a CATFmAttributeValue instance.
Resulting CATFmAttributeValue instance will be of type CATFmKind_boolean and of cardinality iSize.
Parameters:
iArrayOfBoolean
[in] The C array of boolean to assign. If NULL, a 0 cardinality list will be built.
iSize
[in] The size of the C array of boolean to assign. If less than 0, a 0 cardinality list will be built.
Returns:
A reference to this instance.
o BuildFromCArrayOfByte
public CATFmAttributeValue& BuildFromCArrayOfByte( const unsigned char* iArrayOfByte,
int iSize)
Assigns a C array of byte to a CATFmAttributeValue instance.
Resulting CATFmAttributeValue instance will be of type CATFmKind_byte and of cardinality iSize.
Parameters:
iArrayOfByte
[in] The C array of byte to assign. If NULL, a 0 cardinality list will be built.
iSize
[in] The size of the C array of byte to assign. If less than 0, a 0 cardinality list will be built.
Returns:
A reference to this instance.
o BuildFromCArrayOfDouble
public CATFmAttributeValue& BuildFromCArrayOfDouble( const double* iArrayOfDouble,
int iSize)
Assigns a C array of double to a CATFmAttributeValue instance.
Resulting CATFmAttributeValue instance will be of type CATFmKind_double and of cardinality iSize.
Parameters:
iArrayOfDouble
[in] The C array of double to assign. If NULL, a 0 cardinality list will be built.
iSize
[in] The size of the C array of double to assign. If less than 0, a 0 cardinality list will be built.
Returns:
A reference to this instance.
o BuildFromCArrayOfInt
public CATFmAttributeValue& BuildFromCArrayOfInt( const int* iArrayOfInteger,
int iSize)
Assigns a C array of integer to a CATFmAttributeValue instance.
Resulting CATFmAttributeValue instance will be of type CATFmKind_int and of cardinality iSize.
Parameters:
iArrayOfInteger
[in] The C array of integer to assign. If NULL, a 0 cardinality list will be built.
iSize
[in] The size of the C array of integer to assign. If less than 0, a 0 cardinality list will be built.
Returns:
A reference to this instance.
o BuildFromCArrayOfString
public CATFmAttributeValue& BuildFromCArrayOfString( const CATUnicodeString* iArrayOfUnicodeString,
int iSize)
Assigns a C array of CATUnicodeString to a CATFmAttributeValue instance.
Resulting CATFmAttributeValue instance will be of type CATFmKind_string and of cardinality iSize.
Parameters:
iArrayOfUnicodeString
[in] The C array of
CATUnicodeString to assign. If NULL, a 0 cardinality list will be built.
iSize
[in] The size of the C array of unicode string to assign. If less than 0, a 0 cardinality list will be built.
Returns:
A reference to this instance.
o BuildFromListOfDouble
public CATFmAttributeValue& BuildFromListOfDouble( const CATRawColldouble& iListOfDouble)
Assigns a CATRawColldouble list of double to a CATFmAttributeValue instance.
Resulting CATFmAttributeValue instance will be of type CATFmKind_double and of cardinality iListOfDouble.Size().
Parameters:
iListOfDouble
[in] The list of double to copy.
Returns:
A reference to this instance.
o BuildFromListOfFeatures
public CATFmAttributeValue& BuildFromListOfFeatures( const CATListValCATBaseUnknown_var& iListOfFeature)
Assigns a CATListValCATBaseUnknown_var list of feature to a CATFmAttributeValue instance.
Resulting CATFmAttributeValue instance will be of type CATFmKind_feature and of cardinality iListOfFeature.Size().
Parameters:
iListOfFeature
[in] The list of feature to copy.
Notice that similarly to
SetFeature , invalid features will be treated as NULL pointers.
Returns:
A reference to this instance.
o BuildFromListOfInt
public CATFmAttributeValue& BuildFromListOfInt( const CATRawCollint& iListOfInt,
CATFmAttributeAndValueKind iKind=CATFmKind_int)
Assigns a CATRawCollint list of integer to a CATFmAttributeValue instance.
Optional input kind iKind allows to specify the type of the resulting CATFmAttributeValue instance.
Parameters:
iListOfInt
[in] The list of integer to copy.
iKind
[in] The kind of the CATFmAttributeValue instance to build.
Legal values:
CATFmKind_boolean
Instance type will become CATFmKind_boolean.
CATFmKind_byte
Instance type will become CATFmKind_byte.
CATFmKind_int
Instance type will become CATFmKind_int. This is the default value
In other cases, instance will be reset to default value (CATFmKind_void).
Returns:
A reference to this instance.
o BuildFromListOfString
public CATFmAttributeValue& BuildFromListOfString( const CATListValCATUnicodeString& iListOfUnicodeString)
Assigns a CATListValCATUnicodeString list of string to a CATFmAttributeValue instance.
Resulting CATFmAttributeValue instance will be of type CATFmKind_string and of cardinality iListOfUnicodeString.Size().
Parameters:
iListOfUnicodeString
[in] The list of unicode string to copy.
Returns:
A reference to this instance.
o Clear
public CATFmAttributeValue& Clear()
Resets a CATFmAttributeValue to default value.
Default value is the same as the one obtained through the default constructor.
Returns:
A reference to this instance.
o ConvertToCArrayOfBoolean
public HRESULT ConvertToCArrayOfBoolean(CATBoolean* oArrayOfBoolean,
int iArraySize) const
Converts a CATFmAttributeValue instance to a C array of boolean.
Type of the instance must be CATFmKind_boolean.
Parameters:
oArrayOfBoolean
[out] The C array where to copy CATFmAttributeValue content.
oArrayOfBoolean must be not NULL and must be able to hold at least iArraySize items.
Note: In case of failure, iArraySize elements of oArrayOfBoolean will be set to 0.
iArraySize
[in] The number of elements to copy to oArrayOfBoolean.
It must be equal to the size of the CATFmAttributeValue instance.
Returns:
An HRESULT value.
Legal values:
S_OK
Instance has been successfully converted to a C array of boolean.
S_FALSE
Instance size is 0.
E_INVALIDARG
iArraySize is not equal to instance size or oArrayOfBoolean is NULL.
E_FMTYPEMISMATCH
Instance type is not CATFmKind_boolean.
o ConvertToCArrayOfByte
public HRESULT ConvertToCArrayOfByte(unsigned char* oArrayOfByte,
int iArraySize) const
Converts a CATFmAttributeValue instance to a C array of byte.
Type of the instance must be CATFmKind_byte.
Parameters:
oArrayOfByte
[out] The C array where to copy CATFmAttributeValue content.
oArrayOfByte must be not NULL and must be able to hold at least iArraySize items.
Note: In case of failure, iArraySize elements of oArrayOfByte will be set to 0.
iArraySize
[in] The number of elements to copy to oArrayOfByte.
It must be equal to the size of the CATFmAttributeValue instance.
Returns:
An HRESULT value.
Legal values:
S_OK
Instance has been successfully converted to a C array of byte.
S_FALSE
Instance size is 0.
E_INVALIDARG
iArraySize is not equal to instance size or oArrayOfByte is NULL.
E_FMTYPEMISMATCH
Instance type is not CATFmKind_byte.
o ConvertToCArrayOfDouble
public HRESULT ConvertToCArrayOfDouble(double* oArrayOfDouble,
int iArraySize) const
Converts a CATFmAttributeValue instance to a C array of double.
Type of the instance must be CATFmKind_double.
Parameters:
oArrayOfDouble
[out] The C array where to copy CATFmAttributeValue content.
oArrayOfDouble must be not NULL and must be able to hold at least iArraySize items.
Note: In case of failure, iArraySize elements of oArrayOfInteger will be set to 0.
iArraySize
[in] The number of elements to copy to oArrayOfDouble.
It must be equal to the size of the CATFmAttributeValue instance.
Returns:
An HRESULT value.
Legal values:
S_OK
Instance has been successfully converted to a C array of double.
S_FALSE
Instance size is 0.
E_INVALIDARG
iArraySize is not equal to instance size or oArrayOfDouble is NULL.
E_FMTYPEMISMATCH
Instance type is not CATFmKind_double.
o ConvertToCArrayOfInt
public HRESULT ConvertToCArrayOfInt(int* oArrayOfInteger,
int iArraySize) const
Converts a CATFmAttributeValue instance to a C array of integer.
Type of the instance must be CATFmKind_int.
Parameters:
oArrayOfInteger
[out] The C array where to copy CATFmAttributeValue content.
oArrayOfInteger must be not NULL and must be able to hold at least iArraySize items.
Note: In case of failure, iArraySize elements of oArrayOfInteger will be set to 0.
iArraySize
[in] The number of elements to copy to oArrayOfInteger.
It must be equal to the size of the CATFmAttributeValue instance.
Returns:
An HRESULT value.
Legal values:
S_OK
Instance has been successfully converted to a C array of integer.
S_FALSE
Instance size is 0.
E_INVALIDARG
iArraySize is not equal to instance size or oArrayOfInteger is NULL.
E_FMTYPEMISMATCH
Instance type is not CATFmKind_int.
o ConvertToCArrayOfString
public HRESULT ConvertToCArrayOfString(CATUnicodeString* oArrayOfString,
int iArraySize) const
Converts a CATFmAttributeValue instance to a C array of CATUnicodeString.
Type of the instance must be CATFmKind_string.
Parameters:
oArrayOfString
[out] The C array where to copy CATFmAttributeValue content.
oArrayOfString must be not NULL and must be able to hold at least iArraySize items.
Note: In case of failure, iArraySize elements of oArrayOfInteger will be set to empty string.
iArraySize
[in] The number of elements to copy to oArrayOfString.
It must be equal to the size of the CATFmAttributeValue instance.
Returns:
An HRESULT value.
Legal values:
S_OK
Instance has been successfully converted to a C array of CATUnicodeString.
S_FALSE
Instance size is 0.
E_INVALIDARG
iArraySize is not equal to instance size or oArrayOfString is NULL.
E_FMTYPEMISMATCH
Instance type is not CATFmKind_string.
o ConvertToListOfDouble
public HRESULT ConvertToListOfDouble(CATRawColldouble& oListOfDouble) const
Converts a CATFmAttributeValue instance to a CATRawColldouble list of double.
This method works on CATFmAttributeValue instance of type CATFmKind_double.
Parameters:
oListOfDouble
[out] The list of double to assign.
In case of failure oListOfDouble will be resized to 0.
Returns:
An HRESULT value.
Legal values:
S_OK
Instance has been successfully converted to a list of double.
E_FMTYPEMISMATCH
Instance type is not CATFmKind_double.
o ConvertToListOfFeatures
public HRESULT ConvertToListOfFeatures(CATListValCATBaseUnknown_var& oListOfFeature) const
Converts a CATFmAttributeValue instance to a CATListValCATBaseUnknown_var list of string.
This method works on CATFmAttributeValue instance of type CATFmKind_feature.
Parameters:
oListOfFeature
[out] The list of feature to assign.
In case of failure oListOfFeature will be resized to 0.
Returns:
An HRESULT value.
Legal values:
S_OK
Instance has been successfully converted to a list of feature.
E_FMTYPEMISMATCH
Instance type is not CATFmKind_feature.
E_FMNOTLOADED
At least one feature in the list is not loaded.
E_FMINVALIDFEATURE
At least one feature in the list is not valid.
o ConvertToListOfInt
public HRESULT ConvertToListOfInt(CATRawCollint& oListOfInteger) const
Converts a CATFmAttributeValue instance to a CATRawCollint list of integer.
This method works on CATFmAttributeValue instance of type CATFmKind_boolean, CATFmKind_byte or CATFmKind_int.
Parameters:
oListOfInteger
[out] The list of integer to assign.
In case of failure oListOfInteger will be resized to 0.
Returns:
An HRESULT value.
Legal values:
S_OK
Instance has been successfully converted to a list of integer.
E_FMTYPEMISMATCH
Instance type is not CATFmKind_boolean, CATFmKind_byte or CATFmKind_int.
o ConvertToListOfString
public HRESULT ConvertToListOfString(CATListValCATUnicodeString& oListOfString) const
Converts a CATFmAttributeValue instance to a CATListValCATUnicodeString list of string.
This method works on CATFmAttributeValue instance of type CATFmKind_string.
Parameters:
oListOfString
[out] The list of unicode string to assign.
In case of failure oListOfString will be resized to 0.
Returns:
An HRESULT value.
Legal values:
S_OK
Instance has been successfully converted to a list of unicode string.
E_FMTYPEMISMATCH
Instance type is not CATFmKind_string.
o CreateEmptyList
public static CATFmAttributeValue CreateEmptyList(CATFmAttributeAndValueKind iKind)
Creates a CATFmAttributeValue instance of type iKind and cardinality 0.
Parameters:
iKind
[in] Type type of the instance to create.
Returns:
A CATFmAttributeValue instance of type iKind and cardinality 0. This method can be usefull for example in order to resize a feature attribute value to 0 using CATFmFeatureFacade.SetValue.
o Get
public HRESULT Get(int iIndex,
CATFmAttributeValue& oValue) const
Retrieves the value at index iIndex of a CATFmAttributeValue instance.
Parameters:
iIndex
[in] The index of the value to retrieve.
This index must be greater (strictly) than 0 and less than or equal to instance cardinality.
oValue
[out] The value at index iIndex of this instance. In case of failure default value is assigned to oValue.
Returns:
An HRESULT value.
Legal values:
S_OK
A value has been retrieved at given index.
E_FMOUTOFBOUND
Index iIndex is out of bounds [1,Size()].
o GetBoolean
public HRESULT GetBoolean(CATBoolean& oBoolean) const
Retrieves the boolean value held by a CATFmAttributeValue instance.
Parameters:
oBoolean
[out] The boolean value retrieved. In case of failure, FALSE will be assigned to it.
Returns:
An HRESULT value.
Legal values:
S_OK
The instance kind is CATFmKind_boolean and its size is 1.
E_FMTYPEMISMATCH
The instance kind is not CATFmKind_boolean.
E_FMNOTASINGLE
The instance size is not equal to 1.
o GetByte
public HRESULT GetByte(unsigned char& oByte) const
Retrieves the byte value held by a CATFmAttributeValue instance.
Parameters:
oByte
[out] The byte value retrieved. In case of failure, 0 will be assigned to it.
Returns:
An HRESULT value.
Legal values:
S_OK
The instance kind is CATFmKind_byte and its size is 1.
E_FMTYPEMISMATCH
The instance kind is not CATFmKind_byte.
E_FMNOTASINGLE
The instance size is not equal to 1.
o GetDouble
public HRESULT GetDouble(double& oDouble) const
Retrieves the double value held by a CATFmAttributeValue instance.
Parameters:
oDouble
[out] The double value retrieved. In case of failure, 0 will be assigned to it.
Returns:
An HRESULT value.
Legal values:
S_OK
The instance kind is CATFmKind_double and its size is 1.
E_FMTYPEMISMATCH
The instance kind is not CATFmKind_double.
E_FMNOTASINGLE
The instance size is not equal to 1.
o GetExternalObject
public HRESULT GetExternalObject(CATOmbObjectInContext_var& oObjectInContext) const
Retrieves the CATOmbObjectInContext instance value held by a CATFmAttributeValue instance.
Parameters:
oObjectInContext
[out] A smart pointer to the object in context retrieved.
In case of failure, NULL will be assigned to it.
Returns:
An HRESULT value.
Legal values:
S_OK
The instance kind is CATFmKind_external, its cardinality is 1 and a non NULL object in context has been retrieved
S_FALSE
The instance kind is CATFmKind_external, its cardinality is 1 but NULL object in context has been retrieved
E_FMTYPEMISMATCH
The instance kind is not CATFmKind_feature.
E_FMNOTASINGLE
The instance size is not equal to 1.
Other
Other hresults can occur if the set pointed PLM component could not be loaded or the pointed object does not exist in the pointed PLM component any more.
In these cases, more information on the cause can be obtained with CATOmbLinkStatusServices.GetLinkStatusFromRc.
o GetFeature
public CATBaseUnknown_var GetFeature()const
Retrieves the feature held by a CATFmAttributeValue instance.
Returns:
The feature held by this instance. A NULL pointer will be returned in all failure cases detailed in other GetFeature method.
o GetFeature
public HRESULT GetFeature(CATFmFeatureFacade& oFeatureFacade) const
Retrieves the feature held by a CATFmAttributeValue instance.
Parameters:
oFeatureFacade
[out] The feature retrieved. In case of failure, the facade is no more bound to a feature.
Returns:
An HRESULT value.
Legal values:
S_OK
The instance kind is CATFmKind_feature, its size is 1 and the value contains a non NULL feature.
S_FALSE
The instance kind is CATFmKind_feature, its size is 1 but the value contains a NULL feature.
E_FMTYPEMISMATCH
The instance kind is not CATFmKind_feature.
E_FMNOTASINGLE
The instance size is not equal to 1.
E_FMNOTLOADED
The feature is not loaded.
E_FMINVALIDFEATURE
The feature is not valid.
o GetInteger
public HRESULT GetInteger(int& oInteger) const
Retrieves the integer value held by a CATFmAttributeValue instance.
Parameters:
oInteger
[out] The integer value retrieved. In case of failure, 0 will be assigned to it.
Returns:
An HRESULT value.
Legal values:
S_OK
The instance kind is CATFmKind_int and its size is 1.
E_FMTYPEMISMATCH
The instance kind is not CATFmKind_int.
E_FMNOTASINGLE
The instance size is not equal to 1.
o GetLinkFacade
public HRESULT GetLinkFacade(PLMPublicLinkFacade& oLinkFacade)
Retrieve the PLMPublicLinkFacade instance associated to a CATFmAttributeValue instance.
Parameters:
oLinkFacade
[out]
Returns:
An HRESULT value.
Legal values:
S_OK
The instance kind is CATFmKind_external, its cardinality is 1 and the associated facade has been retrieved.
S_FALSE
The instance kind is CATFmKind_external, its cardinality is 1 but no facade has been retrieved because the external object has been set to a NULL value.
E_FMTYPEMISMATCH
The instance kind is not CATFmKind_feature.
E_FMNOTASINGLE
The instance size is not equal to 1.
Other
Other hresults can occur.
o GetString
public HRESULT GetString(CATUnicodeString& oUnicodeString) const
Retrieves the string value held by a CATFmAttributeValue instance.
Parameters:
oUnicodeString
[out] The string value retrieved. In case of failure, empty string will be assigned to it.
Returns:
An HRESULT value.
Legal values:
S_OK
The instance kind is CATFmKind_string and its size is 1.
E_FMTYPEMISMATCH
The instance kind is not CATFmKind_string.
E_FMNOTASINGLE
The instance size is not equal to 1.
o Insert
public HRESULT Insert(int iIndex,
const CATFmAttributeValue& iValue)
Inserts a CATFmAttributeValue instance at index iIndex.
Parameters:
iIndex
[in] The index where the value must be inserted.
This index must be greater (strictly) than 0 and less than or equal to this instance cardinality + 1.
iValue
[in] The CATFmAttributeValue instance to insert.
iValue must be of cardinality 1 and its kind cannot be CATFmKind_any or CATFmKind_void.
Note: If this instance is not unset (CATFmKind_void) and iValue has not the same type, this instance type will become CATFmKind_any.
Returns:
An HRESULT value.
Legal values:
S_OK
The value has been succesfully inserted at given index.
E_FMOUTOFBOUND
Index iIndex is out of bound.
E_INVALIDARG
Input instance iValue has cardinality different from 1 or its type is CATFmKind_any.
o Kind
public CATFmAttributeAndValueKind Kind()const
Gets the kind of a CATFmAttributeValue instance.
Returns:
The CATFmAttributeAndValueKind of the CATFmAttributeValue instance.
o QueryInterfaceOnFeature
public HRESULT QueryInterfaceOnFeature( const IID& iIID,
void** oPtr) const
Retrieves an interface pointer on the feature held by a CATFmAttributeValue instance.
Parameters:
iIID
[in] The interface identifier for which a pointer is requested.
oPtr
[out, CATBaseUnknown#Release] The address where the returned pointer to the interface is located. In case of success, this pointer must be released after use.
Returns:
An HRESULT value.
Legal values:
S_OK
The instance kind is CATFmKind_feature, its size is 1 and the value contains a non NULL feature which implements requested interface.
E_INVALIDARG
Output pointer oPtr is NULL.
E_POINTER
The instance kind is CATFmKind_feature, its size is 1 but the value contains a NULL feature.
E_FMTYPEMISMATCH
The instance kind is not CATFmKind_feature.
E_FMNOTASINGLE
The instance size is not equal to 1.
E_FMNOTLOADED
The feature is not loaded.
E_FMINVALIDFEATURE
The feature is not valid.
E_NOINTERFACE
The feature does not implement requested interface.
o Remove
public HRESULT Remove(int iIndex)
Removes index iIndex from the list.
Parameters:
iIndex
[in] The index which must be removed.
This index must be greater (strictly) than 0 and less than or equal to instance cardinality.
Returns:
An HRESULT value.
Legal values:
S_OK
Input index was succesfully removed.
E_FMOUTOFBOUND
Input index is out of bound.
o Set
public HRESULT Set(int iIndex,
const CATFmAttributeValue& iValue)
Assigns a CATFmAttributeValue instance at index iIndex.
Parameters:
iIndex
[in] The index where the value must be set.
This index must be greater (strictly) than 0 and less than or equal to instance cardinality.
iValue
[in] The CATFmAttributeValue instance to assign.
iValue must be of cardinality 1 and its kind cannot be CATFmKind_any or CATFmKind_void.
Note: If this instance is not unset (
CATFmKind_void) and iValue has not the same type, this instance type will become CATFmKind_any.
Returns:
An HRESULT value.
Legal values:
S_OK
The value has been succesfully set at given index.
E_FMOUTOFBOUND
Index iIndex is out of bounds [1,Size()].
E_INVALIDARG
Input instance iValue has a cardinality different from 1 or its type is CATFmKind_any.
o SetBoolean
public CATFmAttributeValue& SetBoolean(CATBoolean iBoolean)
Assigns a boolean value to a CATFmAttributeValue instance.
Resulting instance will have kind CATFmKind_boolean and cardinality 1.
Parameters:
iBoolean
[in] The boolean value to assign.
Returns:
A reference to this instance.
o SetByte
public CATFmAttributeValue& SetByte(unsigned char iByte)
Assigns a byte value to a CATFmAttributeValue instance.
Resulting instance will have kind CATFmKind_byte and cardinality 1.
Parameters:
iByte
[in] The byte value to assign.
Returns:
A reference to this instance.
o SetDouble
public CATFmAttributeValue& SetDouble(double iDouble)
Assigns a double value to a CATFmAttributeValue instance.
Resulting instance will have kind CATFmKind_double and cardinality 1.
Parameters:
iDouble
[in] The double value to assign.
Returns:
A reference to this instance.
o SetExternalObject
public CATFmAttributeValue& SetExternalObject( const CATOmbObjectInContext* iObjectInContext)
Assigns a CATOmbObjectInContext instance to a CATFmAttributeValue.
Resulting instance will have kind CATFmKind_external and cardinality 1.
Parameters:
iObjectInContext
[in] A pointer to a
CATOmbObjectInContext instance (can be NULL).
Returns:
A reference to this instance.
o SetFeature
public CATFmAttributeValue& SetFeature( const CATBaseUnknown* iObject)
Assigns a feature to a CATFmAttributeValue instance.
Resulting instance will have kind CATFmKind_feature and cardinality 1.
Parameters:
iObject
[in] A pointer to a
CATBaseUnknown instance (can be NULL).
Notice that if iObject is not a feature, it will be treated as a NULL pointer.
Returns:
A reference to this instance.
o SetFeature
public CATFmAttributeValue& SetFeature( const CATFmFeatureFacade& iFeatureFacade)
Assigns the feature held by a CATFmFeatureFacade to a CATFmAttributeValue instance.
Resulting instance will have kind CATFmKind_feature and cardinality 1.
Parameters:
iFeatureFacade
[in] The
CATFmFeatureFacade instance to assign.
Returns:
A reference to this instance.
o SetInteger
public CATFmAttributeValue& SetInteger(int iInteger)
Assigns an integer value to a CATFmAttributeValue instance.
Resulting instance will have kind CATFmKind_int and cardinality 1.
Parameters:
iInteger
[in] The integer value to assign.
Returns:
A reference to this instance.
o SetString
public CATFmAttributeValue& SetString( const CATUnicodeString& iUnicodeString)
Assigns a string value to a CATFmAttributeValue instance.
Resulting instance will have kind CATFmKind_string and cardinality 1.
Parameters:
iUnicodeString
[in] The string value to assign.
Returns:
A reference to this instance.
o Size
public int Size()const
Gets the cardinality of a CATFmAttributeValue instance.
Returns:
The size of the CATFmAttributeValue instance.
o Swap
public static void Swap(CATFmAttributeValue& ioValue1,
CATFmAttributeValue& ioValue2)
Swaps the values of two CATFmAttributeValue instances.
Parameters:
ioValue1
[in, out] The first instance.
ioValue2
[in, out] The second instance.
o operator !=
public int operator !=( const CATFmAttributeValue& iValue) const
Inequality operator.
Parameters:
iValue
The instance to compare with this instance.
Returns:
  • 0 : Instances are equal.
  • other: Instances are not equal.
o operator =
public CATFmAttributeValue& operator =( const CATFmAttributeValue& iValue)
Assignment operator from a CATFmAttributeValue instance.
Parameters:
iValue
[in] The CATFmAttributeValue instance to copy.
Notice that thanks to copy-on-write mechanism, copy is practically free.
Returns:
A reference to this instance.
o operator ==
public int operator ==( const CATFmAttributeValue& iValue) const
Equality operator.
Parameters:
iValue
The instance to compare with this instance.
Returns:
  • 0 : Instances are not equal.
  • other: Instances are equal.
o operator []
public const CATFmAttributeValue operator [](int iIndex) const
Subscripting operator.
Returns the value at index iIndex of a CATFmAttributeValue instance.
Parameters:
iIndex
[in] The index of the value to retrieve.
This index must be greater (strictly) than 0 and less than or equal to instance cardinality.
Returns:
The value at index iIndex of this instance.
If the index is out of bounds [1,Size()], a default CATFmAttributeValue of type CATFmKind_void and cardinality 0 is returned.

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

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