KnowledgeInterfaces CATCkeObjectAttrReadServices
Usage: you must use this class as is. You should never derive it.
public class CATCkeObjectAttrReadServices
Services to easily read attribute values on a Knowledge object.
Role: A Knowledge object implements CATICkeObject. These services enable to read its attributes values.
Note that only simple (boolean, integer, real, string) and persistent values are accessed by those services. As opposed to computed values.
Note also that if the object does not publish its attributes in CAA (CATICkeObject::IsPublic), those services do not work.
- See also:
- , , , ,
Method Index
- o
GetAttributeNLSNameFromObject(CATICkeObject_var&,CATUnicodeString&,CATUnicodeString&)
- Produces the NLS name of an attribute for a given object.
- o
GetListOfAttributes(CATICkeObject_var&,CATListOfCATUnicodeString&,CATListOfCATUnicodeString&,CATLISTV(CATICkeParm_var)&)
- Returns all the PLM attributes of an object (it scans all types that the object supports including extensions).
- o
GetValue(CATICkeObject_var&,CATUnicodeString&,CATIValue_var&)
- Reads the value of an attribute in a generic manner (as a value).
- o
GetValueAsBoolean(CATICkeObject_var&,CATUnicodeString&,CATBoolean&)
- Reads the value of an attribute as a boolean.
- o
GetValueAsInteger(CATICkeObject_var&,CATUnicodeString&,int&)
- Reads the value of an attribute as an integer.
- o
GetValueAsReal(CATICkeObject_var&,CATUnicodeString&,double&)
- Reads the value of an attribute as a double.
- o
GetValueAsString(CATICkeObject_var&,CATUnicodeString&,CATUnicodeString&)
- Reads the value of an attribute as a string.
- o
GetValueAsTime(CATICkeObject_var&,CATUnicodeString&,CATTime&)
- Reads the value of an attribute as a Time.
- o
IsSet(CATICkeObject_var&,CATUnicodeString&,CATBoolean&)
- Reads the value of an attribute and tests if it is set or not.
- o
ListCustomerExtensions(CATICkeObject_var&,CATListValCATIType_var&)
- Fills the given list with types supported by this object that correspond to customer extensions.
- o
ProduceDisplayName(CATICkeObject_var&,CATUnicodeString&)
- Returns a display name for the object in input.
- o
RetrieveInstanceUsedForFederation(CATICkeObject_var&,CATIType_var&,CATICkeObject_var&)
- Extends an object by a virtual extension that contains only computed attributes.
- o
ShowAttributeValue(CATICkeObject_var&,CATUnicodeString&,CATUnicodeString&,CATICkeUnit_var&)
- Produces a string to represent the value of an attribute on an object.
Methods
o GetAttributeNLSNameFromObject
public static GetAttributeNLSNameFromObject( | const | iObject, |
| const | iAttributeName, |
| | oNLSName) |
-
Produces the NLS name of an attribute for a given object. Used for edit properties/browse properties
- Parameters:
-
- iObject
- object in input. A PLM object.
- iAttributeName
- Name of the attribute in the Knowledge dictionary (internal name)
- oNLSName
- NLS Name of the attribute
- Returns:
-
- E_INVALIDARG if iObject NULL of attribute not found
- S_FALSE if no NLS translation found: we will return the name of the attribute
- S_OK if translation found
o GetListOfAttributes
public static GetListOfAttributes( | const | iObject, |
| | ioAttributeNameList, |
| | ioAttributeValueAsStringList, |
| | ioAttributeValueList) |
-
Returns all the PLM attributes of an object (it scans all types that the object supports including extensions). Or fills the values for a list of attributes in input
- Parameters:
-
- iObject
- Knowledge object on which we want to list the attributes
- ioAttributeNameList
- List in input that is filled by the method and that returns the attributes names. It should be empty before calling the method. If it is not empty, this method will fill the values for the attributes in this list.
- ioAttributeValueAsStringList
- List in input that is filled by the method and that returns the attributes values as strings. It should be empty before calling the method.
- ioAttributeValueList
- List in input that is filled by the method and that returns the attributes values as values. It should be empty before calling the method.
- Returns:
-
- E_INVALIDARG if iObject is NULL. Or if one of the attributes in the list does not exist on the object.
- S_OK if the attributes have been read successfully.
o GetValue
public static GetValue( | const | iObject, |
| const | iAttributeName, |
| | oValue) |
-
Reads the value of an attribute in a generic manner (as a value). Works in all cases. Must be used to read List attributes.
- Parameters:
-
- iObject
- Knowledge object on which we want to read an attribute.
- iAttributeName
- Name of the attribute in the Knowledge dictionary (internal name)
- oValue
- Value that we will read on the attribute.
- Returns:
-
- E_INVALIDARG if the read operation has failed (attribute non existing on object, attribute of a bad type).
- S_OK if the attribute has been read successfully.
o GetValueAsBoolean
public static GetValueAsBoolean( | const | iObject, |
| const | iAttributeName, |
| | oValBoolean) |
-
Reads the value of an attribute as a boolean. Works only on boolean attributes.
- Parameters:
-
- iObject
- Knowledge object on which we want to read an attribute.
- iAttributeName
- Name of the attribute in the Knowledge dictionary (internal name)
- oValBoolean
- Value that we will read on the attribute.
- Returns:
-
- E_INVALIDARG if the read operation has failed (attribute non existing on object, attribute of a bad type).
- S_OK if the attribute has been read successfully.
o GetValueAsInteger
public static GetValueAsInteger( | const | iObject, |
| const | iAttributeName, |
| | oValInt) |
-
Reads the value of an attribute as an integer. Works on Integer, Real, Dimensioned attributes.
- Parameters:
-
- iObject
- Knowledge object on which we want to read an attribute.
- iAttributeName
- Name of the attribute in the Knowledge dictionary (internal name): it should be
- oValInt
- Value that we will read on the attribute.
- Returns:
-
- E_INVALIDARG if the read operation has failed (attribute non existing on object, attribute of a bad type).
- S_OK if the attribute has been read successfully.
o GetValueAsReal
public static GetValueAsReal( | const | iObject, |
| const | iAttributeName, |
| | oValReal) |
-
Reads the value of an attribute as a double. Works on Integer, Real, Dimensioned attributes. Note that attributes defined as dimensions must be read as a double.
- Parameters:
-
- iObject
- Knowledge object on which we want to read an attribute.
- iAttributeName
- Name of the attribute in the Knowledge dictionary (internal name)
- oValReal
- Value that we will read on the attribute.
- Returns:
-
- E_INVALIDARG if the read operation has failed (attribute non existing on object, attribute of a bad type).
- S_OK if the attribute has been read successfully.
o GetValueAsString
public static GetValueAsString( | const | iObject, |
| const | iAttributeName, |
| | oValString) |
-
Reads the value of an attribute as a string. Works on String and enumerated attributes.
- Parameters:
-
- iObject
- Knowledge object on which we want to read an attribute.
- iAttributeName
- Name of the attribute in the Knowledge dictionary (internal name)
- oValString
- Value that we will read on the attribute.
- Returns:
-
- E_INVALIDARG if the read operation has failed (attribute non existing on object, attribute of a bad type).
- S_OK if the attribute has been read successfully.
o GetValueAsTime
public static GetValueAsTime( | const | iObject, |
| const | iAttributeName, |
| | oValTime) |
-
Reads the value of an attribute as a Time. Works on date attributes
- Parameters:
-
- iObject
- Knowledge object on which we want to read an attribute.
- iAttributeName
- Name of the attribute in the Knowledge dictionary (internal name): it should be
- oValTime
- Value that we will read on the attribute.
- Returns:
-
- E_INVALIDARG if the read operation has failed (attribute non existing on object, attribute of a bad type).
- S_OK if the attribute has been read successfully.
- S_FALSE if the attribute is Unset
o IsSet
public static IsSet( | const | iObject, |
| const | iAttributeName, |
| | oIsSetStatus) |
-
Reads the value of an attribute and tests if it is set or not. Works in all cases. .
If you need to access the value afterwards, it is more efficient to use GetValue and to access the Unset status on the returned value.
- Parameters:
-
- iObject
- Knowledge object on which we want to read an attribute.
- iAttributeName
- Name of the attribute in the Knowledge dictionary (internal name)
- oIsSetStatus
- Unset/Set status of the attribute
- TRUE if the attribute is set.
- FALSE if the attribute is unset.
TRUE is it is set, FALSE instead
- Returns:
-
- E_INVALIDARG if the read operation has failed (attribute non existing on object, attribute of a bad type).
- S_OK if the attribute has been accessed successfully.
o ListCustomerExtensions
public static ListCustomerExtensions( | const | iObject, |
| | iolListOfCATIType) |
-
Fills the given list with types supported by this object that correspond to customer extensions.
- Parameters:
-
- iObject
- the object in input.
- iolListOfCATIType
- the filled list.
- Returns:
-
- E_INVALIDARG if the object in input is NULL.
- S_OK if the type has been retrieved.
- S_FALSE if the list is empty
o ProduceDisplayName
public static ProduceDisplayName( | const | iObject, |
| | oDisplayName) |
-
Returns a display name for the object in input.
Note that information is computed each time we ask for it. There is no cache.
- Parameters:
-
- iObject
- the object in input.
- oDisplayName
- the object in output.
- Returns:
-
- E_INVALIDARG if the object in input is NULL.
- S_OK if the type has been retrieved.
- S_FALSE if the list is empty
o RetrieveInstanceUsedForFederation
public static RetrieveInstanceUsedForFederation( | const | iObjectToExtend, |
| const | iExtensionType, |
| | oFederatedObject) |
-
Extends an object by a virtual extension that contains only computed attributes.
This method returns an object that enables to access the computed attributes on the object to extend.
The implementation of the computed attributs must be done on a late type with a prefix CATInstanceFederation* where * is the name of the extension type.
The implementation implements CATIAttributeComputed
- Parameters:
-
- iObjectToDelegateTo
- object in input
- iExtensionType
- Type of the virtual extension
- oFederatedObject
- Object used to federate attributes
- Returns:
-
- E_INVALIDARG if iObjectToExtend NULL or iExtension NULL).
- S_OK if the instance has been correctly created
- E_FAIL if we didn't find the factory that computes attribute
- S_FALSE if the implementation of the computed attribute cannot work on this object
o ShowAttributeValue
public static ShowAttributeValue( | const | iObject, |
| const | iAttributeName, |
| | oValueToShow, |
| const | iUnit | = NULL_var) |
-
Produces a string to represent the value of an attribute on an object.
This method produces a value with unit for an attribute with a magnitude.
- Parameters:
-
- iObject
- object in input. A PLM object.
- iAttributeName
- Name of the attribute in the Knowledge dictionary (internal name)
- oValueToShow
- Value to show
- oUnit
- The unit to show the attribute. If set to NULL, the default unit will be chosen
- Returns:
- classic HRESULT
This object is included in the file: CATCkeObjectAttrReadServices.h
If needed, your Imakefile.mk should include the module: KnowledgeItf
Copyright © 1999-2015, Dassault Systèmes. All rights reserved.