Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members   Related Pages  

Property Class Reference

#include <Property.hpp>

List of all members.

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


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 Property::DataType
 

Enumeration values:
EMPTY 
INT 
STRING 
DOUBLE 
UNKNOWN 


Constructor & Destructor Documentation

Property::Property  
 

Property::Property const char *    name
 

Property::~Property  
 


Member Function Documentation

void * Property::allocate int    size [protected]
 

allocate memory for the buffer, deleting old memory if necessary

void Property::copyValue const Property *    property
 

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

int Property::getLength  
 

const char * Property::getName  
 

get this property's name

int Property::getSize  
 

Property::DataType Property::getType  
 

enumerated datatype for this property

const void * Property::getValue  
 

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

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

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

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

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

set a primary type that does not have a destructor

void Property::setName const char *    name
 

template<typename T>
void 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 Property::setType DataType    type [protected]
 

void Property::setValue double    value [inline]
 

set double value to object

void Property::setValue int    value [inline]
 

set int value to object

void Property::setValue char *    value [inline]
 

set string value to object

void Property::setValue const char *    value [inline]
 

set string value to object

template<typename T>
void 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* Property::buffer [protected]
 

int Property::bufferSize [protected]
 

int Property::dataSize [protected]
 

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

char* Property::name [protected]
 

int Property::nameSize [protected]
 

bool Property::nullName [protected]
 

DataType Property::type [protected]
 


The documentation for this class was generated from the following files:
Generated on Wed Nov 3 12:59:51 2004 for Lemur Toolkit by doxygen1.2.18