HxmProperty Class¶
-
class HxmProperty¶
An HxmProperty represents a property belonging to a modeler class. It can be used to get or set the value of a property on objects of the associated class.
Unlike fields, properties do not have an actual value and can be readonly. The value is represented by two functions: a getter function and a setter function which can be absent.
HxmProperty are not modeler objects: they are merely descriptions that tell the modeler how to modify the properties of a class. They cannot be transformed into modeler values.
- Since:
13.0
Summary¶
Returns the value of this property associated with the object given as parameter. |
|
Returns the value of this property associated with the object given as parameter as an integer. |
|
Returns the value of this property associated with the object given as parameter as a double. |
|
Returns the value of this property associated with the object given as parameter as a boolean. |
|
Returns the value of this property associated with the object given as parameter as an expression. |
|
Returns the value of this property associated with the object given as parameter as a string. |
|
Returns the value of this property associated with the object given as parameter as a module. |
|
Returns the value of this property associated with the object given as parameter as a map. |
|
Returns the value of this property associated with the object given as parameter as a function. |
|
Returns the value of this property associated with the object given as parameter as a class. |
|
Sets the value of this property for the object given as parameter. |
|
Sets the value of this property for the object given as parameter. |
|
Sets the value of this property for the object given as parameter. |
|
Sets the value of this property for the object given as parameter. |
|
Sets the value of this property for the object given as parameter. |
|
Sets the value of this property for the object given as parameter. |
|
Sets the value of this property for the object given as parameter. |
|
Sets the value of this property for the object given as parameter. |
|
Sets the value of this property for the object given as parameter. |
|
Sets the value of this property for the object given as parameter. |
|
Returns true if the property is read-only. |
Functions¶
-
HxmValue HxmProperty::getValue(const HxmValue &obj) const¶
Returns the value of this property associated with the object given as parameter. The object passed as parameter must be an instance of the class to which this property belongs.
- Parameters:
obj – The object on which to retrieve the property value.
- Returns:
Value of the property on the given object.
- See:
-
long HxmProperty::getInt(const HxmValue &obj) const¶
Returns the value of this property associated with the object given as parameter as an integer. An exception will be thrown if the returned value is not an integer. The object passed as parameter must be an instance of the class to which this property belongs.
- Parameters:
obj – The object on which to retrieve the property value.
- Returns:
Value of the property on the given object.
-
double HxmProperty::getDouble(const HxmValue &obj) const¶
Returns the value of this property associated with the object given as parameter as a double. An exception will be thrown if the returned value is not a double. The object passed as parameter must be an instance of the class to which this property belongs.
- Parameters:
obj – The object on which to retrieve the property value.
- Returns:
Value of the property on the given object.
-
bool HxmProperty::getBool(const HxmValue &obj) const¶
Returns the value of this property associated with the object given as parameter as a boolean. An exception will be thrown if the returned value is not a boolean. The object passed as parameter must be an instance of the class to which this property belongs.
- Parameters:
obj – The object on which to retrieve the property value.
- Returns:
Value of the property on the given object.
-
HxExpression HxmProperty::getExpression(const HxmValue &obj) const¶
Returns the value of this property associated with the object given as parameter as an expression. An exception will be thrown if the returned value is not an expression. The object passed as parameter must be an instance of the class to which this property belongs.
- Parameters:
obj – The object on which to retrieve the property value.
- Returns:
Value of the property on the given object.
- See:
-
string HxmProperty::getString(const HxmValue &obj) const¶
Returns the value of this property associated with the object given as parameter as a string. An exception will be thrown if the returned value is not a string. The object passed as parameter must be an instance of the class to which this property belongs.
- Parameters:
obj – The object on which to retrieve the property value.
- Returns:
Value of the property on the given object.
-
HxmModule HxmProperty::getModule(const HxmValue &obj) const¶
Returns the value of this property associated with the object given as parameter as a module. An exception will be thrown if the returned value is not a module. The object passed as parameter must be an instance of the class to which this property belongs.
- Parameters:
obj – The object on which to retrieve the property value.
- Returns:
Value of the property on the given object.
- See:
-
HxmMap HxmProperty::getMap(const HxmValue &obj) const¶
Returns the value of this property associated with the object given as parameter as a map. An exception will be thrown if the returned value is not a map. The object passed as parameter must be an instance of the class to which this property belongs.
- Parameters:
obj – The object on which to retrieve the property value.
- Returns:
Value of the property on the given object.
- See:
-
HxmFunction HxmProperty::getFunction(const HxmValue &obj) const¶
Returns the value of this property associated with the object given as parameter as a function. An exception will be thrown if the returned value is not a function. The object passed as parameter must be an instance of the class to which this property belongs.
- Parameters:
obj – The object on which to retrieve the property value.
- Returns:
Value of the property on the given object.
- See:
-
HxmClass HxmProperty::getClass(const HxmValue &obj) const¶
Returns the value of this property associated with the object given as parameter as a class. An exception will be thrown if the returned value is not a class. The object passed as parameter must be an instance of the class to which this property belongs.
- Parameters:
obj – The object on which to retrieve the property value.
- Returns:
Value of the property on the given object.
- See:
-
void HxmProperty::setValue(HxmValue &obj, const HxmValue &value)¶
Sets the value of this property for the object given as parameter. The object passed as parameter must be an instance of the class to which this property belongs.
- Parameters:
obj – Object on which to change the property value.
value – New value of the property.
-
void HxmProperty::setInt(HxmValue &obj, long value)¶
Sets the value of this property for the object given as parameter. The object passed as parameter must be an instance of the class to which this property belongs.
- Parameters:
obj – Object on which to change the property value.
value – New value of the property.
-
void HxmProperty::setDouble(HxmValue &obj, double value)¶
Sets the value of this property for the object given as parameter. The object passed as parameter must be an instance of the class to which this property belongs.
- Parameters:
obj – Object on which to change the property value.
value – New value of the property.
-
void HxmProperty::setBool(HxmValue &obj, bool value)¶
Sets the value of this property for the object given as parameter. The object passed as parameter must be an instance of the class to which this property belongs.
- Parameters:
obj – Object on which to change the property value.
value – New value of the property.
-
void HxmProperty::setExpression(HxmValue &obj, const HxExpression &expression)¶
Sets the value of this property for the object given as parameter. The object passed as parameter must be an instance of the class to which this property belongs.
- Parameters:
obj – Object on which to change the property value.
expression – New value of the property.
- See:
-
void HxmProperty::setString(HxmValue &obj, const std::string &value)¶
Sets the value of this property for the object given as parameter. The object passed as parameter must be an instance of the class to which this property belongs.
- Parameters:
obj – Object on which to change the property value.
value – New value of the property.
-
void HxmProperty::setModule(HxmValue &obj, const HxmModule &module)¶
Sets the value of this property for the object given as parameter. The object passed as parameter must be an instance of the class to which this property belongs.
- Parameters:
obj – Object on which to change the property value.
module – New value of the property.
- See:
-
void HxmProperty::setMap(HxmValue &obj, const HxmMap &map)¶
Sets the value of this property for the object given as parameter. The object passed as parameter must be an instance of the class to which this property belongs.
- Parameters:
obj – Object on which to change the property value.
map – New value of the property.
- See:
-
void HxmProperty::setFunction(HxmValue &obj, const HxmFunction &function)¶
Sets the value of this property for the object given as parameter. The object passed as parameter must be an instance of the class to which this property belongs.
- Parameters:
obj – Object on which to change the property value.
function – New value of the property.
- See:
-
void HxmProperty::setClass(HxmValue &obj, const HxmClass &clazz)¶
Sets the value of this property for the object given as parameter. The object passed as parameter must be an instance of the class to which this property belongs.
- Parameters:
obj – Object on which to change the property value.
clazz – New value of the property.
- See:
-
bool HxmProperty::isReadOnly() const¶
Returns true if the property is read-only.