ML Reference
|
Field to encapsulate a void pointer to arbitrary data. More...
#include <mlFields.h>
Public Member Functions | |
PointerField () | |
Default constructor, do not use it. | |
PointerField (const std::string &name) | |
Constructor, creates a field with a name to manage a void pointer. | |
void | setStringValue (const std::string &stringValue) |
Sets field value from string to stringValue . | |
void | setPointerValue (void *voidPointerValue) |
Sets value of the field to voidPointerValue . | |
std::string | getStringValue () const |
Returns the value of the field as string value. | |
void * | getPointerValue () const |
Returns the value of the field. |
Field to encapsulate a void pointer to arbitrary data.
It is useful to pass data via the C-API of the ML without any force to use c++ interfaces. It however requires responsible usage, especially since pointer values are typically not persistent when fields are (re)stored from strings.
Definition at line 1125 of file mlFields.h.
ml::PointerField::PointerField | ( | ) |
Default constructor, do not use it.
ml::PointerField::PointerField | ( | const std::string & | name | ) |
Constructor, creates a field with a name
to manage a void pointer.
The field value is initialized to NULL by default.
void* ml::PointerField::getPointerValue | ( | ) | const |
Returns the value of the field.
std::string ml::PointerField::getStringValue | ( | ) | const [virtual] |
Returns the value of the field as string value.
setStringValue must be able to reinterpret this returned string correctly.
Implements ml::Field.
void ml::PointerField::setPointerValue | ( | void * | voidPointerValue | ) |
Sets value of the field to voidPointerValue
.
void ml::PointerField::setStringValue | ( | const std::string & | stringValue | ) | [virtual] |
Sets field value from string to stringValue
.
On non-successful parsing, the pointer is set to NULL.
Implements ml::Field.