#include <iostream>#include <sstream>#include <string>#include <vector>#include <typeinfo>#include <ctime>#include "Config/Exception.h"Go to the source code of this file.
Namespaces | |
| namespace | cfg |
Classes | |
| class | cfg::Param |
| A single parameter stored in a configuration. More... | |
Functions | |
| template<class T> | |
| const std::type_info & | gsDataType (void) |
| template<class T> | |
| void | gsDataDelete (void *p) |
| template<class T> | |
| void | gsDataCopyCons (void **dest, const void *src) |
| template<class T> | |
| void | gsDataCopy (void *dest, const void *src) |
| template<class T> | |
| void | gsDataPrint (std::ostream &os, const void *p) |
| template<class T> | |
| std::ostream & | operator<< (std::ostream &os, const std::vector< T > &v) |
|
||||||||||||||||
|
Copy data from location src to location dest assuming that dest and src point to objects of type T Definition at line 108 of file Param.h. 00109 {
00110 T* destc = (T*)dest;
00111 T* srcc = (T*)src;
00112 (*destc) = (*srcc);
00113 }
|
|
||||||||||||||||
|
Construct a new object of type T at location (*dest) given object of same type at location src. Definition at line 94 of file Param.h. 00095 {
00096 T* srcc = (T*)src;
00097 T* newt = new T(*srcc);
00098 *dest = (void*)newt;
00099 }
|
|
||||||||||
|
Delete the data pointed to by p assuming its of type T Definition at line 82 of file Param.h. 00083 {
00084 T* pc = (T*)p; delete pc;
00085 }
|
|
||||||||||||||||
|
Print the data located at p assuming its of type T Definition at line 121 of file Param.h. 00122 {
00123 T* pc = (T*)p;
00124 os << (*pc);
00125 }
|
|
||||||||||
|
Return the type info for data of type T Definition at line 71 of file Param.h. 00072 {
00073 return typeid(T);
00074 }
|
|
||||||||||||||||
|
Print a vector of basic types Definition at line 133 of file Param.h. 00134 {
00135 int sz = v.size();
00136 int szm1 = sz-1;
00137 if ( (typeid(T) == typeid(std::string)) ||
00138 (typeid(T) == typeid(const char*)) ) {
00139 // Add quotes if data is of string type
00140 for (int i=0; i<sz; ++i) {
00141 if (i==szm1) os << "\"" << v[i] << "\"";
00142 else os << "\"" << v[i] << "\" ";
00143 }
00144 }
00145 else {
00146 // Non-string data gets streamed normally
00147 for (int i=0; i<sz; ++i) {
00148 if (i==szm1) os << v[i];
00149 else os << v[i] << " ";
00150 }
00151 }
00152 return os;
00153 }
|
1.3.9.1