Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

StDbXmlWriter Class Reference

#include <StDbXmlWriter.h>

Inheritance diagram for StDbXmlWriter:

tableAcceptor typeAcceptor List of all members.

Public Member Functions

 StDbXmlWriter ()
 StDbXmlWriter (ostream &ofs)
virtual ~StDbXmlWriter ()
virtual void streamHeader (const char *name)
virtual void streamTableName (const char *name)
virtual void streamEndTableName ()
virtual void streamAccessor ()
virtual void endAccessor ()
virtual void streamRow (int row)
virtual void streamEndRow ()
virtual void streamTail ()
virtual void ioTable (StDbTable *table)
virtual void pass (char *name, short &i, int &len)
virtual void pass (char *name, int &i, int &len)
virtual void pass (char *name, long &i, int &len)
virtual void pass (char *name, unsigned short &i, int &len)
virtual void pass (char *name, unsigned int &i, int &len)
virtual void pass (char *name, unsigned long &i, int &len)
virtual void pass (char *name, long long &i, int &len)
virtual void pass (char *name, float &i, int &len)
virtual void pass (char *name, double &i, int &len)
virtual void pass (char *name, char *&i, int &len)
virtual void pass (char *name, unsigned char &i, int &len)
virtual void pass (char *name, unsigned char *&i, int &len)
virtual void pass (char *name, short *&i, int &len)
virtual void pass (char *name, int *&i, int &len)
virtual void pass (char *name, long *&i, int &len)
virtual void pass (char *name, unsigned short *&i, int &len)
virtual void pass (char *name, unsigned int *&i, int &len)
virtual void pass (char *name, unsigned long *&i, int &len)
virtual void pass (char *name, long long *&i, int &len)
virtual void pass (char *name, float *&i, int &len)
virtual void pass (char *name, double *&i, int &len)

Protected Attributes

ostream * os

Constructor & Destructor Documentation

StDbXmlWriter::StDbXmlWriter  )  [inline]
 

Definition at line 62 of file StDbXmlWriter.h.

00062 : os(0) {};

StDbXmlWriter::StDbXmlWriter ostream &  ofs  )  [inline]
 

Definition at line 63 of file StDbXmlWriter.h.

00063 { os=&ofs;};

virtual StDbXmlWriter::~StDbXmlWriter  )  [inline, virtual]
 

Definition at line 64 of file StDbXmlWriter.h.

00064 {};


Member Function Documentation

void StDbXmlWriter::endAccessor  )  [virtual]
 

Implements tableAcceptor.

Definition at line 55 of file StDbXmlWriter.cc.

00055 { 00056 *os << "</StDbAccessor>" << endl; 00057 }

void StDbXmlWriter::ioTable StDbTable table  )  [virtual]
 

Implements tableAcceptor.

Definition at line 95 of file StDbXmlWriter.cc.

