#include <iso_serialize_data.h>
Public Member Functions | |
SerializeData () | |
default constructor | |
SerializeData (const SerializeData &pSerial) | |
copy constructor | |
~SerializeData () | |
destructor | |
const SerializeData & | operator= (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 | |
real * | realValues (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 SerializeData & | serial (const base::String &pSerialName) const throw (SerializeException) |
return SerializeData object | |
const SerializeData & | serial (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 |
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.
SerializeData::SerializeData | ( | ) |
default constructor
SerializeData::SerializeData | ( | const SerializeData & | pSerial | ) |
SerializeData::~SerializeData | ( | ) |
destructor
const SerializeData & SerializeData::operator= | ( | const SerializeData & | pSerial | ) |
bool SerializeData::empty | ( | ) | const |
check whether config is empty
unsigned int iso::serialize::SerializeData::serializeCount | ( | ) | const |
return number of Serialize Objects
const QHash< base::String, base::String > & SerializeData::values | ( | ) | const |
returns value hashtable
const QHash< base::String, SerializeData * > & SerializeData::serials | ( | ) | const |
bool SerializeData::contains | ( | const base::String & | pName | ) | const |
check if SerializeData contains value/serial name
bool SerializeData::containsValue | ( | const base::String & | pName | ) | const |
check if SerializeData contains value name
bool SerializeData::containsSerial | ( | const base::String & | pName | ) | const |
check if SerializeData contains serial name
bool SerializeData::boolValue | ( | const base::String & | pValueName | ) | const throw (SerializeException) |
return bool value
pValueName | name of value |
Exception | value name not found |
int SerializeData::intValue | ( | const base::String & | pValueName | ) | const throw (SerializeException) |
return int value
pValueName | name of value |
Exception | value name not found |
unsigned int SerializeData::uintValue | ( | const base::String & | pValueName | ) | const throw (SerializeException) |
return unsigned int value
pValueName | name of value |
Exception | value name not found |
long SerializeData::longValue | ( | const base::String & | pValueName | ) | const throw (SerializeException) |
return long value
pValueName | name of value |
Exception | value name not found |
float SerializeData::floatValue | ( | const base::String & | pValueName | ) | const throw (SerializeException) |
return float value
pValueName | name of value |
Exception | value name not found |
double SerializeData::doubleValue | ( | const base::String & | pValueName | ) | const throw (SerializeException) |
return double value
pValueName | name of value |
Exception | value name not found |
real SerializeData::realValue | ( | const base::String & | pValueName | ) | const throw (SerializeException) |
return real value
pValueName | name of value |
Exception | value name not found |
base::String SerializeData::stringValue | ( | const base::String & | pValueName | ) | const throw (SerializeException) |
return string value
pValueName | name of value |
Exception | value name not found |
bool * SerializeData::boolValues | ( | const base::String & | pValueName, | |
unsigned int & | pValueCount | |||
) | const throw (SerializeException) |
return array of bool values
pValueName | name of values | |
pValueCount | will hold the size of the array |
Exception | value name not found |
int * SerializeData::intValues | ( | const base::String & | pValueName, | |
unsigned int & | pValueCount | |||
) | const throw (SerializeException) |
return array of int values
pValueName | name of values | |
pValueCount | will hold the size of the array |
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
pValueName | name of values | |
pValueCount | will hold the size of the array |
Exception | value name not found |
float * SerializeData::floatValues | ( | const base::String & | pValueName, | |
unsigned int & | pValueCount | |||
) | const throw (SerializeException) |
return array of float values
pValueName | name of values | |
pValueCount | will hold the size of the array |
Exception | value name not found |
double * SerializeData::doubleValues | ( | const base::String & | pValueName, | |
unsigned int & | pValueCount | |||
) | const throw (SerializeException) |
return array of double values
pValueName | name of values | |
pValueCount | will hold the size of the array |
Exception | value name not found |
real * SerializeData::realValues | ( | const base::String & | pValueName, | |
unsigned int & | pValueCount | |||
) | const throw (SerializeException) |
return array of real values
pValueName | name of values | |
pValueCount | will hold the size of the array |
Exception | value name not found |
base::String * SerializeData::stringValues | ( | const base::String & | pValueName, | |
unsigned int & | pValueCount | |||
) | const throw (SerializeException) |
return array of strings
pValueName | name of values | |
pValueCount | will hold the size of the array |
Exception | value name not found |
const SerializeData & SerializeData::serial | ( | const base::String & | pSerialName | ) | const throw (SerializeException) |
return SerializeData object
pSerialName | name of SerializeData object |
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
pSerialName | name of SerializeData object | |
pName | name of serializeData objects within list |
Exception | pSerialName or pName not found |
QList< SerializeData * > SerializeData::serials | ( | const base::String & | pSerialName | ) | const throw (SerializeException) |
return list of SerializeData objects
pSerialName | name of SerializeData objects |
Exception | SerliazeData name not found |
void SerializeData::add | ( | const base::String & | pValueName, | |
bool | pValue | |||
) | throw (SerializeException) |
add bool value
pValueName | value name | |
pValue | value |
Exception | duplicate pValueName |
void SerializeData::add | ( | const base::String & | pValueName, | |
int | pValue | |||
) | throw (SerializeException) |
add int value
pValueName | value name | |
pValue | value |
Exception | duplicate pValueName |
void SerializeData::add | ( | const base::String & | pValueName, | |
unsigned int | pValue | |||
) | throw (SerializeException) |
add unsigned int value
pValueName | value name | |
pValue | value |
Exception | duplicate pValueName |
void SerializeData::add | ( | const base::String & | pValueName, | |
long | pValue | |||
) | throw (SerializeException) |
add long value
pValueName | value name | |
pValue | value |
Exception | duplicate pValueName |
void SerializeData::add | ( | const base::String & | pValueName, | |
float | pValue | |||
) | throw (SerializeException) |
add float value
pValueName | value name | |
pValue | value |
Exception | duplicate pValueName |
void SerializeData::add | ( | const base::String & | pValueName, | |
double | pValue | |||
) | throw (SerializeException) |
add double value
pValueName | value name | |
pValue | value |
Exception | duplicate pValueName |
void SerializeData::add | ( | const base::String & | pValueName, | |
const base::String & | pValue | |||
) | throw (SerializeException) |
add string value
pValueName | value name | |
pValue | value |
Exception | duplicate pValueName |
void SerializeData::add | ( | const base::String & | pValueName, | |
const char * | pValue | |||
) | throw (SerializeException) |
add string value
pValueName | value name | |
pValue | value |
Exception | duplicate pValueName |
void SerializeData::add | ( | const base::String & | pValueName, | |
unsigned int | pValueCount, | |||
const bool | pValues[] | |||
) | throw (SerializeException) |
add bool values
pValueName | value name | |
pValueCount | number of values | |
pValues | array of values |
Exception | duplicate pValueName |
void SerializeData::add | ( | const base::String & | pValueName, | |
unsigned int | pValueCount, | |||
const int | pValues[] | |||
) | throw (SerializeException) |
add int values
pValueName | value name | |
pValueCount | number of values | |
pValues | array of values |
Exception | duplicate pValueName |
void SerializeData::add | ( | const base::String & | pValueName, | |
unsigned int | pValueCount, | |||
const unsigned int | pValues[] | |||
) | throw (SerializeException) |
add unsigned int values
pValueName | value name | |
pValueCount | number of values | |
pValues | array of values |
Exception | duplicate pValueName |
void SerializeData::add | ( | const base::String & | pValueName, | |
unsigned int | pValueCount, | |||
const long | pValues[] | |||
) | throw (SerializeException) |
add long values
pValueName | value name | |
pValueCount | number of values | |
pValues | array of values |
Exception | duplicate pValueName |
void SerializeData::add | ( | const base::String & | pValueName, | |
unsigned int | pValueCount, | |||
const float | pValues[] | |||
) | throw (SerializeException) |
add float values
pValueName | value name | |
pValueCount | number of values | |
pValues | array of values |
Exception | duplicate pValueName |
void SerializeData::add | ( | const base::String & | pValueName, | |
unsigned int | pValueCount, | |||
const double | pValues[] | |||
) | throw (SerializeException) |
add double values
pValueName | value name | |
pValueCount | number of values | |
pValues | array of values |
Exception | duplicate pValueName |
void SerializeData::add | ( | const base::String & | pValueName, | |
unsigned int | pValueCount, | |||
const base::String | pValues[] | |||
) | throw (SerializeException) |
add long values
pValueName | value name | |
pValueCount | number of values | |
pValues | array of Strings |
Exception | duplicate pValueName |
void SerializeData::add | ( | const base::String & | pSerialName, | |
const SerializeData & | pSerial | |||
) |
void SerializeData::replace | ( | const base::String & | pValueName, | |
bool | pValue | |||
) | throw (SerializeException) |
replace bool value
pValueName | value name | |
pValue | new value |
Exception | pValueName not found |
void SerializeData::replace | ( | const base::String & | pValueName, | |
int | pValue | |||
) | throw (SerializeException) |
replace int value
pValueName | value name | |
pValue | new value |
Exception | pValueName not found |
void SerializeData::replace | ( | const base::String & | pValueName, | |
unsigned int | pValue | |||
) | throw (SerializeException) |
replace unsigend int value
pValueName | value name | |
pValue | new value |
Exception | pValueName not found |
void SerializeData::replace | ( | const base::String & | pValueName, | |
long | pValue | |||
) | throw (SerializeException) |
replace long value
pValueName | value name | |
pValue | new value |
Exception | pValueName not found |
void SerializeData::replace | ( | const base::String & | pValueName, | |
float | pValue | |||
) | throw (SerializeException) |
replace float value
pValueName | value name | |
pValue | new value |
Exception | pValueName not found |
void SerializeData::replace | ( | const base::String & | pValueName, | |
double | pValue | |||
) | throw (SerializeException) |
replace double value
pValueName | value name | |
pValue | new value |
Exception | pValueName not found |
void SerializeData::replace | ( | const base::String & | pValueName, | |
const base::String & | pValue | |||
) | throw (SerializeException) |
replace string value
pValueName | value name | |
pValue | new value |
Exception | pValueName not found |
void SerializeData::replace | ( | const base::String & | pValueName, | |
unsigned int | pValueCount, | |||
bool | pValues[] | |||
) | throw (SerializeException) |
replace bool values
pValueName | value name | |
pValueCount | number of values | |
pValues | new values |
Exception | pValueName not found |
void SerializeData::replace | ( | const base::String & | pValueName, | |
unsigned int | pValueCount, | |||
int | pValues[] | |||
) | throw (SerializeException) |
replace int values
pValueName | value name | |
pValueCount | number of values | |
pValues | new values |
Exception | pValueName not found |
void SerializeData::replace | ( | const base::String & | pValueName, | |
unsigned int | pValueCount, | |||
unsigned int | pValues[] | |||
) | throw (SerializeException) |
replace unsigned int values
pValueName | value name | |
pValueCount | number of values | |
pValues | new values |
Exception | pValueName not found |
void SerializeData::replace | ( | const base::String & | pValueName, | |
unsigned int | pValueCount, | |||
long | pValues[] | |||
) | throw (SerializeException) |
replace long values
pValueName | value name | |
pValueCount | number of values | |
pValues | new values |
Exception | pValueName not found |
void SerializeData::replace | ( | const base::String & | pValueName, | |
unsigned int | pValueCount, | |||
float | pValues[] | |||
) | throw (SerializeException) |
replace float values
pValueName | value name | |
pValueCount | number of values | |
pValues | new values |
Exception | pValueName not found |
void SerializeData::replace | ( | const base::String & | pValueName, | |
unsigned int | pValueCount, | |||
double | pValues[] | |||
) | throw (SerializeException) |
replace double values
pValueName | value name | |
pValueCount | number of values | |
pValues | new values |
Exception | pValueName not found |
void SerializeData::replace | ( | const base::String & | pSerialName, | |
const SerializeData & | pSerial | |||
) | throw (SerializeException) |
replace SerializeData
pSerialName | SerializeData name | |
pSerial | SerializeData |
Exception | pSerialName not found |
void SerializeData::remove | ( | const base::String & | pValueName | ) | throw (SerializeException) |
remove value
pValueName | value name |
Exception | value name not found |
void SerializeData::add | ( | const SerializeData & | pSerial | ) |
add SerializeData
pSerial | SerializeData |
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
pValueName | name of value |
Exception | value name not found |
std::ostream& operator<< | ( | std::ostream & | pOstream, | |
const SerializeData & | pSerial | |||
) | [friend] |
print array information
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