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

StDbBuffer.cc File Reference

#include "StDbBuffer.h"
#include <stdlib.h>
#include <string.h>
#include "stdb_streams.h"

Go to the source code of this file.

Defines

#define castcase(typelist, casttype, tpe)   case typelist: {casttype *tVal=(casttype*)aVal;casttype tValSwap;MemSwapCpy((char*)&tValSwap,(char*)tVal,mycsize[typelist],mycswapl[typelist],Client);*s=(tpe)tValSwap;};break;
#define genwritemem(tpe)
#define castcasest(typelist, casttype)   case typelist: {casttype tVal; MemSwapCpy((char*)&tVal,(char*)aVal,mycsize[typelist],mycswapl[typelist],Client);StString sStream;sStream.precision(10); sStream << tVal; string s2=sStream.str();char *tStr=new char[s2.length()+1];strcpy(tStr,s2.c_str());s[0]=tStr; };break
#define Rscal(tpe)
#define Wscal(tpe, tpelist, len)
#define Rarray(tpe, tpelist)
#define Warray(tpe, tpelist)

Functions

 genwritemem (char)
 genwritemem (unsigned char)
 genwritemem (short)
 genwritemem (int)
 genwritemem (long)
 genwritemem (float)
 genwritemem (double)
 Rscal (char &)
 Rscal (unsigned char &)
 Rscal (short &)
 Rscal (unsigned short &)
 Rscal (int &)
 Rscal (unsigned int &)
 Rscal (long &)
 Rscal (unsigned long &)
 Rscal (long long &)
 Rscal (float &)
 Rscal (double &)
 Rscal (char *&)
 Wscal (char, _char, 1)
 Wscal (unsigned char, _uchar, 1)
 Wscal (short, _short, 1)
 Wscal (unsigned short, _ushort, 1)
 Wscal (int, _int, 1)
 Wscal (unsigned int, _uint, 1)
 Wscal (long, _long, 1)
 Wscal (unsigned long, _ulong, 1)
 Wscal (float, _float, 1)
 Wscal (double, _double, 1)
 Rarray (unsigned char, _uchar)
 Rarray (short, _short)
 Rarray (unsigned short, _ushort)
 Rarray (int, _int)
 Rarray (unsigned int, _uint)
 Rarray (long, _long)
 Rarray (unsigned long, _ulong)
 Rarray (float, _float)
 Rarray (double, _double)
 Rarray (char *, _string)
 Warray (char, _char)
 Warray (unsigned char, _uchar)
 Warray (short, _short)
 Warray (unsigned short, _ushort)
 Warray (int, _int)
 Warray (unsigned int, _uint)
 Warray (long, _long)
 Warray (unsigned long, _ulong)
 Warray (float, _float)
 Warray (double, _double)
 Warray (char *, _string)


Define Documentation

#define castcase typelist,
casttype,
tpe   )     case typelist: {casttype *tVal=(casttype*)aVal;casttype tValSwap;MemSwapCpy((char*)&tValSwap,(char*)tVal,mycsize[typelist],mycswapl[typelist],Client);*s=(tpe)tValSwap;};break;
 

Definition at line 308 of file StDbBuffer.cc.

#define castcasest typelist,
casttype   )     case typelist: {casttype tVal; MemSwapCpy((char*)&tVal,(char*)aVal,mycsize[typelist],mycswapl[typelist],Client);StString sStream;sStream.precision(10); sStream << tVal; string s2=sStream.str();char *tStr=new char[s2.length()+1];strcpy(tStr,s2.c_str());s[0]=tStr; };break
 

Definition at line 342 of file StDbBuffer.cc.

#define genwritemem tpe   ) 
 

Value:

bool StDbBuffer::WriteMem( tpe *s,void* aVal, myctype type)\ {bool tRetVal=true;\ switch (type) {\ castcase(_char,char,tpe);\ castcase(_uchar,unsigned char,tpe);\ castcase(_short,short,tpe);\ castcase(_ushort,unsigned short,tpe);\ castcase(_int,int,tpe);\ castcase(_uint,unsigned int,tpe);\ castcase(_long,long,tpe);\ castcase(_ulong,unsigned long,tpe);\ castcase(_longlong,long long,tpe);\ castcase(_float,float,tpe);\ castcase(_double,double,tpe);\ case _string: {char** tVal=(char**)aVal;StrConv(*tVal,*s);};break;\ default: cout <<"wrong type" << endl;tRetVal=false;\ };\ return tRetVal;\ }

