KnowledgeInterfaces CATCkeObjectAttrWriteServices
Usage: you must use this class as is. You should never derive it.
public class CATCkeObjectAttrWriteServices
Services to easily write attribute values on a Knowledge object.
Role: A Knowledge object implements CATICkeObject. These services enable to valuate its attributes values.
Note also that if the object does not publish its attributes it CAA (CATICkeObject::IsPublic), those services do not work.
- See also:
- , ,
Method Index
- o
CreateListOfValuesFromListOfStrings(CATIType_var&,CATListOfCATUnicodeString*,CATListOfCATUnicodeString*,CATLISTV(CATICkeParm_var)&)
- To prepare valuation of attributes from the explicit PLM factories we provide a service to create a list of Values from a list of type/attribute name and attribute value written as a string .
- o
CreateValueFromString(CATIType_var&,CATUnicodeString&,CATUnicodeString&,CATIValue_var&)
- To prepare valuation of attributes from the explicit PLM factories we provide a service to create a Value from a type/attribute name and attribute value written as a string .
- o
SetValue(CATICkeObject_var&,CATUnicodeString&,CATIValue_var&)
- Sets the value of an attribute in a generic manner (as a value) .
- o
SetValueWithBoolean(CATICkeObject_var&,CATUnicodeString&,CATBoolean)
- Sets the value of an attribute as a boolean .
- o
SetValueWithInteger(CATICkeObject_var&,CATUnicodeString&,int)
- Sets the value of an attribute as an integer .
- o
SetValueWithReal(CATICkeObject_var&,CATUnicodeString&,double)
- Sets the value of an attribute as a double .
- o
SetValueWithString(CATICkeObject_var&,CATUnicodeString&,CATUnicodeString&)
- Sets the value of an attribute as a string .
- o
SetValueWithTime(CATICkeObject_var&,CATUnicodeString&,CATTime&)
- Sets the value of an attribute as a time .
Methods
o CreateListOfValuesFromListOfStrings
public static CreateListOfValuesFromListOfStrings( | const | iType, |
| const | piListAttributeName, |
| const | piListValueAsString, |
| | oListOfValue) |
-
To prepare valuation of attributes from the explicit PLM factories we provide a service to create a list of Values from a list of type/attribute name and attribute value written as a string .
Note that this services only eases the creation of a CATIValue. It does not take into account information hold by the attribute like default value and so forth.
This service will work on basic values (boolean, string, integer, real, dimensions, enumerated values. It does not work on Lists.
- Parameters:
-
- iType
- Knowledge type
- piListAttributeName
- List containing names of the attribute
- piListValueAsString
- List containing Value as a string to create the attribute. If you give "", we will create a parameter with default value
.
The two list must have same size.
- oListOfValue
- List that will be filled by the service. We do not empty the list at the beginning so that you can use the service several time.
In case of error for one element, we won't fill the list
- Returns:
-
- E_INVALIDARG if the creation of one of the values has failed (bad attribute regarding to type, or string cannot be converted).
- S_OK if the value has been successfully created.
- E_FAIL otherwise.
o CreateValueFromString
public static CreateValueFromString( | const | iType, |
| const | iAttributeName, |
| const | iValueAsString, |
| | oValue) |
-
To prepare valuation of attributes from the explicit PLM factories we provide a service to create a Value from a type/attribute name and attribute value written as a string .
Note that this services only eases the creation of a CATIValue. It does not take into account information hold by the attribute like default value and so forth.
This service will work on basic values (boolean, string, integer, real, dimensions, enumerated values. It does not work on Lists.
- Parameters:
-
- iType
- Knowledge type
- iAttributeName
- Name of the attribute
- iValueAsString
- Value as a string to create the attribute. If you give "", we will create a parameter with default value
- oValue
- Value in output
- Returns:
-
- E_INVALIDARG if the creation of the value has failed (bad attribute regarding to type, or string cannot be converted.
- S_OK if the value has been successfully created.
- E_FAIL otherwise.
o SetValue
public static SetValue( | const | iObject, |
| const | iAttributeName, |
| const | iValue) |
-
Sets the value of an attribute in a generic manner (as a value) .
- Parameters:
-
- iObject
- Knowledge object on which we want to write an attribute.
- iAttributeName
- Name of the attribute in the Knowledge dictionary (internal name)
- iValue
- Value that we want to use to set the attribute value.
- Returns:
-
- E_INVALIDARG if the valuation has failed (attribute non existing on object, attribute of a bad type).
- E_ACCESSDENIED if the valuation has failed (read only attribute, object not editable).
- S_OK if the attribute has been set successfully.
- E_FAIL otherwise.
o SetValueWithBoolean
public static SetValueWithBoolean( | const | iObject, |
| const | iAttributeName, |
| const | iValBoolean) |
-
Sets the value of an attribute as a boolean .Works only on boolean attributes
- Parameters:
-
- iObject
- Knowledge object on which we want to write an attribute.
- iAttributeName
- Name of the attribute in the Knowledge dictionary (internal name)
- iValBoolean
- Value that we want to use to set the attribute value.
- Returns:
-
- E_INVALIDARG if the valuation has failed (attribute non existing on object, attribute of a bad type).
- E_ACCESSDENIED if the valuation has failed (read only attribute, object not editable).
- S_OK if the attribute has been set successfully.
- E_FAIL otherwise.
o SetValueWithInteger
public static SetValueWithInteger( | const | iObject, |
| const | iAttributeName, |
| | iValInt) |
-
Sets the value of an attribute as an integer . Works on Integer, Real, Dimensioned attributes.
- Parameters:
-
- iObject
- Knowledge object on which we want to write an attribute.
- iAttributeName
- Name of the attribute in the Knowledge dictionary (internal name)
- iValInt
- Value that we want to use to set the attribute value.
- Returns:
-
- E_INVALIDARG if the valuation has failed (attribute non existing on object, attribute of a bad type).
- E_ACCESSDENIED if the valuation has failed (read only attribute, object not editable).
- S_OK if the attribute has been set successfully.
- E_FAIL otherwise.
o SetValueWithReal
public static SetValueWithReal( | const | iObject, |
| const | iAttributeName, |
| | iValReal) |
-
Sets the value of an attribute as a double .Works on Integer, Real, Dimensioned attributes. Note that attributes defined as dimensions must be written as a double.
- Parameters:
-
- iObject
- Knowledge object on which we want to write an attribute.
- iAttributeName
- Name of the attribute in the Knowledge dictionary (internal name)
- iValReal
- Value that we want to use to set the attribute value.
- Returns:
-
- E_INVALIDARG if the valuation has failed (attribute non existing on object, attribute of a bad type).
- E_ACCESSDENIED if the valuation has failed (read only attribute, object not editable).
- S_OK if the attribute has been set successfully.
- E_FAIL otherwise.
o SetValueWithString
public static SetValueWithString( | const | iObject, |
| const | iAttributeName, |
| const | iValString) |
-
Sets the value of an attribute as a string . Works on String and enumerated attributes.
- Parameters:
-
- iObject
- Knowledge object on which we want to write an attribute.
- iAttributeName
- Name of the attribute in the Knowledge dictionary (internal name)
- iValString
- Value that we want to use to set the attribute value.
- Returns:
-
- E_INVALIDARG if the valuation has failed (attribute non existing on object, attribute of a bad type).
- E_ACCESSDENIED if the valuation has failed (read only attribute, object not editable).
- S_OK if the attribute has been set successfully.
- E_FAIL otherwise.
o SetValueWithTime
public static SetValueWithTime( | const | iObject, |
| const | iAttributeName, |
| const | iValTime) |
-
Sets the value of an attribute as a time .Works only on Date attributes
- Parameters:
-
- iObject
- Knowledge object on which we want to write an attribute.
- iAttributeName
- Name of the attribute in the Knowledge dictionary (internal name)
- iValTime
- Value that we want to use to set the attribute value.
- Returns:
-
- E_INVALIDARG if the valuation has failed (attribute non existing on object, attribute of a bad type).
- E_ACCESSDENIED if the valuation has failed (read only attribute, object not editable).
- S_OK if the attribute has been set successfully.
- E_FAIL otherwise.
This object is included in the file: CATCkeObjectAttrWriteServices.h
If needed, your Imakefile.mk should include the module: KnowledgeItf
Copyright © 1999-2015, Dassault Systèmes. All rights reserved.