00095 { 00096 00097 char * name = table->getName(); 00098 streamTableName(name); delete [] name; 00099 streamAccessor(); 00100 table->StreamAccessor((typeAcceptor*)this, false); 00101 endAccessor(); 00102 00103 int k; 00104 int nrows; 00105 int* elements = table->getElementID(nrows); 00106 00107 if(!elements){ 00108 elements = new int[nrows]; 00109 for(k=0;k<nrows;k++)elements[k]=k; 00110 } 00111 00112 table->setRowNumber(); // set to 0 00113 00114 for(k=0;k<nrows;k++){ 00115 streamRow(k); 00116 table->dbStreamer((typeAcceptor*)this, false); 00117 streamEndRow(); 00118 } 00119 streamEndTableName(); 00120 }

void StDbXmlWriter::pass char *  name,
double *&  i,
int &  len
[virtual]
 

Implements typeAcceptor.

Definition at line 319 of file StDbXmlWriter.cc.

00319 { 00320 00321 *os << "<dbDoubleArray> " << name << " <length> "; 00322 *os << len << " </length>" << endl; 00323 *os << "<value>" << endl; 00324 00325 int icount = 0; 00326 for(int j=0; j<len-1;j++){ 00327 *os << i[j] << ", "; 00328 icount++; 00329 if(icount==8){ 00330 *os << endl; 00331 icount = 0; 00332 } 00333 } 00334 00335 *os << i[len-1] << endl; 00336 *os << "</value> </dbDoubleArray> " << endl; 00337 }

void StDbXmlWriter::pass char *  name,
float *&  i,
int &  len
[virtual]
 

Implements typeAcceptor.

Definition at line 289 of file StDbXmlWriter.cc.

00289 { 00290 00291 *os << "<dbFloatArray> " << name << " <length> "; 00292 *os << len << " </length>" << endl; 00293 *os << "<value>" << endl; 00294 00295 int icount = 0; 00296 for(int j=0; j<len-1;j++){ 00297 *os << i[j] << ", "; 00298 icount++; 00299 if(icount==8){ 00300 *os << endl; 00301 icount = 0; 00302 } 00303 } 00304 00305 *os << i[len-1] << endl; 00306 *os << "</value> </dbFloatArray> " << endl; 00307 }

void StDbXmlWriter::pass char *  name,
long long *&  i,
int &  len
[virtual]
 

Implements typeAcceptor.

Definition at line 404 of file StDbXmlWriter.cc.

00404 { 00405 00406 *os << "<dbLongLongArray> " << name << " <length> "; 00407 *os << len << " </length>" << endl; 00408 *os << "<value>" << endl; 00409 00410 int icount = 0; 00411 for(int j=0; j<len-1;j++){ 00412 *os << i[j] << ", "; 00413 icount++; 00414 if(icount==8){ 00415 *os << endl; 00416 icount = 0; 00417 } 00418 } 00419 00420 *os << i[len-1] << endl; 00421 *os << "</value> </dbLongLongArray> " << endl; 00422 }

void StDbXmlWriter::pass char *  name,
unsigned long *&  i,
int &  len
[virtual]
 

Implements typeAcceptor.

Definition at line 382 of file StDbXmlWriter.cc.

00382 { 00383 00384 *os << "<dbULongArray> " << name << " <length> "; 00385 *os << len << " </length>" << endl; 00386 *os << "<value>" << endl; 00387 00388 int icount = 0; 00389 for(int j=0; j<len-1;j++){ 00390 *os << i[j] << ", "; 00391 icount++; 00392 if(icount==8){ 00393 *os << endl; 00394 icount = 0; 00395 } 00396 } 00397 00398 *os << i[len-1] << endl; 00399 *os << "</value> </dbULongArray> " << endl; 00400 }

void StDbXmlWriter::pass char *  name,
unsigned int *&  i,
int &  len
[virtual]
 

Implements typeAcceptor.

Definition at line 259 of file StDbXmlWriter.cc.

00259 { 00260 00261 *os << "<dbUIntArray> " << name << " <length> "; 00262 *os << len << " </length>" << endl; 00263 *os << "<value>" << endl; 00264 00265 int icount = 0; 00266 for(int j=0; j<len-1;j++){ 00267 *os << i[j] << ", "; 00268 icount++; 00269 if(icount==8){ 00270 *os << endl; 00271 icount = 0; 00272 } 00273 } 00274 00275 *os << i[len-1] << endl; 00276 *os << "</value> </dbUIntArray> " << endl; 00277 }

void StDbXmlWriter::pass char *  name,
unsigned short *&  i,
int &  len
[virtual]
 

Implements typeAcceptor.

Definition at line 199 of file StDbXmlWriter.cc.

00199 { 00200 00201 *os << "<dbUShortArray> " << name << " <length> "; 00202 *os << len << " </length>" << endl; 00203 *os << "<value>" << endl; 00204 00205 int icount = 0; 00206 for(int j=0; j<len-1;j++){ 00207 *os << i[j] << ", "; 00208 icount++; 00209 if(icount==8){ 00210 *os << endl; 00211 icount = 0; 00212 } 00213 } 00214 00215 *os << i[len-1] << endl; 00216 *os << "</value> </dbUShortArray> " << endl; 00217 }

void StDbXmlWriter::pass char *  name,
long *&  i,
int &  len
[virtual]
 

Implements typeAcceptor.

Definition at line 348 of file StDbXmlWriter.cc.

00348 { 00349 00350 *os << "<dbLongArray> " << name << " <length> "; 00351 *os << len << " </length>" << endl; 00352 *os << "<value>" << endl; 00353 00354 int icount = 0; 00355 for(int j=0; j<len-1;j++){ 00356 *os << i[j] << ", "; 00357 icount++; 00358 if(icount==8){ 00359 *os << endl; 00360 icount = 0; 00361 } 00362 } 00363 00364 *os << i[len-1] << endl; 00365 *os << "</value> </dbLongArray> " << endl; 00366 }

void StDbXmlWriter::pass char *  name,
int *&  i,
int &  len
[virtual]
 

Implements typeAcceptor.

Definition at line 229 of file StDbXmlWriter.cc.

00229 { 00230 00231 *os << "<dbIntArray> " << name << " <length> "; 00232 *os << len << " </length>" << endl; 00233 *os << "<value>" << endl; 00234 00235 int icount = 0; 00236 for(int j=0; j<len-1;j++){ 00237 *os << i[j] << ", "; 00238 icount++; 00239 if(icount==8){ 00240 *os << endl; 00241 icount = 0; 00242 } 00243 } 00244 00245 *os << i[len-1] << endl; 00246 *os << "</value> </dbIntArray> " << endl; 00247 }

void StDbXmlWriter::pass char *  name,
short *&  i,
int &  len
[virtual]
 

Implements typeAcceptor.

Definition at line 169 of file StDbXmlWriter.cc.

00169 { 00170 00171 *os << "<dbShortArray> " << name << " <length> "; 00172 *os << len << " </length>" << endl; 00173 *os << "<value>" << endl; 00174 00175 int icount = 0; 00176 for(int j=0; j<len-1;j++){ 00177 *os << i[j] << ", "; 00178 icount++; 00179 if(icount==8){ 00180 *os << endl; 00181 icount = 0; 00182 } 00183 } 00184 00185 *os << i[len-1] << endl; 00186 *os << "</value> </dbShortArray> " << endl; 00187 }

void StDbXmlWriter::pass char *  name,
unsigned char *&  i,
int &  len
[virtual]
 

Implements typeAcceptor.

Definition at line 139 of file StDbXmlWriter.cc.

00139 { 00140 *os << "<dbUCharArray> " << name << " <length> "; 00141 *os << len << " </length>" << endl; 00142 *os << "<value>" << endl; 00143 00144 int icount = 0; 00145 for(int j=0; j<len-1;j++){ 00146 *os << (int)i[j] << ", "; 00147 icount++; 00148 if(icount==8){ 00149 *os << endl; 00150 icount = 0; 00151 } 00152 } 00153 00154 *os << (int)i[len-1] << endl; 00155 *os << "</value> </dbUCharArray> " << endl; 00156 }

void StDbXmlWriter::pass char *  name,
unsigned char &  i,
int &  len
[virtual]
 

Implements typeAcceptor.

Definition at line 132 of file StDbXmlWriter.cc.

00132 { 00133 *os << "<dbUChar> "<<name<<" <value> "<< (int)i <<" </value> </dbUChar>" << endl; 00134 }

void StDbXmlWriter::pass char *  name,
char *&  i,
int &  len
[virtual]
 

Implements typeAcceptor.

Definition at line 125 of file StDbXmlWriter.cc.

00125 { 00126 *os << "<dbString> "<<name<<" <value> "<< i <<" </value> </dbString>" << endl; 00127 }

void StDbXmlWriter::pass char *  name,
double &  i,
int &  len
[virtual]
 

Implements typeAcceptor.

Definition at line 312 of file StDbXmlWriter.cc.

00312 { 00313 *os << "<dbDouble> "<<name<<" <value> "<< i <<" </value> </dbDouble>" << endl; 00314 }

void StDbXmlWriter::pass char *  name,
float &  i,
int &  len
[virtual]
 

Implements typeAcceptor.

Definition at line 282 of file StDbXmlWriter.cc.

00282 { 00283 *os << "<dbFloat> "<<name<<" <value> "<< i <<" </value> </dbFloat>" << endl; 00284 }

void StDbXmlWriter::pass char *  name,
long long &  i,
int &  len
[virtual]
 

Implements typeAcceptor.

Definition at line 375 of file StDbXmlWriter.cc.

00375 { 00376 *os << "<dbLongLong> "<<name<<" <value> "<< i <<" </value> </dbLongLong>" << endl; 00377 }

void StDbXmlWriter::pass char *  name,
unsigned long &  i,
int &  len
[virtual]
 

Implements typeAcceptor.

Definition at line 371 of file StDbXmlWriter.cc.

00371 { 00372 *os << "<dbULong> "<<name<<" <value> "<< i <<" </value> </dbULong>" << endl; 00373 }

void StDbXmlWriter::pass char *  name,
unsigned int &  i,
int &  len
[virtual]
 

Implements typeAcceptor.

Definition at line 252 of file StDbXmlWriter.cc.

00252 { 00253 *os << "<dbUInt> "<<name<<" <value> "<< i <<" </value> </dbUInt>" << endl; 00254 }

void StDbXmlWriter::pass char *  name,
unsigned short &  i,
int &  len
[virtual]
 

Implements typeAcceptor.

Definition at line 192 of file StDbXmlWriter.cc.

00192 { 00193 *os << "<dbUShort> "<<name<<" <value> "<< i <<" </value> </dbUShort>" << endl; 00194 }

void StDbXmlWriter::pass char *  name,
long &  i,
int &  len
[virtual]
 

Implements typeAcceptor.

Definition at line 341 of file StDbXmlWriter.cc.

00341 { 00342 *os << "<dbLong> "<<name<<" <value> "<< i <<" </value> </dbLong>" << endl; 00343 }

void StDbXmlWriter::pass char *  name,
int &  i,
int &  len
[virtual]
 

Implements typeAcceptor.

Definition at line 222 of file StDbXmlWriter.cc.

00222 { 00223 *os << "<dbInt> "<<name<<" <value> "<< i <<" </value> </dbInt>" << endl; 00224 }

void StDbXmlWriter::pass char *  name,
short &  i,
int &  len
[virtual]
 

Implements typeAcceptor.

Definition at line 162 of file StDbXmlWriter.cc.

00162 { 00163 *os << "<dbShort> "<<name<<" <value> "<< i <<" </value> </dbShort>" << endl; 00164 }

void StDbXmlWriter::streamAccessor  )  [virtual]
 