Definition at line 310 of file StDbBuffer.cc.

#define Rarray tpe,
tpelist   ) 
 

Value:

bool StDbBuffer::ReadArray(tpe* &s, int &len,const char *aName)\ { bool tRetVal=false; \ bool newCheck=false;\ if (Find_Col(aName)) \ {int i;\ if (mCol[mCur].type==_char ) {\ len=mCol[mCur].length/sizeof(tpe);\ s=new tpe[len];\ newCheck=true;\ MemSwapCpy((char*)s,(char*)mCol[mCur].val,len*sizeof(tpe),mycswapl[tpelist],Auto);\ tRetVal=true;\ } else {\ len=mCol[mCur].length;\ s=new tpe[len];\ newCheck=true;\ for (i=0;i<len;i++)\ { if (!(WriteMem(&s[i],(void*)(((char*)mCol[mCur].val)+i*mycsize[mCol[mCur].type]),mCol[mCur].type))) break;}\ if (i==(int)mCol[mCur].length) tRetVal=true;}}\ return tRetVal;\ }

Definition at line 445 of file StDbBuffer.cc.

#define Rscal tpe   ) 
 

Value:

bool StDbBuffer::ReadScalar(tpe s,const char *aName) \ {bool tRetVal=false; \ if(Find_Col(aName) && WriteMem(&s,mCol[mCur].val,mCol[mCur].type)) \ tRetVal=true;\ return tRetVal;}

Definition at line 369 of file StDbBuffer.cc.

#define Warray tpe,
tpelist   ) 
 

Value:

bool StDbBuffer::WriteArray(tpe* s,int len,const char *aName) \ { if (Find_Col(aName))\ {ChangeField(tpelist,(void*)s,len);}\ else\ {AddField(aName,tpelist,(void*)s,len);};\ return true;\ }

Definition at line 496 of file StDbBuffer.cc.

#define Wscal tpe,
tpelist,
len   ) 
 

Value:

bool StDbBuffer::WriteScalar(const tpe s,const char *aName) \ { if (Find_Col(aName))\ {ChangeField(tpelist,(void*)&s,len);}\ else\ {AddField(aName,tpelist,(void*)&s,len);};\ return true;\ }

Definition at line 396 of file StDbBuffer.cc.


Function Documentation

genwritemem double   ) 
 

genwritemem float   ) 
 

genwritemem long   ) 
 

genwritemem int   ) 
 

genwritemem short   ) 
 

genwritemem unsigned  char  ) 
 

genwritemem char   ) 
 

Rarray char *  ,
_string 
 

Rarray double  ,
_double 
 

Rarray float  ,
_float 
 

Rarray unsigned  long,
_ulong 
 

Rarray long  ,
_long 
 

Rarray unsigned  int,
_uint 
 

Rarray int  ,
_int 
 

Rarray unsigned  short,
_ushort 
 

Rarray short  ,
_short 
 

Rarray unsigned  char,
_uchar 
 

Rscal char *&   ) 
 

Rscal double &   ) 
 

Rscal float &   ) 
 

Rscal long long &   ) 
 

Rscal unsigned long &   ) 
 

Rscal long &   ) 
 

Rscal unsigned int &   ) 
 

Rscal int &   ) 
 

Rscal unsigned short &   ) 
 

Rscal short &   ) 
 

Rscal unsigned char &   ) 
 

Rscal char &   ) 
 

Warray char *  ,
_string 
 

Warray double  ,
_double 
 

Warray float  ,
_float 
 

Warray unsigned  long,
_ulong 
 

Warray long  ,
_long 
 

Warray unsigned  int,
_uint 
 

Warray int  ,
_int 
 

Warray unsigned  short,
_ushort 
 

Warray short  ,
_short 
 

Warray unsigned  char,
_uchar 
 

Warray char  ,
_char 
 

Wscal double  ,
_double  ,
 

Wscal float  ,
_float  ,
 

Wscal unsigned  long,
_ulong  ,
 

Wscal long  ,
_long  ,
 

Wscal unsigned  int,
_uint  ,
 

Wscal int  ,
_int  ,
 

Wscal unsigned  short,
_ushort  ,
 

Wscal short  ,
_short  ,
 

Wscal unsigned  char,
_uchar  ,
 

Wscal char  ,
_char  ,
 


Generated on Thu Aug 24 14:45:30 2006 for Doxygen by doxygen 1.3.7