ML Reference
|
Field to encapsulate any of the registered ML types. More...
#include <mlFields.h>
Public Member Functions | |
UniversalTypeField (const std::string &name="", MLDataType dt=-1) | |
Constructor, creates a field with a name to manage a string value which is interpreted as current data type. | |
~UniversalTypeField () | |
Destructor, frees buffer for type data. | |
virtual MLint | isValidValue () |
Returns true (=1) if field value is valid, otherwise false (=0). | |
virtual void | setStringValue (const std::string &stringValue) |
Sets the value of the field to stringValue . | |
virtual std::string | getStringValue () const |
Returns the value of the field as a string value. | |
virtual void | setDataType (MLDataType dataType) |
Sets the data type to dataType . | |
virtual MLDataType | getDataType () const |
Returns the current data type of this field. Default is invalid, i.e., -1. | |
virtual void | setUniversalTypeValue (const MLTypeData *dataType) |
Sets the value of the field to dataType . The passed data is copied. | |
virtual MLTypeData * | getUniversalTypeValue () const |
Returns the current value of the field as a memory copy which can be changed by the caller. | |
virtual const MLTypeData * | getShortLivedUniversalTypeValue () const |
Returns the temporary internal buffer value of the field which is short-lived and which must NOT be modified and NOT be freed by the caller. | |
virtual MLldouble | getValueCastToLDouble () const |
Returns the current value of the field cast to MLldouble. | |
Protected Member Functions | |
virtual void | _updateIsValidAndTypeDataFromOrigString () |
Parse _origString dependent on the current data type and update _isValid and _typeData. | |
virtual void | _updateIsValidAndStrValueFromTypeData () |
Parse _typeData dependent on the current data type and update _isValid and _strValue. |
Field to encapsulate any of the registered ML types.
Definition at line 2548 of file mlFields.h.
ml::UniversalTypeField::UniversalTypeField | ( | const std::string & | name = "" , |
MLDataType | dt = -1 |
||
) |
Constructor, creates a field with a name
to manage a string value which is interpreted as current data type.
Default is an invalid value.
ml::UniversalTypeField::~UniversalTypeField | ( | ) |
Destructor, frees buffer for type data.
virtual void ml::UniversalTypeField::_updateIsValidAndStrValueFromTypeData | ( | ) | [protected, virtual] |
Parse _typeData dependent on the current data type and update _isValid and _strValue.
virtual void ml::UniversalTypeField::_updateIsValidAndTypeDataFromOrigString | ( | ) | [protected, virtual] |
Parse _origString dependent on the current data type and update _isValid and _typeData.
virtual MLDataType ml::UniversalTypeField::getDataType | ( | ) | const [virtual] |
Returns the current data type of this field. Default is invalid, i.e., -1.
virtual const MLTypeData* ml::UniversalTypeField::getShortLivedUniversalTypeValue | ( | ) | const [virtual] |
Returns the temporary internal buffer value of the field which is short-lived and which must NOT be modified and NOT be freed by the caller.
virtual std::string ml::UniversalTypeField::getStringValue | ( | ) | const [virtual] |
Returns the value of the field as a string value.
setStringValue must be able to reinterpret this returned string correctly.
Implements ml::Field.
virtual MLTypeData* ml::UniversalTypeField::getUniversalTypeValue | ( | ) | const [virtual] |
Returns the current value of the field as a memory copy which can be changed by the caller.
The copy has to be freed by the application with MLFree() when not used any more. If field is invalid a pointer to a 0 byte sized memory block is returned which also must be freed.
virtual MLldouble ml::UniversalTypeField::getValueCastToLDouble | ( | ) | const [virtual] |
Returns the current value of the field cast to MLldouble.
virtual MLint ml::UniversalTypeField::isValidValue | ( | ) | [virtual] |
Returns true (=1) if field value is valid, otherwise false (=0).
Reimplemented from ml::Field.
virtual void ml::UniversalTypeField::setDataType | ( | MLDataType | dataType | ) | [virtual] |
Sets the data type to dataType
.
The current value is cast to dataType
is possible, otherwise the value becomes invalid.
virtual void ml::UniversalTypeField::setStringValue | ( | const std::string & | stringValue | ) | [virtual] |
Sets the value of the field to stringValue
.
Implements ml::Field.
virtual void ml::UniversalTypeField::setUniversalTypeValue | ( | const MLTypeData * | dataType | ) | [virtual] |
Sets the value of the field to dataType
. The passed data is copied.