iso::serialize::SerializeData Class Reference

serialization class More...

#include <iso_serialize_data.h>

List of all members.

Public Member Functions

 SerializeData ()
 default constructor
 SerializeData (const SerializeData &pSerial)
 copy constructor
 ~SerializeData ()
 destructor
const SerializeDataoperator= (const SerializeData &pSerial)
 assignment operator
bool empty () const
 check whether config is empty
unsigned int serializeCount () const
 return number of Serialize Objects
const QHash< base::String,
base::String > & 
values () const
 returns value hashtable
const QHash< base::String,
SerializeData * > & 
serials () const
 returns SerializeData hashtable
bool contains (const base::String &pName) const
 check if SerializeData contains value/serial name
bool containsValue (const base::String &pName) const
 check if SerializeData contains value name
bool containsSerial (const base::String &pName) const
 check if SerializeData contains serial name
bool boolValue (const base::String &pValueName) const throw (SerializeException)
 return bool value
int intValue (const base::String &pValueName) const throw (SerializeException)
 return int value
unsigned int uintValue (const base::String &pValueName) const throw (SerializeException)
 return unsigned int value
long longValue (const base::String &pValueName) const throw (SerializeException)
 return long value
float floatValue (const base::String &pValueName) const throw (SerializeException)
 return float value
double doubleValue (const base::String &pValueName) const throw (SerializeException)
 return double value
real realValue (const base::String &pValueName) const throw (SerializeException)
 return real value
base::String stringValue (const base::String &pValueName) const throw (SerializeException)
 return string value
bool * boolValues (const base::String &pValueName, unsigned int &pValueCount) const throw (SerializeException)
 return array of bool values
int * intValues (const base::String &pValueName, unsigned int &pValueCount) const throw (SerializeException)
 return array of int values
unsigned int * uintValues (const base::String &pValueName, unsigned int &pValueCount) const throw (SerializeException)
 return array of unsigned int values
float * floatValues (const base::String &pValueName, unsigned int &pValueCount) const throw (SerializeException)
 return array of float values
double * doubleValues (const base::String &pValueName, unsigned int &pValueCount) const throw (SerializeException)
 return array of double values
realrealValues (const base::String &pValueName, unsigned int &pValueCount) const throw (SerializeException)
 return array of real values
base::String * stringValues (const base::String &pValueName, unsigned int &pValueCount) const throw (SerializeException)
 return array of strings
const SerializeDataserial (const base::String &pSerialName) const throw (SerializeException)
 return SerializeData object
const SerializeDataserial (const base::String &pSerialName, const base::String &pName) const throw (SerializeException)
 return serializeData object from a list of serializeData objects
QList< SerializeData * > serials (const base::String &pSerialName) const throw (SerializeException)
 return list of SerializeData objects
void add (const base::String &pValueName, bool pValue) throw (SerializeException)
 add bool value
void add (const base::String &pValueName, int pValue) throw (SerializeException)
 add int value
void add (const base::String &pValueName, unsigned int pValue) throw (SerializeException)
 add unsigned int value
void add (const base::String &pValueName, long pValue) throw (SerializeException)
 add long value
void add (const base::String &pValueName, float pValue) throw (SerializeException)
 add float value
void add (const base::String &pValueName, double pValue) throw (SerializeException)
 add double value
void add (const base::String &pValueName, const base::String &pValue) throw (SerializeException)
 add string value
void add (const base::String &pValueName, const char *pValue) throw (SerializeException)
 add string value
void add (const base::String &pValueName, unsigned int pValueCount, const bool pValues[]) throw (SerializeException)
 add bool values
void add (const base::String &pValueName, unsigned int pValueCount, const int pValues[]) throw (SerializeException)
 add int values
void add (const base::String &pValueName, unsigned int pValueCount, const unsigned int pValues[]) throw (SerializeException)
 add unsigned int values
void add (const base::String &pValueName, unsigned int pValueCount, const long pValues[]) throw (SerializeException)
 add long values
void add (const base::String &pValueName, unsigned int pValueCount, const float pValues[]) throw (SerializeException)
 add float values
void add (const base::String &pValueName, unsigned int pValueCount, const double pValues[]) throw (SerializeException)
 add double values
void add (const base::String &pValueName, unsigned int pValueCount, const base::String pValues[]) throw (SerializeException)
 add long values
void add (const base::String &pSerialName, const SerializeData &pSerial)
 add config