Implements tableAcceptor.

Definition at line 48 of file StDbXmlWriter.cc.

00048 { 00049 *os << "<StDbAccessor>" << endl; 00050 }

void StDbXmlWriter::streamEndRow  )  [virtual]
 

Implements tableAcceptor.

Definition at line 76 of file StDbXmlWriter.cc.

00076 { 00077 *os << "</TabRow>" << endl; 00078 }

void StDbXmlWriter::streamEndTableName  )  [virtual]
 

Implements tableAcceptor.

Definition at line 88 of file StDbXmlWriter.cc.

00088 { 00089 *os << "</StDbTable>"<< endl; 00090 }

void StDbXmlWriter::streamHeader const char *  name  )  [virtual]
 

Implements tableAcceptor.

Definition at line 41 of file StDbXmlWriter.cc.

00041 { 00042 *os << "<StDbName>"<<name<< endl; 00043 }

void StDbXmlWriter::streamRow int  row  )  [virtual]
 

Implements tableAcceptor.

Definition at line 69 of file StDbXmlWriter.cc.

00069 { 00070 *os << "<TabRow>" << row << endl; 00071 }

void StDbXmlWriter::streamTableName const char *  name  )  [virtual]
 

Implements tableAcceptor.

Definition at line 82 of file StDbXmlWriter.cc.

00082 { 00083 *os << "<StDbTable>"<<name << endl; 00084 }

void StDbXmlWriter::streamTail  )  [virtual]
 

Implements tableAcceptor.

Definition at line 62 of file StDbXmlWriter.cc.

00062 { 00063 *os << "</StDbName>" << endl; 00064 }


Member Data Documentation

ostream* StDbXmlWriter::os [protected]
 

Definition at line 58 of file StDbXmlWriter.h.


The documentation for this class was generated from the following files:
Generated on Thu Aug 24 14:46:10 2006 for Doxygen by doxygen 1.3.7