ROOT  6.06/09
Reference Guide
TBufferSQL2.h
Go to the documentation of this file.
1 // @(#)root/sql
2 // Author: Sergey Linev 20/11/2005
3 
4 
5 #ifndef ROOT_TBufferSQL2
6 #define ROOT_TBufferSQL2
7 
8 #ifndef ROOT_TBufferFile
9 #include "TBufferFile.h"
10 #endif
11 
12 #ifndef ROOT_TString
13 #include "TString.h"
14 #endif
15 
16 #ifndef ROOT_TObjArray
17 #include "TObjArray.h"
18 #endif
19 
20 class TMap;
21 class TExMap;
23 class TStreamerElement;
24 class TObjArray;
25 class TMemberStreamer;
26 class TSQLStackObj;
27 
28 class TSQLServer;
29 class TSQLResult;
30 class TSQLRow;
31 class TSQLFile;
32 class TSQLStructure;
33 class TSQLObjectData;
34 class TSQLClassInfo;
35 
36 class TBufferSQL2 : public TBufferFile {
37 
38 friend class TSQLStructure;
39 
40 protected:
41 
42  TSQLFile* fSQL; ///<! instance of TSQLFile
43  TSQLStructure* fStructure; ///<! structures, created by object storing
44  TSQLStructure* fStk; ///<! pointer on current active structure (stack head)
45  TExMap* fObjMap; ///<! Map between stored objects and object id
46  TString fReadBuffer; ///<! Buffer for read value
47  Int_t fErrorFlag; ///<! Error id value
48  Bool_t fExpectedChain; ///<! flag to resolve situation when several elements of same basic type stored as FastArray
49  Int_t fCompressLevel; ///<! compress level used to minimize size of data in database
50  Int_t fReadVersionBuffer; ///<! buffer, used to by ReadVersion method
51  Long64_t fObjIdCounter; ///<! counter of objects id
52  Bool_t fIgnoreVerification; ///<! ignore verification of names
54  TObjArray* fObjectsInfos; ///<! array of objects info for selected key
55  Long64_t fFirstObjId; ///<! id of first object to be read from the database
56  Long64_t fLastObjId; ///<! id of last object correspond to this key
57  TMap* fPoolsMap; ///<! map of pools with data from different tables
58 
59  // TBufferSQL2 objects cannot be copied or assigned
60  TBufferSQL2(const TBufferSQL2 &); // not implemented
61  void operator=(const TBufferSQL2 &); // not implemented
62 
63  TBufferSQL2();
64 
65  // redefined protected virtual functions
66 
67  virtual void WriteObjectClass(const void *actualObjStart, const TClass *actualClass);
68 
69  // end redefined protected virtual functions
70 
73  TSQLStructure* Stack(Int_t depth = 0);
74 
75  void WorkWithClass(const char* classname, Version_t classversion);
76  void WorkWithElement(TStreamerElement* elem, Int_t comp_type);
77 
79  Bool_t SqlObjectInfo(Long64_t objid, TString& clname, Version_t& version);
81 
95  Bool_t SqlWriteValue(const char* value, const char* tname);
96 
97  void SqlReadBasic(Char_t& value);
98  void SqlReadBasic(Short_t& value);
99  void SqlReadBasic(Int_t& value);
100  void SqlReadBasic(Long_t& value);
101  void SqlReadBasic(Long64_t& value);
102  void SqlReadBasic(Float_t& value);
103  void SqlReadBasic(Double_t& value);
104  void SqlReadBasic(Bool_t& value);
105  void SqlReadBasic(UChar_t& value);
106  void SqlReadBasic(UShort_t& value);
107  void SqlReadBasic(UInt_t& value);
108  void SqlReadBasic(ULong_t& value);
110  const char* SqlReadValue(const char* tname);
111  const char* SqlReadCharStarValue();
112 
113  Int_t SqlWriteObject(const void* obj, const TClass* objClass, TMemberStreamer *streamer = 0, Int_t streamer_index = 0);
114  void* SqlReadObject(void* obj, TClass** cl = 0, TMemberStreamer *streamer = 0, Int_t streamer_index = 0, const TClass *onFileClass=0);
115  void* SqlReadObjectDirect(void* obj, TClass** cl, Long64_t objid, TMemberStreamer *streamer = 0, Int_t streamer_index = 0, const TClass *onFileClass = 0);
116 
117 public:
118 
120  TBufferSQL2(TBuffer::EMode mode, TSQLFile* file);
121  virtual ~TBufferSQL2();
122 
123  void SetCompressionLevel(int level) { fCompressLevel = level; }
124 
125  TSQLStructure* GetStructure() const { return fStructure; }
126 
127  Int_t GetErrorFlag() const { return fErrorFlag; }
128 
129  void SetIgnoreVerification() { fIgnoreVerification = kTRUE; }
130 
131  TSQLStructure* SqlWriteAny(const void* obj, const TClass* cl, Long64_t objid);
132 
133  void* SqlReadAny(Long64_t keyid, Long64_t objid, TClass** cl, void* obj = 0);
134 
135  // suppress class writing/reading
136 
137  virtual TClass* ReadClass(const TClass* cl = 0, UInt_t* objTag = 0);
138  virtual void WriteClass(const TClass* cl);
139 
140  // redefined virtual functions of TBuffer
141 
142  virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss); // SL
143  virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const char *classname); // SL
144  virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion = kFALSE); // SL
145 
146  virtual void SkipVersion(const TClass *cl = 0);
147  virtual Version_t ReadVersion(UInt_t *start = 0, UInt_t *bcnt = 0, const TClass *cl = 0); // SL
148  virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt = kFALSE); // SL
149 
150  virtual void* ReadObjectAny(const TClass* clCast);
151  virtual void SkipObjectAny();
152 
153  virtual void IncrementLevel(TVirtualStreamerInfo*);
154  virtual void SetStreamerElementNumber(TStreamerElement *elem, Int_t comp_type);
155  virtual void DecrementLevel(TVirtualStreamerInfo*);
156 
157  virtual void ClassBegin(const TClass*, Version_t = -1);
158  virtual void ClassEnd(const TClass*);
159  virtual void ClassMember(const char* name, const char* typeName = 0, Int_t arrsize1 = -1, Int_t arrsize2 = -1);
160 
161  virtual void WriteObject(const TObject *obj);
162 
163  virtual void ReadFloat16 (Float_t *f, TStreamerElement *ele=0);
164  virtual void WriteFloat16(Float_t *f, TStreamerElement *ele=0);
165  virtual void ReadDouble32 (Double_t *d, TStreamerElement *ele=0);
166  virtual void WriteDouble32(Double_t *d, TStreamerElement *ele=0);
167  virtual void ReadWithFactor(Float_t *ptr, Double_t factor, Double_t minvalue);
168  virtual void ReadWithNbits(Float_t *ptr, Int_t nbits);
169  virtual void ReadWithFactor(Double_t *ptr, Double_t factor, Double_t minvalue);
170  virtual void ReadWithNbits(Double_t *ptr, Int_t nbits);
171 
172  virtual Int_t ReadArray(Bool_t *&b);
173  virtual Int_t ReadArray(Char_t *&c);
174  virtual Int_t ReadArray(UChar_t *&c);
175  virtual Int_t ReadArray(Short_t *&h);
176  virtual Int_t ReadArray(UShort_t *&h);
177  virtual Int_t ReadArray(Int_t *&i);
178  virtual Int_t ReadArray(UInt_t *&i);
179  virtual Int_t ReadArray(Long_t *&l);
180  virtual Int_t ReadArray(ULong_t *&l);
181  virtual Int_t ReadArray(Long64_t *&l);
182  virtual Int_t ReadArray(ULong64_t *&l);
183  virtual Int_t ReadArray(Float_t *&f);
184  virtual Int_t ReadArray(Double_t *&d);
185  virtual Int_t ReadArrayFloat16(Float_t *&f, TStreamerElement *ele=0);
186  virtual Int_t ReadArrayDouble32(Double_t *&d, TStreamerElement *ele=0);
187 
188  virtual Int_t ReadStaticArray(Bool_t *b);
189  virtual Int_t ReadStaticArray(Char_t *c);
190  virtual Int_t ReadStaticArray(UChar_t *c);
191  virtual Int_t ReadStaticArray(Short_t *h);
192  virtual Int_t ReadStaticArray(UShort_t *h);
193  virtual Int_t ReadStaticArray(Int_t *i);
194  virtual Int_t ReadStaticArray(UInt_t *i);
195  virtual Int_t ReadStaticArray(Long_t *l);
196  virtual Int_t ReadStaticArray(ULong_t *l);
197  virtual Int_t ReadStaticArray(Long64_t *l);
198  virtual Int_t ReadStaticArray(ULong64_t *l);
199  virtual Int_t ReadStaticArray(Float_t *f);
200  virtual Int_t ReadStaticArray(Double_t *d);
203 
204  virtual void ReadFastArray(Bool_t *b, Int_t n);
205  virtual void ReadFastArray(Char_t *c, Int_t n);
206  virtual void ReadFastArray(UChar_t *c, Int_t n);
207  virtual void ReadFastArray(Short_t *h, Int_t n);
208  virtual void ReadFastArray(UShort_t *h, Int_t n);
209  virtual void ReadFastArray(Int_t *i, Int_t n);
210  virtual void ReadFastArray(UInt_t *i, Int_t n);
211  virtual void ReadFastArray(Long_t *l, Int_t n);
212  virtual void ReadFastArray(ULong_t *l, Int_t n);
213  virtual void ReadFastArray(Long64_t *l, Int_t n);
214  virtual void ReadFastArray(ULong64_t *l, Int_t n);
215  virtual void ReadFastArray(Float_t *f, Int_t n);
216  virtual void ReadFastArray(Double_t *d, Int_t n);
217  virtual void ReadFastArrayFloat16(Float_t *f, Int_t n, TStreamerElement *ele=0);
218  virtual void ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele=0);
219  virtual void ReadFastArrayWithFactor(Float_t *ptr, Int_t n, Double_t factor, Double_t minvalue) ;
220  virtual void ReadFastArrayWithNbits(Float_t *ptr, Int_t n, Int_t nbits);
221  virtual void ReadFastArrayWithFactor(Double_t *ptr, Int_t n, Double_t factor, Double_t minvalue);
222  virtual void ReadFastArrayWithNbits(Double_t *ptr, Int_t n, Int_t nbits) ;
223 
224  virtual void WriteArray(const Bool_t *b, Int_t n);
225  virtual void WriteArray(const Char_t *c, Int_t n);
226  virtual void WriteArray(const UChar_t *c, Int_t n);
227  virtual void WriteArray(const Short_t *h, Int_t n);
228  virtual void WriteArray(const UShort_t *h, Int_t n);
229  virtual void WriteArray(const Int_t *i, Int_t n);
230  virtual void WriteArray(const UInt_t *i, Int_t n);
231  virtual void WriteArray(const Long_t *l, Int_t n);
232  virtual void WriteArray(const ULong_t *l, Int_t n);
233  virtual void WriteArray(const Long64_t *l, Int_t n);
234  virtual void WriteArray(const ULong64_t *l, Int_t n);
235  virtual void WriteArray(const Float_t *f, Int_t n);
236  virtual void WriteArray(const Double_t *d, Int_t n);
237  virtual void WriteArrayFloat16(const Float_t *f, Int_t n, TStreamerElement *ele=0);
238  virtual void WriteArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=0);
239  virtual void ReadFastArray(void *start , const TClass *cl, Int_t n=1, TMemberStreamer *s=0, const TClass *onFileClass=0 );
240  virtual void ReadFastArray(void **startp, const TClass *cl, Int_t n=1, Bool_t isPreAlloc=kFALSE, TMemberStreamer *s=0, const TClass *onFileClass=0);
241 
242  virtual void WriteFastArray(const Bool_t *b, Int_t n);
243  virtual void WriteFastArray(const Char_t *c, Int_t n);
244  virtual void WriteFastArray(const UChar_t *c, Int_t n);
245  virtual void WriteFastArray(const Short_t *h, Int_t n);
246  virtual void WriteFastArray(const UShort_t *h, Int_t n);
247  virtual void WriteFastArray(const Int_t *i, Int_t n);
248  virtual void WriteFastArray(const UInt_t *i, Int_t n);
249  virtual void WriteFastArray(const Long_t *l, Int_t n);
250  virtual void WriteFastArray(const ULong_t *l, Int_t n);
251  virtual void WriteFastArray(const Long64_t *l, Int_t n);
252  virtual void WriteFastArray(const ULong64_t *l, Int_t n);
253  virtual void WriteFastArray(const Float_t *f, Int_t n);
254  virtual void WriteFastArray(const Double_t *d, Int_t n);
255  virtual void WriteFastArrayFloat16(const Float_t *f, Int_t n, TStreamerElement *ele=0);
256  virtual void WriteFastArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=0);
257  virtual void WriteFastArray(void *start, const TClass *cl, Int_t n=1, TMemberStreamer *s=0);
258  virtual Int_t WriteFastArray(void **startp, const TClass *cl, Int_t n=1, Bool_t isPreAlloc=kFALSE, TMemberStreamer *s=0);
259 
260  virtual void StreamObject(void *obj, const type_info &typeinfo, const TClass* onFileClass = 0);
261  virtual void StreamObject(void *obj, const char *className, const TClass* onFileClass = 0 );
262  virtual void StreamObject(void *obj, const TClass *cl, const TClass* onFileClass = 0 );
263  virtual void StreamObject(TObject *obj);
264  virtual void StreamObject(void *obj, TMemberStreamer *streamer, const TClass *cl, Int_t n = 0, const TClass *onFileClass = 0);
265 
266  virtual void ReadBool(Bool_t &b);
267  virtual void ReadChar(Char_t &c);
268  virtual void ReadUChar(UChar_t &c);
269  virtual void ReadShort(Short_t &s);
270  virtual void ReadUShort(UShort_t &s);
271  virtual void ReadInt(Int_t &i);
272  virtual void ReadUInt(UInt_t &i);
273  virtual void ReadLong(Long_t &l);
274  virtual void ReadULong(ULong_t &l);
275  virtual void ReadLong64(Long64_t &l);
276  virtual void ReadULong64(ULong64_t &l);
277  virtual void ReadFloat(Float_t &f);
278  virtual void ReadDouble(Double_t &d);
279  virtual void ReadCharP(Char_t *c);
280  virtual void ReadTString(TString &s);
281  virtual void ReadStdString(std::string &s);
282 
283  virtual void WriteBool(Bool_t b);
284  virtual void WriteChar(Char_t c);
285  virtual void WriteUChar(UChar_t c);
286  virtual void WriteShort(Short_t s);
287  virtual void WriteUShort(UShort_t s);
288  virtual void WriteInt(Int_t i);
289  virtual void WriteUInt(UInt_t i);
290  virtual void WriteLong(Long_t l);
291  virtual void WriteULong(ULong_t l);
292  virtual void WriteLong64(Long64_t l);
293  virtual void WriteULong64(ULong64_t l);
294  virtual void WriteFloat(Float_t f);
295  virtual void WriteDouble(Double_t d);
296  virtual void WriteCharP(const Char_t *c);
297  virtual void WriteTString(const TString &s);
298  virtual void WriteStdString(const std::string &s);
299 
300  virtual Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *object);
301  virtual Int_t ApplySequenceVecPtr(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection);
302  virtual Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection);
303 
304  static void SetFloatFormat(const char* fmt = "%e");
305  static const char* GetFloatFormat();
306 
307  // end of redefined virtual functions
308 
309 ClassDef(TBufferSQL2,1); //a specialized TBuffer to convert data to SQL statements or read data from SQL tables
310 };
311 
312 #endif
virtual void IncrementLevel(TVirtualStreamerInfo *)
Function is called from TStreamerInfo WriteBuffer and Readbuffer functions and indent new level in da...
Int_t GetErrorFlag() const
Definition: TBufferSQL2.h:127
void * SqlReadAny(Long64_t keyid, Long64_t objid, TClass **cl, void *obj=0)
Recreate object from sql structure.
virtual void ReadFastArrayDouble32(Double_t *d, Int_t n, TStreamerElement *ele=0)
Read array of Double32_t from buffer.
virtual void ReadFloat(Float_t &f)
Reads Float_t value from buffer.
virtual Version_t ReadVersion(UInt_t *start=0, UInt_t *bcnt=0, const TClass *cl=0)
Read version value from buffer actually version is normally defined by table name and kept in interme...
An array of TObjects.
Definition: TObjArray.h:39
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket...
Definition: TBufferFile.h:51
long long Long64_t
Definition: RtypesCore.h:69
short Version_t
Definition: RtypesCore.h:61
virtual void ClassBegin(const TClass *, Version_t=-1)
This method inform buffer data of which class now will be streamed.
float Float_t
Definition: RtypesCore.h:53
virtual void WriteFastArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=0)
Write array of Double32_t to buffer.
TExMap * fObjMap
! Map between stored objects and object id
Definition: TBufferSQL2.h:45
virtual void ReadFastArrayWithFactor(Float_t *ptr, Int_t n, Double_t factor, Double_t minvalue)
Read array of Float16_t from buffer.
virtual void ClassMember(const char *name, const char *typeName=0, Int_t arrsize1=-1, Int_t arrsize2=-1)
Method indicates name and typename of class memeber, which should be now streamed in custom streamer ...
virtual void WriteLong64(Long64_t l)
Writes Long64_t value to buffer.
virtual void ReadLong64(Long64_t &l)
Reads Long64_t value from buffer.
virtual void ReadDouble32(Double_t *d, TStreamerElement *ele=0)
Read Double32 value.
virtual void ReadTString(TString &s)
Read a TString.
Int_t SqlWriteObject(const void *obj, const TClass *objClass, TMemberStreamer *streamer=0, Int_t streamer_index=0)
Write object to buffer.
static void SetFloatFormat(const char *fmt="%e")
set printf format for float/double members, default "%e" changes global TSQLServer variable ...
virtual void ReadFastArrayWithNbits(Float_t *ptr, Int_t n, Int_t nbits)
Read array of Float16_t from buffer.
unsigned short UShort_t
Definition: RtypesCore.h:36
TH1 * h
Definition: legend2.C:5
virtual void ReadFloat16(Float_t *f, TStreamerElement *ele=0)
Read Float16 value.
Int_t fCompressLevel
! compress level used to minimize size of data in database
Definition: TBufferSQL2.h:49
virtual void SkipVersion(const TClass *cl=0)
Skip class version from I/O buffer.
Contains information about tables specific to one class and version.
Definition: TSQLClassInfo.h:48
virtual void ReadUShort(UShort_t &s)
Reads UShort_t value from buffer.
virtual void WriteObjectClass(const void *actualObjStart, const TClass *actualClass)
Write object to buffer. Only used from TBuffer.
Basic string class.
Definition: TString.h:137
virtual void WriteFastArrayFloat16(const Float_t *f, Int_t n, TStreamerElement *ele=0)
Write array of Float16_t to buffer.
virtual void ReadBool(Bool_t &b)
Reads Bool_t value from buffer.
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
Int_t fErrorFlag
! Error id value
Definition: TBufferSQL2.h:47
const Bool_t kFALSE
Definition: Rtypes.h:92
TSQLStructure * fStructure
! structures, created by object storing
Definition: TBufferSQL2.h:43
TSQLObjectData * SqlObjectData(Long64_t objid, TSQLClassInfo *sqlinfo)
Creates TSQLObjectData for specifed object id and specified class.
virtual void WriteFastArray(const Bool_t *b, Int_t n)
Write array of Bool_t to buffer.
virtual void ReadStdString(std::string &s)
Read a std::string.
virtual void WriteUChar(UChar_t c)
Writes UChar_t value to buffer.
Int_t SqlReadArraySize()
Reads array size, written in raw data table.
Bool_t fIgnoreVerification
! ignore verification of names
Definition: TBufferSQL2.h:52
Int_t fReadVersionBuffer
! buffer, used to by ReadVersion method
Definition: TBufferSQL2.h:50
TSQLStructure * PushStack()
Push stack with structurual information about streamed object.
TSQLObjectData is used in TBufferSQL2 class in reading procedure.
virtual void ReadUInt(UInt_t &i)
Reads UInt_t value from buffer.
void WorkWithElement(TStreamerElement *elem, Int_t comp_type)
This function is a part of SetStreamerElementNumber method.
ClassDef(TBufferSQL2, 1)
virtual Int_t ReadArray(Bool_t *&b)
Read array of Bool_t from buffer.
virtual void ReadInt(Int_t &i)
Reads Int_t value from buffer.
virtual void WriteDouble(Double_t d)
Writes Double_t value to buffer.
TSQLFile * fSQL
! instance of TSQLFile
Definition: TBufferSQL2.h:42
virtual void WriteShort(Short_t s)
Writes Short_t value to buffer.
virtual void WriteBool(Bool_t b)
Writes Bool_t value to buffer.
virtual void WriteULong(ULong_t l)
Writes ULong_t value to buffer.
void * SqlReadObject(void *obj, TClass **cl=0, TMemberStreamer *streamer=0, Int_t streamer_index=0, const TClass *onFileClass=0)
Read object from the buffer.
This is hierarhical structure, which is created when data is written by TBufferSQL2.
virtual void WriteUShort(UShort_t s)
Writes UShort_t value to buffer.
void operator=(const TBufferSQL2 &)
virtual void WriteClass(const TClass *cl)
Suppressed function of TBuffer.
virtual void WriteTString(const TString &s)
Write a TString.
Bool_t SqlWriteBasic(Char_t value)
converts Char_t to string and creates correspondent sql structure
virtual void WriteULong64(ULong64_t l)
Writes ULong64_t value to buffer.
virtual Int_t ReadStaticArrayDouble32(Double_t *d, TStreamerElement *ele=0)
Read array of Double32_t from buffer.
TBufferSQL2()
Default constructor, should not be used.
Definition: TBufferSQL2.cxx:68
static const char * GetFloatFormat()
return current printf format for float/double members, default "%e" return format, hold by TSQLServer
virtual void ReadCharP(Char_t *c)
Reads array of characters from buffer.
TSQLStructure * GetStructure() const
Definition: TBufferSQL2.h:125
virtual void WriteArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=0)
Write array of Double32_t to buffer.
Access an SQL db via the TFile interface.
Definition: TSQLFile.h:32
virtual void WriteLong(Long_t l)
Writes Long_t value to buffer.
TSQLStructure * fStk
! pointer on current active structure (stack head)
Definition: TBufferSQL2.h:44
virtual Int_t ReadArrayFloat16(Float_t *&f, TStreamerElement *ele=0)
Read array of Float16_t from buffer.
virtual Int_t ReadArrayDouble32(Double_t *&d, TStreamerElement *ele=0)
Read array of Double32_t from buffer.
unsigned int UInt_t
Definition: RtypesCore.h:42
TSQLStructure * Stack(Int_t depth=0)
returns head of stack
short Short_t
Definition: RtypesCore.h:35
TLine * l
Definition: textangle.C:4
The ROOT global object gROOT contains a list of all defined classes.
Definition: TClass.h:81
virtual void WriteArray(const Bool_t *b, Int_t n)
Write array of Bool_t to buffer.
virtual TClass * ReadClass(const TClass *cl=0, UInt_t *objTag=0)
Suppressed function of TBuffer.
virtual Int_t ReadStaticArray(Bool_t *b)
Read array of Bool_t from buffer.
virtual void ClassEnd(const TClass *)
Method indicates end of streaming of classdata in custom streamer.
virtual void ReadWithFactor(Float_t *ptr, Double_t factor, Double_t minvalue)
Read a Double32_t from the buffer when the factor and minimun value have been specified see comments ...
virtual void ReadFastArrayFloat16(Float_t *f, Int_t n, TStreamerElement *ele=0)
Read array of Float16_t from buffer.
Converts data to SQL statements or read data from SQL tables.
Definition: TBufferSQL2.h:36
long Long_t
Definition: RtypesCore.h:50
virtual void ReadDouble(Double_t &d)
Reads Double_t value from buffer.
virtual void ReadWithNbits(Float_t *ptr, Int_t nbits)
Read a Float16_t from the buffer when the number of bits is specified (explicitly or not) see comment...
double f(double x)
void SqlReadBasic(Char_t &value)
Read current value from table and convert it to Char_t value.
double Double_t
Definition: RtypesCore.h:55
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
Definition: TMap.h:44
unsigned long long ULong64_t
Definition: RtypesCore.h:70
const char * SqlReadCharStarValue()
Read CharStar value, if it has special code, request it from large table.
unsigned long ULong_t
Definition: RtypesCore.h:51
Bool_t SqlWriteValue(const char *value, const char *tname)
virtual void SkipObjectAny()
?????? Skip any kind of object from buffer !!!!!! fix me, not yet implemented Should be just skip of ...
virtual void WriteFloat(Float_t f)
Writes Float_t value to buffer.
void WorkWithClass(const char *classname, Version_t classversion)
This function is a part of IncrementLevel method.
virtual void WriteArrayFloat16(const Float_t *f, Int_t n, TStreamerElement *ele=0)
Write array of Float16_t to buffer.
void SetCompressionLevel(int level)
Definition: TBufferSQL2.h:123
virtual void WriteDouble32(Double_t *d, TStreamerElement *ele=0)
Write Double32 value.
virtual void ReadChar(Char_t &c)
Reads Char_t value from buffer.
#define name(a, b)
Definition: linkTestLib0.cpp:5
virtual void WriteInt(Int_t i)
Writes Int_t value to buffer.
Mother of all ROOT objects.
Definition: TObject.h:58
char Char_t
Definition: RtypesCore.h:29
virtual void DecrementLevel(TVirtualStreamerInfo *)
Function is called from TStreamerInfo WriteBuffer and Readbuffer functions and decrease level in sql ...
Bool_t SqlObjectInfo(Long64_t objid, TString &clname, Version_t &version)
Returns object info like classname and version Should be taken from buffer, which is produced in the ...
virtual void WriteObject(const TObject *obj)
Convert object into sql structures.
virtual void ReadShort(Short_t &s)
Reads Short_t value from buffer.
Long64_t fObjIdCounter
! counter of objects id
Definition: TBufferSQL2.h:51
virtual void * ReadObjectAny(const TClass *clCast)
Read object from buffer. Only used from TBuffer.
virtual UInt_t WriteVersion(const TClass *cl, Bool_t useBcnt=kFALSE)
Copies class version to buffer, but not writes it to sql immidiately Version will be used to produce ...
unsigned char UChar_t
Definition: RtypesCore.h:34
virtual ~TBufferSQL2()
Destroy sql buffer.
TSQLStructure * SqlWriteAny(const void *obj, const TClass *cl, Long64_t objid)
Convert object of any class to sql structures Return pointer on created TSQLStructure TSQLStructure o...
virtual void ReadULong(ULong_t &l)
Reads ULong_t value from buffer.
virtual void ReadULong64(ULong64_t &l)
Reads ULong64_t value from buffer.
virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion=kFALSE)
Suppressed function of TBuffer.
virtual void WriteStdString(const std::string &s)
Write a std::string.
virtual void WriteCharP(const Char_t *c)
Writes array of characters to buffer.
Abstract Interface class describing Streamer information for one class.
const Bool_t kTRUE
Definition: Rtypes.h:91
virtual Int_t CheckByteCount(UInt_t startpos, UInt_t bcnt, const TClass *clss)
Suppressed function of TBuffer.
Long64_t fFirstObjId
! id of first object to be read from the database
Definition: TBufferSQL2.h:55
TString fReadBuffer
! Buffer for read value
Definition: TBufferSQL2.h:46
void SetIgnoreVerification()
Definition: TBufferSQL2.h:129
TObject * obj
Long64_t fLastObjId
! id of last object correspond to this key
Definition: TBufferSQL2.h:56
float value
Definition: math.cpp:443
TObjArray * fObjectsInfos
! array of objects info for selected key
Definition: TBufferSQL2.h:54
virtual Int_t ApplySequenceVecPtr(const TStreamerInfoActions::TActionSequence &sequence, void *start_collection, void *end_collection)
Read one collection of objects from the buffer using the StreamerInfoLoopAction.
Bool_t fExpectedChain
! flag to resolve situation when several elements of same basic type stored as FastArray ...
Definition: TBufferSQL2.h:48
const Int_t n
Definition: legend1.C:16
virtual void WriteUInt(UInt_t i)
Writes UInt_t value to buffer.
TMap * fPoolsMap
! map of pools with data from different tables
Definition: TBufferSQL2.h:57
This class stores a (key,value) pair using an external hash.
Definition: TExMap.h:35
TSQLStructure * PopStack()
Pop stack.
void * SqlReadObjectDirect(void *obj, TClass **cl, Long64_t objid, TMemberStreamer *streamer=0, Int_t streamer_index=0, const TClass *onFileClass=0)
Read object data.
virtual Int_t ReadStaticArrayFloat16(Float_t *f, TStreamerElement *ele=0)
Read array of Float16_t from buffer.
virtual void ReadUChar(UChar_t &c)
Reads UChar_t value from buffer.
TSQLObjectData * fCurrentData
!
Definition: TBufferSQL2.h:53
const char * SqlReadValue(const char *tname)
Read string value from current stack node.
virtual void WriteFloat16(Float_t *f, TStreamerElement *ele=0)
Write Float16 value.
virtual void ReadFastArray(Bool_t *b, Int_t n)
Read array of Bool_t from buffer.
virtual Int_t ApplySequence(const TStreamerInfoActions::TActionSequence &sequence, void *object)
Read one collection of objects from the buffer using the StreamerInfoLoopAction.
virtual void ReadLong(Long_t &l)
Reads Long_t value from buffer.
virtual void SetStreamerElementNumber(TStreamerElement *elem, Int_t comp_type)
Function is called from TStreamerInfo WriteBuffer and Readbuffer functions and add/verify next elemen...
virtual void StreamObject(void *obj, const type_info &typeinfo, const TClass *onFileClass=0)
Stream object to/from buffer.
virtual void WriteChar(Char_t c)
Writes Char_t value to buffer.