void replace (const base::String &pValueName, bool pValue) throw (SerializeException)
 replace bool value
void replace (const base::String &pValueName, int pValue) throw (SerializeException)
 replace int value
void replace (const base::String &pValueName, unsigned int pValue) throw (SerializeException)
 replace unsigend int value
void replace (const base::String &pValueName, long pValue) throw (SerializeException)
 replace long value
void replace (const base::String &pValueName, float pValue) throw (SerializeException)
 replace float value
void replace (const base::String &pValueName, double pValue) throw (SerializeException)
 replace double value
void replace (const base::String &pValueName, const base::String &pValue) throw (SerializeException)
 replace string value
void replace (const base::String &pValueName, unsigned int pValueCount, bool pValues[]) throw (SerializeException)
 replace bool values
void replace (const base::String &pValueName, unsigned int pValueCount, int pValues[]) throw (SerializeException)
 replace int values
void replace (const base::String &pValueName, unsigned int pValueCount, unsigned int pValues[]) throw (SerializeException)
 replace unsigned int values
void replace (const base::String &pValueName, unsigned int pValueCount, long pValues[]) throw (SerializeException)
 replace long values
void replace (const base::String &pValueName, unsigned int pValueCount, float pValues[]) throw (SerializeException)
 replace float values
void replace (const base::String &pValueName, unsigned int pValueCount, double pValues[]) throw (SerializeException)
 replace double values
void replace (const base::String &pSerialName, const SerializeData &pSerial) throw (SerializeException)
 replace SerializeData
void remove (const base::String &pValueName) throw (SerializeException)
 remove value
void add (const SerializeData &pSerial)
 add SerializeData

Protected Member Functions

void clear ()
 remove all values and configs
base::String value (const base::String &pValueName) const throw (SerializeException)
 return value as string

Protected Attributes

QHash< base::String, SerializeData * > mSerials
 hashtable of string / SerializeData pairs
QHash< base::String, base::String > mValues
 hashtable of string / value pairs

Friends

std::ostream & operator<< (std::ostream &pOstream, const SerializeData &pSerial)
 print array information


Detailed Description

serialization class

The SerializeData class is a helper class for object serialization. It stores all values as strings. It contains two hash tables, one for string / value pairs and one for string / SerializeData pairs. String / value pairs are used to store basic data types such as ints or arrays of ints. String / SerializeData pairs store member variables, which are instances of objects. Contrary to values, SerializeData objects can be stored with the same SerializeData name. Whenever there are several SerializeData objects stored under the same key, they can all be retrieved as list of SerializeData objects. Individual SerializeData objects within such a list can be retrieved by supplying both the key name and the SerializeData object name to the appropriate get method. Every class in iso, which can be serialized knows how to create a SerializeData object for itself. It also knows how to construct itself from a SerializeData object. SerializeData objects can't store addresses. So serializable objects which need to know the address of other objects need to chose an indirect approach when constructed via SerializeData objects. The somewhat ugly solution is to store objects addresses and names temporarilly in the SerializeManager class and then look the addresses up baed on the object names which are stored in the SerializeData object.

Created by Daniel Bisig on 8/20/06. Copyright 2006 Daniel Bisig All rights reserved.


Constructor & Destructor Documentation

SerializeData::SerializeData (  ) 

default constructor

SerializeData::SerializeData ( const SerializeData pSerial  ) 

copy constructor

Parameters:
pSerial SerializeData object to copy properties from

SerializeData::~SerializeData (  ) 

destructor


Member Function Documentation

const SerializeData & SerializeData::operator= ( const SerializeData pSerial  ) 

assignment operator

Parameters:
pSerial SerializeData object to copy properties from

bool SerializeData::empty (  )  const

check whether config is empty

Returns:
true: config is empty, false otherwise
empty means: both the values and config hashtables contain no elements

unsigned int iso::serialize::SerializeData::serializeCount (  )  const

return number of Serialize Objects

Returns:
number of configs

const QHash< base::String, base::String > & SerializeData::values (  )  const

returns value hashtable

Returns:
values hashtable

const QHash< base::String, SerializeData * > & SerializeData::serials (  )  const

returns SerializeData hashtable

Returns:
SerializeData hashtable

bool SerializeData::contains ( const base::String &  pName  )  const

check if SerializeData contains value/serial name

Returns:
true if SerializeData contains value/serial name, false otherwise

bool SerializeData::containsValue ( const base::String &  pName  )  const

