ML Reference
ml::PointerField Class Reference

Field to encapsulate a void pointer to arbitrary data. More...

#include <mlFields.h>

Inheritance diagram for ml::PointerField:
ml::Field

List of all members.

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.

Detailed Description

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.


Constructor & Destructor Documentation

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.


Member Function Documentation

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.


The documentation for this class was generated from the following file: