Main Page | Namespace List | Class Hierarchy | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

lemur::parse::Property Class Reference

#include <Property.hpp>

List of all members.

Public Types

enum  DataType {
  EMPTY = 0, INT = 1, STRING = 2, DOUBLE = 3,
  UNKNOWN = 4, STDSTRING = 5
}

Public Member Functions

 Property ()
 Property (const string initName)
 ~Property ()
void setName (const string newName)
void copyValue (const Property *property)
const string 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 (const string 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 Member Functions

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
string name
bool nullName


Detailed Description

A Property class is used to pass token information down a TextHandler chain during parsing and tokenization. The Property class is expected to "own" and provide memory management of the name and value stored in the Property. The setName and setValue functions should copy the name/value into its own storage. On destruction of the Property, the object should free any memory that it has created. Caller should not free memory returned by getValue


Member Enumeration Documentation

enum lemur::parse::Property::DataType
 

Enumeration values:
EMPTY 
INT 
STRING 
DOUBLE 
UNKNOWN 
STDSTRING 


Constructor & Destructor Documentation

lemur::parse::Property::Property  ) 
 

lemur::parse::Property::Property const string  initName  ) 
 

lemur::parse::Property::~Property  ) 
 


Member Function Documentation

void * lemur::parse::Property::allocate int  size  )  [protected]
 

allocate memory for the buffer, deleting old memory if necessary

void lemur::parse::Property::copyValue const Property property  ) 
 

template<class T>
void lemur::parse::Property::destruct void *  value  )  [inline]
 

int lemur::parse::Property::getLength  )  const
 

const string lemur::parse::Property::getName  )  const
 

get this property's name

int lemur::parse::Property::getSize  )  const
 

lemur::parse::Property::DataType lemur::parse::Property::getType  )  const
 

enumerated datatype for this property

const void * lemur::parse::Property::getValue  )  const
 

get the value of this property. do not free memory.

template<typename T>
void lemur::parse::Property::setArrayValue T *  value,
DataType  t,
int  length
[inline]
 

set value for array of type t with length (length is number of objects)

void lemur::parse::Property::setDestructor void(Property::*  destructor)(void *object)  )  [protected]
 

template<typename T>
void lemur::parse::Property::setFundamentalValue value,
DataType  t
[inline]
 

set a primary type that does not have a destructor

void lemur::parse::Property::setName const string  newName  ) 
 

template<typename T>
void lemur::parse::Property::setObjectValue const T &  value  )  [inline]
 

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

void lemur::parse::Property::setType DataType  type  )  [protected]
 

void lemur::parse::Property::setValue double  value  )  [inline]
 

set double value to object

void lemur::parse::Property::setValue int  value  )  [inline]
 

set int value to object

void lemur::parse::Property::setValue char *  value  )  [inline]
 

set string value to object

void lemur::parse::Property::setValue const string  value  )  [inline]
 

set string value to object

void lemur::parse::Property::setValue const char *  value  )  [inline]
 

set string value to object

template<typename T>
void lemur::parse::Property::setValue value  )  [inline]
 

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


Member Data Documentation

char* lemur::parse::Property::buffer [protected]
 

int lemur::parse::Property::bufferSize [protected]
 

int lemur::parse::Property::dataSize [protected]
 

void(Property::* lemur::parse::Property::destructor)( void* object ) [protected]
 

string lemur::parse::Property::name [protected]
 

bool lemur::parse::Property::nullName [protected]
 

DataType lemur::parse::Property::type [protected]
 


The documentation for this class was generated from the following files:
Generated on Tue Jun 15 11:03:06 2010 for Lemur by doxygen 1.3.4