check if SerializeData contains value name

Returns:
true if SerializeData contains value name, false otherwise

bool SerializeData::containsSerial ( const base::String &  pName  )  const

check if SerializeData contains serial name

Returns:
true if SerializeData contains serial name, false otherwise

bool SerializeData::boolValue ( const base::String &  pValueName  )  const throw (SerializeException)

return bool value

Parameters:
pValueName name of value
Returns:
bool
Exceptions:
Exception value name not found

int SerializeData::intValue ( const base::String &  pValueName  )  const throw (SerializeException)

return int value

Parameters:
pValueName name of value
Returns:
int
Exceptions:
Exception value name not found

unsigned int SerializeData::uintValue ( const base::String &  pValueName  )  const throw (SerializeException)

return unsigned int value

Parameters:
pValueName name of value
Returns:
unsigned int
Exceptions:
Exception value name not found

long SerializeData::longValue ( const base::String &  pValueName  )  const throw (SerializeException)

return long value

Parameters:
pValueName name of value
Returns:
long
Exceptions:
Exception value name not found

float SerializeData::floatValue ( const base::String &  pValueName  )  const throw (SerializeException)

return float value

Parameters:
pValueName name of value
Returns:
float
Exceptions:
Exception value name not found

double SerializeData::doubleValue ( const base::String &  pValueName  )  const throw (SerializeException)

return double value

Parameters:
pValueName name of value
Returns:
double
Exceptions:
Exception value name not found

real SerializeData::realValue ( const base::String &  pValueName  )  const throw (SerializeException)

return real value

Parameters:
pValueName name of value
Returns:
double
Exceptions:
Exception value name not found

base::String SerializeData::stringValue ( const base::String &  pValueName  )  const throw (SerializeException)

return string value

Parameters:
pValueName name of value
Returns:
string
Exceptions:
Exception value name not found

bool * SerializeData::boolValues ( const base::String &  pValueName,
unsigned int &  pValueCount 
) const throw (SerializeException)

return array of bool values

Parameters:
pValueName name of values
pValueCount will hold the size of the array
Returns:
array of bools
Exceptions:
Exception value name not found

int * SerializeData::intValues ( const base::String &  pValueName,
unsigned int &  pValueCount 
) const throw (SerializeException)

return array of int values

Parameters:
pValueName name of values
pValueCount will hold the size of the array
Returns:
array of ints
Exceptions:
Exception value name not found

unsigned int * SerializeData::uintValues ( const base::String &  pValueName,
unsigned int &  pValueCount 
) const throw (SerializeException)

return array of unsigned int values

Parameters:
pValueName name of values
pValueCount will hold the size of the array
Returns:
array of unsigned ints
Exceptions:
Exception value name not found

float * SerializeData::floatValues ( const base::String &  pValueName,
unsigned int &  pValueCount 
) const throw (SerializeException)

return array of float values

Parameters:
pValueName name of values
pValueCount will hold the size of the array
Returns:
array of floats
Exceptions:
Exception value name not found

double * SerializeData::doubleValues ( const base::String &  pValueName,
unsigned int &  pValueCount 
) const throw (SerializeException)

return array of double values

Parameters:
pValueName name of values
pValueCount will hold the size of the array
Returns:
array of doubles
Exceptions:
Exception value name not found

real * SerializeData::realValues ( const base::String &  pValueName,
unsigned int &  pValueCount 
) const throw (SerializeException)

return array of real values

Parameters:
pValueName name of values
pValueCount will hold the size of the array
Returns:
array of reals
Exceptions:
Exception value name not found

base::String * SerializeData::stringValues ( const base::String &  pValueName,
unsigned int &  pValueCount 
) const throw (SerializeException)

return array of strings

Parameters:
pValueName name of values
pValueCount will hold the size of the array
Returns:
array of Strings
Exceptions:
Exception value name not found

const SerializeData & SerializeData::serial ( const base::String &  pSerialName  )  const throw (SerializeException)

return SerializeData object

Parameters:
pSerialName name of SerializeData object
Returns:
SerializeData object
Exceptions:
Exception SerliazeData name not found

const SerializeData & SerializeData::serial ( const base::String &  pSerialName,
const base::String &  pName 
) const throw (SerializeException)

return serializeData object from a list of serializeData objects

