HxmField Class¶
-
class HxmField¶
An HxmField represents a field belonging to a modeler class. It can be used to get or set the value of a field on objects of the associated class.
Unlike properties, fields are always readable and writable. Furthermore, modifying or reading a field has no side-effects other than changing a value.
HxmFields are not modeler objects: they are merely descriptions that tell the modeler how to modify the fields of a class. They cannot be transformed into modeler values.
- Since:
13.0
Summary¶
Returns the value of this field associated with the object given as parameter. |
|
Returns the value of this field associated with the object given as parameter as an integer. |
|
Returns the value of this field associated with the object given as parameter as a double. |
|
Returns the value of this field associated with the object given as parameter as a boolean. |
|
Returns the value of this field associated with the object given as parameter as an expression. |
|
Returns the value of this field associated with the object given as parameter as a string. |
|
Returns the value of this field associated with the object given as parameter as a module. |
|
Returns the value of this field associated with the object given as parameter as a map. |
|
Returns the value of this field associated with the object given as parameter as a function. |
|
Returns the value of this field associated with the object given as parameter as a class. |
|
Sets the value of this field for the object given as parameter. |
|
Sets the value of this field for the object given as parameter. |
|
Sets the value of this field for the object given as parameter. |
|
Sets the value of this field for the object given as parameter. |
|
Sets the value of this field for the object given as parameter. |
|
Sets the value of this field for the object given as parameter. |
|
Sets the value of this field for the object given as parameter. |
|
Sets the value of this field for the object given as parameter. |
|
Sets the value of this field for the object given as parameter. |
|
Sets the value of this field for the object given as parameter. |
Functions¶
-
HxmValue HxmField::getValue(const HxmValue &obj) const¶
Returns the value of this field associated with the object given as parameter. The object passed as parameter must be an instance of the class to which this field belongs.
- Parameters:
obj – The object on which to retrieve the field value.
- Returns:
Value of the field on the given object.
- See:
-
long HxmField::getInt(const HxmValue &obj) const¶
Returns the value of this field 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 field belongs.
- Parameters:
obj – The object on which to retrieve the field value.
- Returns:
Value of the field on the given object.
-
double HxmField::getDouble(const HxmValue &obj) const¶
Returns the value of this field 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 field belongs.
- Parameters:
obj – The object on which to retrieve the field value.
- Returns:
Value of the field on the given object.
-
bool HxmField::getBool(const HxmValue &obj) const¶
Returns the value of this field 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 field belongs.
- Parameters:
obj – The object on which to retrieve the field value.
- Returns:
Value of the field on the given object.
-
HxExpression HxmField::getExpression(const HxmValue &obj) const¶
Returns the value of this field 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 field belongs.
- Parameters:
obj – The object on which to retrieve the field value.
- Returns:
Value of the field on the given object.
- See:
-
string HxmField::getString(const HxmValue &obj) const¶
Returns the value of this field 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 field belongs.
- Parameters:
obj – The object on which to retrieve the field value.
- Returns:
Value of the field on the given object.
-
HxmModule HxmField::getModule(const HxmValue &obj) const¶
Returns the value of this field 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 field belongs.
- Parameters:
obj – The object on which to retrieve the field value.
- Returns:
Value of the field on the given object.
- See:
-
HxmMap HxmField::getMap(const HxmValue &obj) const¶
Returns the value of this field 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 field belongs.
- Parameters:
obj – The object on which to retrieve the field value.
- Returns:
Value of the field on the given object.
- See:
-
HxmFunction HxmField::getFunction(const HxmValue &obj) const¶
Returns the value of this field 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 field belongs.
- Parameters:
obj – The object on which to retrieve the field value.
- Returns:
Value of the field on the given object.
- See:
-
HxmClass HxmField::getClass(const HxmValue &obj) const¶
Returns the value of this field 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 field belongs.
- Parameters:
obj – The object on which to retrieve the field value.
- Returns:
Value of the field on the given object.
- See:
-
void HxmField::setValue(HxmValue &obj, const HxmValue &value)¶
Sets the value of this field for the object given as parameter. The object passed as parameter must be an instance of the class to which this field belongs.
- Parameters:
obj – Object on which to change the field value.
value – New value of the field.
-
void HxmField::setInt(HxmValue &obj, long value)¶
Sets the value of this field for the object given as parameter. The object passed as parameter must be an instance of the class to which this field belongs.
- Parameters:
obj – Object on which to change the field value.
value – New value of the field.
-
void HxmField::setDouble(HxmValue &obj, double value)¶
Sets the value of this field for the object given as parameter. The object passed as parameter must be an instance of the class to which this field belongs.
- Parameters:
obj – Object on which to change the field value.
value – New value of the field.
-
void HxmField::setBool(HxmValue &obj, bool value)¶
Sets the value of this field for the object given as parameter. The object passed as parameter must be an instance of the class to which this field belongs.
- Parameters:
obj – Object on which to change the field value.
value – New value of the field.
-
void HxmField::setExpression(HxmValue &obj, const HxExpression &expression)¶
Sets the value of this field for the object given as parameter. The object passed as parameter must be an instance of the class to which this field belongs.
- Parameters:
obj – Object on which to change the field value.
expression – New value of the field.
- See:
-
void HxmField::setString(HxmValue &obj, const std::string &value)¶
Sets the value of this field for the object given as parameter. The object passed as parameter must be an instance of the class to which this field belongs.
- Parameters:
obj – Object on which to change the field value.
value – New value of the field.
-
void HxmField::setModule(HxmValue &obj, const HxmModule &module)¶
Sets the value of this field for the object given as parameter. The object passed as parameter must be an instance of the class to which this field belongs.
- Parameters:
obj – Object on which to change the field value.
module – New value of the field.
- See:
-
void HxmField::setMap(HxmValue &obj, const HxmMap &map)¶
Sets the value of this field for the object given as parameter. The object passed as parameter must be an instance of the class to which this field belongs.
- Parameters:
obj – Object on which to change the field value.
map – New value of the field.
- See:
-
void HxmField::setFunction(HxmValue &obj, const HxmFunction &function)¶
Sets the value of this field for the object given as parameter. The object passed as parameter must be an instance of the class to which this field belongs.
- Parameters:
obj – Object on which to change the field value.
function – New value of the field.
- See:
-
void HxmField::setClass(HxmValue &obj, const HxmClass &clazz)¶
Sets the value of this field for the object given as parameter. The object passed as parameter must be an instance of the class to which this field belongs.
- Parameters:
obj – Object on which to change the field value.
clazz – New value of the field.
- See: