#include <Property.hpp>
Public Types | |
enum | DataType { EMPTY = 0, INT = 1, STRING = 2, DOUBLE = 3, UNKNOWN = 4 } |
Public Methods | |
Property () | |
Property (const char *name) | |
~Property () | |
void | setName (const char *name) |
void | copyValue (const Property *property) |
const char * | getName () const |
get this property's name | |
const void * | getValue () const |
get the value of this property. do not free memory. | |
DataType | getType () const |
enumerated datatype for this property | |
int | getSize () const |
int | getLength () const |
template<typename T> void | setObjectValue (const T &value) |
template<typename T> void | setFundamentalValue (T value, DataType t) |
set a primary type that does not have a destructor | |
template<typename T> void | setArrayValue (T *value, DataType t, int length) |
set value for array of type t with length (length is number of objects) | |
template<typename T> void | setValue (T value) |
void | setValue (const char *value) |
set string value to object | |
void | setValue (char *value) |
set string value to object | |
void | setValue (int value) |
set int value to object | |
void | setValue (double value) |
set double value to object | |
template<class T> void | destruct (void *value) |
Protected Methods | |
void * | allocate (int size) |
allocate memory for the buffer, deleting old memory if necessary | |
void | setDestructor (void(Property::*destructor)(void *object)) |
void | setType (DataType type) |
Protected Attributes | |
void(Property::* | destructor )(void *object) |
DataType | type |
int | bufferSize |
int | dataSize |
char * | buffer |
int | nameSize |
char * | name |
bool | nullName |
|
|
|
|
|
|
|
|
|
allocate memory for the buffer, deleting old memory if necessary
|
|
|
|
|
|
|
|
get this property's name
|
|
|
|
enumerated datatype for this property
|
|
get the value of this property. do not free memory.
|
|
set value for array of type t with length (length is number of objects)
|
|
|
|
set a primary type that does not have a destructor
|
|
|
|
set the value for this Property to be given object. proper destructor will get called. ** Don't use this for primary data types. For that, use setFundamentalValue |
|
|
|
set double value to object
|
|
set int value to object
|
|
set string value to object
|
|
set string value to object
|
|
set the value for this Property to be given object. proper destructor will get called. can use this for any object without needing to modify this class to add type but type will be returned as UNKNOWN. Don't use this for primary data types. For that, add new setValue or use setFundamentalValue |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|