Parameters:
pSerialName name of SerializeData object
pName name of serializeData objects within list
Returns:
serializeData object
Exceptions:
Exception pSerialName or pName not found
pSerialName is the key value under which the SerializeData objects are stored in the hashtable pName is the internal SerializeData name, which serves to select a SerializeData object from within the list not all SerializeData objects possess a name value, therefore the applicability of this method is somewhat restricted

QList< SerializeData * > SerializeData::serials ( const base::String &  pSerialName  )  const throw (SerializeException)

return list of SerializeData objects

Parameters:
pSerialName name of SerializeData objects
Returns:
list of SerializeData objects
Exceptions:
Exception SerliazeData name not found

void SerializeData::add ( const base::String &  pValueName,
bool  pValue 
) throw (SerializeException)

add bool value

Parameters:
pValueName value name
pValue value
Exceptions:
Exception duplicate pValueName

void SerializeData::add ( const base::String &  pValueName,
int  pValue 
) throw (SerializeException)

add int value

Parameters:
pValueName value name
pValue value
Exceptions:
Exception duplicate pValueName

void SerializeData::add ( const base::String &  pValueName,
unsigned int  pValue 
) throw (SerializeException)

add unsigned int value

Parameters:
pValueName value name
pValue value
Exceptions:
Exception duplicate pValueName

void SerializeData::add ( const base::String &  pValueName,
long  pValue 
) throw (SerializeException)

add long value

Parameters:
pValueName value name
pValue value
Exceptions:
Exception duplicate pValueName

void SerializeData::add ( const base::String &  pValueName,
float  pValue 
) throw (SerializeException)

add float value

Parameters:
pValueName value name
pValue value
Exceptions:
Exception duplicate pValueName

void SerializeData::add ( const base::String &  pValueName,
double  pValue 
) throw (SerializeException)

add double value

Parameters:
pValueName value name
pValue value
Exceptions:
Exception duplicate pValueName

void SerializeData::add ( const base::String &  pValueName,
const base::String &  pValue 
) throw (SerializeException)

add string value

Parameters:
pValueName value name
pValue value
Exceptions:
Exception duplicate pValueName

void SerializeData::add ( const base::String &  pValueName,
const char *  pValue 
) throw (SerializeException)

add string value

Parameters:
pValueName value name
pValue value
Exceptions:
Exception duplicate pValueName

void SerializeData::add ( const base::String &  pValueName,
unsigned int  pValueCount,
const bool  pValues[] 
) throw (SerializeException)

add bool values

Parameters:
pValueName value name
pValueCount number of values
pValues array of values
Exceptions:
Exception duplicate pValueName

void SerializeData::add ( const base::String &  pValueName,
unsigned int  pValueCount,
const int  pValues[] 
) throw (SerializeException)

add int values

Parameters:
pValueName value name
pValueCount number of values
pValues array of values
Exceptions:
Exception duplicate pValueName

void SerializeData::add ( const base::String &  pValueName,
unsigned int  pValueCount,
const unsigned int  pValues[] 
) throw (SerializeException)

add unsigned int values

Parameters:
pValueName value name
pValueCount number of values
pValues array of values
Exceptions:
Exception duplicate pValueName

void SerializeData::add ( const base::String &  pValueName,
unsigned int  pValueCount,
const long  pValues[] 
) throw (SerializeException)

add long values

Parameters:
pValueName value name
pValueCount number of values
pValues array of values
Exceptions:
Exception duplicate pValueName

void SerializeData::add ( const base::String &  pValueName,
unsigned int  pValueCount,
const float  pValues[] 
) throw (SerializeException)

add float values

Parameters:
pValueName value name
pValueCount number of values
pValues array of values
Exceptions:
Exception duplicate pValueName

void SerializeData::add ( const base::String &  pValueName,
unsigned int  pValueCount,
const double  pValues[] 
) throw (SerializeException)

add double values

Parameters:
pValueName value name
pValueCount number of values
pValues array of values
Exceptions:
Exception duplicate pValueName

void SerializeData::add ( const base::String &  pValueName,
unsigned int  pValueCount,
const base::String  pValues[] 
) throw (SerializeException)

add long values

Parameters:
pValueName value name
pValueCount number of values
pValues array of Strings
Exceptions:
Exception duplicate pValueName

void SerializeData::add ( const base::String &  pSerialName,
const SerializeData pSerial 
)

add config

Parameters:
pSerialName SerializeData name
pSerial SerializeData

void SerializeData::replace ( const base::String &  pValueName,
bool  pValue 
) throw (SerializeException)

replace bool value

Parameters:
pValueName value name
pValue new value
Exceptions:
Exception pValueName not found

void SerializeData::replace ( const base::String &  pValueName,
int  pValue 
) throw (SerializeException)

replace int value

Parameters:
pValueName value name
pValue new value
Exceptions:
Exception pValueName not found

void SerializeData::replace ( const base::String &  pValueName,
unsigned int  pValue 
) throw (SerializeException)

replace unsigend int value

Parameters:
pValueName value name
pValue new value
Exceptions:
Exception pValueName not found

void SerializeData::replace ( const base::String &  pValueName,
long  pValue 
) throw (SerializeException)

replace long value

Parameters:
pValueName value name
pValue new value
Exceptions:
Exception pValueName not found

void SerializeData::replace ( const base::String &  pValueName,
float  pValue 
) throw (SerializeException)

replace float value

Parameters:
pValueName value name
pValue new value
Exceptions:
Exception pValueName not found

void SerializeData::replace ( const base::String &  pValueName,
double  pValue 
) throw (SerializeException)

replace double value

Parameters:
pValueName value name
pValue new value
Exceptions:
Exception pValueName not found

void SerializeData::replace ( const base::String &  pValueName,
const base::String &  pValue 
) throw (SerializeException)

replace string value

Parameters:
pValueName value name
pValue new value
Exceptions:
Exception pValueName not found

void SerializeData::replace ( const base::String &  pValueName,
unsigned int  pValueCount,
bool  pValues[] 
) throw (SerializeException)

replace bool values

Parameters:
pValueName value name
pValueCount number of values
pValues new values
Exceptions:
Exception pValueName not found

void SerializeData::replace ( const base::String &  pValueName,
unsigned int  pValueCount,
int  pValues[] 
) throw (SerializeException)

replace int values

Parameters:
pValueName value name
pValueCount number of values
pValues new values
Exceptions:
Exception pValueName not found

void SerializeData::replace ( const base::String &  pValueName,
unsigned int  pValueCount,
unsigned int  pValues[] 
) throw (SerializeException)

replace unsigned int values

Parameters:
pValueName value name
pValueCount number of values
pValues new values
Exceptions:
Exception pValueName not found

void SerializeData::replace ( const base::String &  pValueName,
unsigned int  pValueCount,
long  pValues[] 
) throw (SerializeException)

replace long values

Parameters:
pValueName value name
pValueCount number of values
pValues new values
Exceptions:
Exception pValueName not found

void SerializeData::replace ( const base::String &  pValueName,
unsigned int  pValueCount,
float  pValues[] 
) throw (SerializeException)

replace float values

Parameters:
pValueName value name
pValueCount number of values
pValues new values
Exceptions:
Exception pValueName not found

void SerializeData::replace ( const base::String &  pValueName,
unsigned int  pValueCount,
double  pValues[] 
) throw (SerializeException)

replace double values

Parameters:
pValueName value name
pValueCount number of values
pValues new values
Exceptions:
Exception pValueName not found

void SerializeData::replace ( const base::String &  pSerialName,
const SerializeData pSerial 
) throw (SerializeException)

replace SerializeData

Parameters:
pSerialName SerializeData name
pSerial SerializeData
Exceptions:
Exception pSerialName not found

void SerializeData::remove ( const base::String &  pValueName  )  throw (SerializeException)

remove value

Parameters:
pValueName value name
Exceptions:
Exception value name not found

void SerializeData::add ( const SerializeData pSerial  ) 

add SerializeData

Parameters:
pSerial SerializeData
extend SerializeData objects with all values / serials in pSerial

void SerializeData::clear (  )  [protected]

remove all values and configs

base::String SerializeData::value ( const base::String &  pValueName  )  const throw (SerializeException) [protected]

return value as string

Parameters:
pValueName name of value
Returns:
string
Exceptions:
Exception value name not found


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  pOstream,
const SerializeData pSerial 
) [friend]

print array information


Member Data Documentation

QHash<base::String, SerializeData*> iso::serialize::SerializeData::mSerials [protected]

hashtable of string / SerializeData pairs

QHash<base::String, base::String> iso::serialize::SerializeData::mValues [protected]

hashtable of string / value pairs


The documentation for this class was generated from the following files:
Generated on Fri Feb 25 14:07:19 2011 for iso_serialize by  doxygen 1.5.1