55 #ifdef R__VISUAL_CPLUSPLUS
56 #define FLong64 "%I64d"
57 #define FULong64 "%I64u"
59 #define FLong64 "%lld"
60 #define FULong64 "%llu"
78 fReadVersionBuffer(-1),
80 fIgnoreVerification(
kFALSE),
103 fReadVersionBuffer(-1),
105 fIgnoreVerification(
kFALSE),
132 fReadVersionBuffer(-1),
134 fIgnoreVerification(
kFALSE),
194 std::cout <<
"==== Printout of Sql structures ===== " << std::endl;
196 std::cout <<
"=========== End printout ============ " << std::endl;
210 if (
fSQL==0)
return 0;
244 if ((shift>=0) && (shift<=fObjectsInfos->GetLast())) {
246 if (info->
GetObjId()!=objid) info = 0;
251 Info(
"SqlObjectInfo",
"Standard not works %lld", objid);
259 if (info==0)
return kFALSE;
292 if (
gDebug>4)
Info(
"SqlObjectData",
"After request res = 0x%lx",(
Long_t)alldata);
303 if (pool==0)
return 0;
306 Error(
"SqlObjectData",
"Missmatch in pools map !!! CANNOT BE !!!");
314 Error(
"SqlObjectData",
"Can not find row for objid = %lld in table %s", objid, sqlinfo->
GetClassTableName());
324 return new TSQLObjectData(sqlinfo, objid, classdata, classrow, blobdata, blobstmt);
346 std::cout <<
" SqlWriteObject " << obj <<
" : cl = " << (cl ? cl->
GetName() :
"null") << std::endl;
365 std::cout <<
" Find objectid = " << objid << std::endl;
383 (*streamer)(*
this, (
void*) obj, streamer_index);
385 ((
TClass*)cl)->Streamer((
void*)obj, *
this);
388 std::cout <<
"Done write of " << cl->
GetName() << std::endl;
407 if ((refid==0) || (strlen(refid)==0)) {
408 Error(
"SqlReadObject",
"Invalid object reference value");
414 sscanf(refid,
FLong64, &objid);
443 if ((
gDebug>3) && findptr)
444 std::cout <<
" Found pointer " << (obj ? obj : 0)
445 <<
" class = " << ((cl && *cl) ? (*cl)->GetName() :
"null") << std::endl;
454 Error(
"SqlReadObject",
"Object reference or pointer is not found in blob data");
461 if ((
gDebug>2) || (objid<0))
462 std::cout <<
"Found object reference " << objid << std::endl;
479 Info(
"SqlReadObjectDirect",
"objid = %lld clname = %s ver = %d",objid, clname.
Data(), version);
486 if ((objClass==0) || (sqlinfo==0)) {
487 Error(
"SqlReadObjectDirect",
"Class %s is not known", clname.
Data());
491 if (obj==0) obj = objClass->
New();
501 if (sqlinfo->IsClassTableExist()) {
521 Error(
"SqlReadObjectDirect",
"No found raw data for obj %lld in class %s version %d table", objid, clname.
Data(), version);
533 (*streamer)(*
this, (
void*)obj, streamer_index);
535 objClass->
Streamer((
void*)obj, *
this, onFileClass);
541 std::cout <<
"Read object of class " << objClass->
GetName() <<
" done" << std::endl << std::endl;
543 if (cl!=0) *cl = objClass;
563 std::cout <<
" IncrementLevel " << info->
GetName() << std::endl;
584 std::cout <<
" DecrementLevel " << info->
GetClass()->
GetName() << std::endl;
599 Error(
"SetStreamerElementNumber",
"Error in structures stack");
680 if (typeName==0) typeName =
name;
682 if ((name==0) || (strlen(name)==0)) {
683 Error(
"ClassMember",
"Invalid member name");
692 if (strcmp(typeName,
"raw:data")==0)
703 if (strcmp(name, typeName)==0) {
710 if (tname[tname.
Length()-1]==
'*') {
716 Error(
"ClassMember",
"Invalid class specifier %s", typeName);
745 if ((typ_id>0) && (typ_id<20)) {
772 Error(
"ClassMember",
"Invalid combination name = %s type = %s", name, typeName);
812 sobjid.
Form(
"%lld",objid);
817 Error(
"WorkWithClass",
"cannot define object id");
824 Error(
"WorkWithClass",
"Can not find table for class %s version %d", classname, classversion);
831 Error(
"WorkWithClass",
"Request error for data of object %lld for class %s version %d", objid, classname, classversion);
851 Info(
"WorkWithElement",
"elem = %s",elem->
GetName());
865 Error(
"WorkWithElement",
"Object data is lost");
875 Error(
"WorkWithElement",
"Cannot locate correct column in the table");
943 if (start) *start = 0;
950 std::cout <<
"TBufferSQL2::ReadVersion from buffer = " << res << std::endl;
960 Error(
"ReadVersion",
"No correspondent tags to read version");
975 std::cout <<
"TBufferSQL2::WriteVersion " << (cl ? cl->
GetName() :
"null") <<
" ver = " << (cl ? cl->
GetClassVersion() : 0) << std::endl;
1006 std::cout <<
"TBufferSQL2::WriteObject of class " << (actualClass ? actualClass->
GetName() :
" null") << std::endl;
1010 #define SQLReadArrayUncompress(vname, arrsize) \
1012 while(indx<arrsize) \
1013 SqlReadBasic(vname[indx++]); \
1017 #define SQLReadArrayCompress(vname, arrsize) \
1019 while(indx<arrsize) { \
1020 const char* name = fCurrentData->GetBlobPrefixName(); \
1021 Int_t first, last, res; \
1022 if (strstr(name,sqlio::IndexSepar)==0) { \
1023 res = sscanf(name,"[%d", &first); last = first; \
1024 } else res = sscanf(name,"[%d..%d", &first, &last); \
1025 if (gDebug>5) std::cout << name << " first = " << first << " last = " << last << " res = " << res << std::endl; \
1026 if ((first!=indx) || (last<first) || (last>=arrsize)) { \
1027 Error("SQLReadArrayCompress","Error reading array content %s", name); \
1031 SqlReadBasic(vname[indx]); indx++; \
1033 vname[indx++] = vname[first]; \
1039 #define SQLReadArrayContent(vname, arrsize, withsize) \
1041 if (gDebug>3) std::cout << "SQLReadArrayContent " << (arrsize) << std::endl; \
1042 PushStack()->SetArray(withsize ? arrsize : -1); \
1044 if (fCurrentData->IsBlobData()) \
1045 SQLReadArrayCompress(vname, arrsize) \
1047 SQLReadArrayUncompress(vname, arrsize) \
1049 if (gDebug>3) std::cout << "SQLReadArrayContent done " << std::endl; \
1053 #define TBufferSQL2_ReadArray(tname, vname) \
1055 Int_t n = SqlReadArraySize(); \
1056 if (n<=0) return 0; \
1057 if (!vname) vname = new tname[n]; \
1058 SQLReadArrayContent(vname, n, kTRUE); \
1255 #define TBufferSQL2_ReadStaticArray(vname) \
1257 Int_t n = SqlReadArraySize(); \
1258 if (n<=0) return 0; \
1259 if (!vname) return 0; \
1260 SQLReadArrayContent(vname, n, kTRUE); \
1386 #define TBufferSQL2_ReadFastArray(vname) \
1389 TStreamerElement* elem = Stack(0)->GetElement(); \
1390 if ((elem!=0) && (elem->GetType()>TStreamerInfo::kOffsetL) && \
1391 (elem->GetType()<TStreamerInfo::kOffsetP) && \
1392 (elem->GetArrayLength()!=n)) fExpectedChain = kTRUE; \
1393 if (fExpectedChain) { \
1394 fExpectedChain = kFALSE; \
1395 Int_t startnumber = Stack(0)->GetElementNumber(); \
1396 TStreamerInfo* info = Stack(1)->GetStreamerInfo(); \
1399 elem = (TStreamerElement*)info->GetElements()->At(startnumber++); \
1400 if (index>1) { PopStack(); WorkWithElement(elem, elem->GetType()); } \
1401 if (elem->GetType()<TStreamerInfo::kOffsetL) { \
1402 SqlReadBasic(vname[index]); \
1405 Int_t elemlen = elem->GetArrayLength(); \
1406 SQLReadArrayContent((vname+index), elemlen, kFALSE); \
1411 SQLReadArrayContent(vname, n, kFALSE); \
1431 if ((buf==0) || (n<=0))
return;
1432 Int_t size = strlen(buf);
1433 if (size<n) size =
n;
1434 memcpy(c, buf, size);
1585 Info(
"ReadFastArray",
"(void *");
1593 int objectSize = cl->
Size();
1594 char *
obj = (
char*)start;
1595 char *end = obj + n*objectSize;
1597 for(; obj<end; obj+=objectSize) {
1612 Info(
"ReadFastArray",
"(void ** pre = %d n = %d", isPreAlloc, n);
1616 for (
Int_t j=0;j<
n;j++) {
1617 if (!start[j]) start[j] = ((
TClass*)cl)->New();
1620 StreamObject((
void*)start, streamer, cl, 0, onFileClass);
1627 for (
Int_t j=0; j<
n; j++){
1635 for (
Int_t j=0; j<
n; j++) {
1636 if (!start[j]) start[j] = ((
TClass*)cl)->New();
1642 Info(
"ReadFastArray",
"(void ** Done" );
1654 if ((value==0) || (strlen(value)==0))
return 0;
1655 Int_t sz = atoi(value);
1660 #define SQLWriteArrayNoncompress(vname, arrsize) \
1662 for(Int_t indx=0;indx<arrsize;indx++) { \
1663 SqlWriteBasic(vname[indx]); \
1664 Stack()->ChildArrayIndex(indx, 1); \
1669 #define SQLWriteArrayCompress(vname, arrsize) \
1672 while(indx<arrsize) { \
1673 Int_t curr = indx; indx++; \
1674 while ((indx<arrsize) && (vname[indx]==vname[curr])) indx++; \
1675 SqlWriteBasic(vname[curr]); \
1676 Stack()->ChildArrayIndex(curr, indx-curr); \
1680 #define SQLWriteArrayContent(vname, arrsize, withsize) \
1682 PushStack()->SetArray(withsize ? arrsize : -1); \
1683 if (fCompressLevel>0) { \
1684 SQLWriteArrayCompress(vname, arrsize) \
1686 SQLWriteArrayNoncompress(vname, arrsize) \
1692 #define TBufferSQL2_WriteArray(vname) \
1694 SQLWriteArrayContent(vname, n, kTRUE); \
1819 #define TBufferSQL2_WriteFastArray(vname) \
1822 TStreamerElement* elem = Stack(0)->GetElement(); \
1823 if ((elem!=0) && (elem->GetType()>TStreamerInfo::kOffsetL) && \
1824 (elem->GetType()<TStreamerInfo::kOffsetP) && \
1825 (elem->GetArrayLength()!=n)) fExpectedChain = kTRUE; \
1826 if (fExpectedChain) { \
1827 TStreamerInfo* info = Stack(1)->GetStreamerInfo(); \
1828 Int_t startnumber = Stack(0)->GetElementNumber(); \
1831 elem = (TStreamerElement*)info->GetElements()->At(startnumber++); \
1832 if (index>0) { PopStack(); WorkWithElement(elem, elem->GetType()); } \
1833 if (elem->GetType()<TStreamerInfo::kOffsetL) { \
1834 SqlWriteBasic(vname[index]); \
1837 Int_t elemlen = elem->GetArrayLength(); \
1838 SQLWriteArrayContent((vname+index), elemlen, kFALSE); \
1841 fExpectedChain = kFALSE; \
1844 SQLWriteArrayContent(vname, n, kFALSE); \
1867 for (
int i=0;i<
n;i++)
1868 if (*ccc++==0) { usedefault =
kTRUE;
break; }
1999 char *
obj = (
char*)start;
2001 int size = cl->
Size();
2003 for(
Int_t j=0; j<
n; j++,obj+=size)
2029 for (
Int_t j=0;j<
n;j++) {
2039 for (
Int_t j=0;j<
n;j++) {
2040 if (!start[j]) start[j] = ((
TClass*)cl)->New();
2072 std::cout <<
" TBufferSQL2::StreamObject class = " << (cl ? cl->
GetName() :
"none") << std::endl;
2092 if (streamer==0)
return;
2095 std::cout <<
"Stream object of class = " << cl->
GetName() << std::endl;
2105 #define TBufferSQL2_operatorin(vname) \
2107 SqlReadBasic(vname); \
2220 if (buf) strcpy(c, buf);
2256 #define TBufferSQL2_operatorout(vname) \
2258 SqlWriteBasic(vname); \
2379 snprintf(buf,
sizeof(buf),
"%d", value);
2389 snprintf(buf,
sizeof(buf),
"%hd", value);
2399 snprintf(buf,
sizeof(buf),
"%d", value);
2409 snprintf(buf,
sizeof(buf),
"%ld", value);
2419 snprintf(buf,
sizeof(buf),
"%lld", value);
2457 snprintf(buf,
sizeof(buf),
"%u", value);
2467 snprintf(buf,
sizeof(buf),
"%hu", value);
2477 snprintf(buf,
sizeof(buf),
"%u", value);
2487 snprintf(buf,
sizeof(buf),
"%lu", value);
2497 snprintf(buf,
sizeof(buf),
FULong64, value);
2520 sscanf(res,
"%d", &n);
2533 sscanf(res,
"%hd", &value);
2545 sscanf(res,
"%d", &value);
2557 sscanf(res,
"%ld", &value);
2581 sscanf(res,
"%f", &value);
2593 sscanf(res,
"%lf", &value);
2618 sscanf(res,
"%ud", &n);
2631 sscanf(res,
"%hud", &value);
2643 sscanf(res,
"%u", &value);
2655 sscanf(res,
"%lu", &value);
2680 Error(
"SqlReadValue",
"No object data to read from");
2696 std::cout <<
" SqlReadValue " << tname <<
" = " <<
fReadBuffer << std::endl;
2707 if ((res==0) || (
fSQL==0))
return 0;
2712 if (strid<=0)
return res;
2741 if (
fStk==0)
return 0;
2752 while ((depth-->0) && (curr!=0)) curr = curr->
GetParent();
2786 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
2787 for(TStreamerInfoActions::ActionContainer_t::const_iterator
iter = sequence.
fActions.begin();
2792 (*iter).PrintDebug(*
this,obj);
2798 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
2799 for(TStreamerInfoActions::ActionContainer_t::const_iterator
iter = sequence.
fActions.begin();
2823 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
2824 for(TStreamerInfoActions::ActionContainer_t::const_iterator
iter = sequence.
fActions.begin();
2829 (*iter).PrintDebug(*
this,*(
char**)start_collection);
2830 (*iter)(*
this,start_collection,end_collection);
2835 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
2836 for(TStreamerInfoActions::ActionContainer_t::const_iterator
iter = sequence.
fActions.begin();
2841 (*iter)(*
this,start_collection,end_collection);
2863 void *arr0 = loopconfig->
GetFirstAddress(start_collection,end_collection);
2865 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
2866 for(TStreamerInfoActions::ActionContainer_t::const_iterator
iter = sequence.
fActions.begin();
2871 (*iter).PrintDebug(*
this,arr0);
2872 (*iter)(*
this,start_collection,end_collection,loopconfig);
2877 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
2878 for(TStreamerInfoActions::ActionContainer_t::const_iterator
iter = sequence.
fActions.begin();
2883 (*iter)(*
this,start_collection,end_collection,loopconfig);
Describe Streamer information for one class version.
virtual void IncrementLevel(TVirtualStreamerInfo *)
Function is called from TStreamerInfo WriteBuffer and Readbuffer functions and indent new level in da...
TSQLResult * GetBlobClassData(Long64_t objid, TSQLClassInfo *sqlinfo)
Method return request results for specified objid from streamer classtable.
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.
static Bool_t CanDelete()
static function returning true if ReadBuffer can delete object
virtual void ReadFloat(Float_t &f)
Reads Float_t value from buffer.
void Add(ULong64_t hash, Long64_t key, Long64_t value)
Add an (key,value) pair to the table. The key should be unique.
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...
#define TBufferSQL2_ReadStaticArray(vname)
The concrete implementation of TBuffer for writing/reading to/from a ROOT file or socket...
Info (classname, version) about object in database.
ActionContainer_t fActions
TStreamerInfo * GetStreamerInfo() const
return TStreamerInfo* if type is kSqlStreamerInfo
TSQLResult * GetClassData() const
void ShiftToNextValue()
shift to next column or next row in blob data
TSQLResult * GetNormalClassDataAll(Long64_t minobjid, Long64_t maxobjid, TSQLClassInfo *sqlinfo)
Return data for several objects from the range from normal class table.
virtual TClass * GetClass() const =0
TLoopConfiguration * fLoopConfig
If this is a bundle of memberwise streaming action, this configures the looping.
virtual void ClassBegin(const TClass *, Version_t=-1)
This method inform buffer data of which class now will be streamed.
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
Int_t GetLast() const
Return index of last object in array.
Version_t GetObjVersion() const
void AddValue(const char *value, const char *tname=0)
Add child structure as value.
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 Delete(Option_t *option="")
Remove all objects from the array AND delete all heap based objects.
#define TBufferSQL2_WriteFastArray(vname)
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 ...
TSQLStructure * GetParent() const
virtual void ReadTString(TString &s)
Read TString from TBuffer.
virtual void ReadFastArrayWithNbits(Float_t *ptr, Int_t n, Int_t nbits)
Read array of Float16_t from buffer.
Bool_t IsClassTableExist() const
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
virtual void ReadFloat16(Float_t *f, TStreamerElement *ele=0)
Read Float16 value.
virtual void SkipVersion(const TClass *cl=0)
Skip class version from I/O buffer.
void Add(TObject *obj)
This function may not be used (but we need to provide it since it is a pure virtual in TCollection)...
Int_t IsLongStringCode(Long64_t objid, const char *value)
Checks if this is long string code returns 0, if not or string id.
Contains information about tables specific to one class and version.
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.
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.
#define TBufferSQL2_WriteArray(vname)
Int_t fErrorFlag
! Error id value
TSQLStructure * fStructure
! structures, created by object storing
void SetParent(TObject *parent)
Set parent owning this buffer.
void SetObjectRef(Long64_t refid, const TClass *cl)
set structure type as kSqlObject
#define TBufferSQL2_ReadArray(tname, vname)
TSQLObjectData * SqlObjectData(Long64_t objid, TSQLClassInfo *sqlinfo)
Creates TSQLObjectData for specifed object id and specified class.
Type GetType(const std::string &Name)
virtual void SetArrayDim(Int_t dim)
Set number of array dimensions.
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.
virtual void SetMaxIndex(Int_t dim, Int_t max)
set maximum index for array with dimension dim
Bool_t fIgnoreVerification
! ignore verification of names
Int_t fReadVersionBuffer
! buffer, used to by ReadVersion method
static const char * GetFloatFormat()
return current printf format for float/double members, default "%e"
TSQLStructure * PushStack()
Push stack with structurual information about streamed object.
void SetStreamerInfo(const TStreamerInfo *info)
set structure type as kSqlStreamerInfo
TSQLObjectData is used in TBufferSQL2 class in reading procedure.
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
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.
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.
const char * Data() const
void Add(TSQLStructure *child)
Add child strucure.
virtual void WriteDouble(Double_t d)
Writes Double_t value to buffer.
virtual Int_t GetClassVersion() const =0
static Bool_t UnpackTObject(TSQLFile *f, TBufferSQL2 *buf, TSQLObjectData *data, Long64_t objid, Int_t clversion)
Unpack TObject data in form, understodable by custom TObject streamer.
virtual void * GetFirstAddress(void *start, const void *end) const =0
void SetStreamerElement(const TStreamerElement *elem, Int_t number)
set structure type as kSqlElement
Int_t GetCompressionLevel() const
TSQLFile * fSQL
! instance of TSQLFile
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
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.
std::map< std::string, std::string >::const_iterator iter
This is hierarhical structure, which is created when data is written by TBufferSQL2.
TSQLClassInfo * GetSqlInfo() const
const char * GetBlobPrefixName() const
virtual void WriteUShort(UShort_t s)
Writes UShort_t value to buffer.
TObject * GetValue(const char *keyname) const
Returns a pointer to the value associated with keyname as name of the key.
Int_t Atoi() const
Return integer value of string.
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Base class of the Configurations for the member wise looping routines.
virtual void WriteClass(const TClass *cl)
Suppressed function of TBuffer.
virtual void WriteTString(const TString &s)
Write a TString.
Bool_t GetLongString(Long64_t objid, Int_t strid, TString &value)
Returns value of string, extracted from special table, where long strings are stored.
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.
Int_t LocateElementColumn(TSQLFile *f, TBufferSQL2 *buf, TSQLObjectData *data)
find column in TSQLObjectData object, which correspond to current element
virtual void WriteTString(const TString &s)
Write TString to TBuffer.
virtual Int_t ReadStaticArrayDouble32(Double_t *d, TStreamerElement *ele=0)
Read array of Double32_t from buffer.
TBufferSQL2()
Default constructor, should not be used.
static const char * GetFloatFormat()
return current printf format for float/double members, default "%e" return format, hold by TSQLServer
static Bool_t UnpackTString(TSQLFile *f, TBufferSQL2 *buf, TSQLObjectData *data, Long64_t objid, Int_t clversion)
Unpack TString data in form, understodable by custom TString streamer.
virtual void ReadCharP(Char_t *c)
Reads array of characters from buffer.
TSQLObjectData * GetObjectData(Bool_t search=false)
searchs for objects data
virtual void WriteArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=0)
Write array of Double32_t to buffer.
Int_t IndexOf(const TObject *obj) const
Long64_t GetValue(ULong64_t hash, Long64_t key)
Return the value belonging to specified key and hash value.
TObjArray * GetElements() const
Access an SQL db via the TFile interface.
const char * GetObjClassName() const
void SetCustomClass(const TClass *cl, Version_t version)
set structure type as kSqlCustomClass
Basic data type descriptor (datatype information is obtained from CINT).
virtual void WriteLong(Long_t l)
Writes Long_t value to buffer.
virtual void ReadStdString(std::string &s)
Read std::string from TBuffer.
TSQLStructure * fStk
! pointer on current active structure (stack head)
void ChangeValueOnly(const char *value)
change value of this structure used as "workaround" to keep object id in kSqlElement node ...
TSQLClassInfo * FindSQLClassInfo(const char *clname, Int_t version)
Return (if exists) TSQLClassInfo for specified class name and version.
virtual Int_t ReadArrayFloat16(Float_t *&f, TStreamerElement *ele=0)
Read array of Float16_t from buffer.
TSQLStatement * GetBlobClassDataStmt(Long64_t objid, TSQLClassInfo *sqlinfo)
Method return request results for specified objid from streamer classtable Data returned in form of s...
Bool_t VerifyDataType(const char *tname, Bool_t errormsg=kTRUE)
checks if data type corresponds to that stored in raw table
static void SetFloatFormat(const char *fmt="%e")
set printf format for float/double members, default "%e"
virtual Int_t ReadArrayDouble32(Double_t *&d, TStreamerElement *ele=0)
Read array of Double32_t from buffer.
void Form(const char *fmt,...)
Formats a string using a printf style format descriptor.
TSQLStructure * Stack(Int_t depth=0)
returns head of stack
virtual const char * GetName() const
Returns name of object.
TObjArray * SQLObjectsInfo(Long64_t keyid)
Produce array of TSQLObjectInfo objects for all objects, belong to that key Array should be deleted b...
The ROOT global object gROOT contains a list of all defined classes.
void AddObjectData(TSQLObjectData *objdata)
add element with pointer to object data
virtual void WriteArray(const Bool_t *b, Int_t n)
Write array of Bool_t to buffer.
Bool_t IsBlobData() const
Version_t GetClassVersion() const
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.
TSQLRow * GetObjectRow(Long64_t objid)
Returns single sql row with object data for that class.
virtual void ClassEnd(const TClass *)
Method indicates end of streaming of classdata in custom streamer.
void DeleteValues()
Remove all (key,value) pairs from the map AND delete the values when they are allocated on the heap...
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 ...
void SetCustomElement(TStreamerElement *elem)
set structure type as kSqlCustomElement
Bool_t PrepareForRawData()
prepare to read data from raw table
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.
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...
void SqlReadBasic(Char_t &value)
Read current value from table and convert it to Char_t value.
void SetObjectPointer(Long64_t ptrid)
set structure type as kSqlPointer
void AddVersion(const TClass *cl, Int_t version=-100)
add child as version
const char * GetLocatedField() const
const char * GetValue() const
Long64_t GetObjId() const
const char * GetClassTableName() const
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
unsigned long long ULong64_t
const char * SqlReadCharStarValue()
Read CharStar value, if it has special code, request it from large table.
Bool_t SqlWriteValue(const char *value, const char *tname)
TStreamerElement * GetElement() const
return TStremerElement* if type is kSqlElement
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.
virtual void ForceWriteInfo(TVirtualStreamerInfo *info, Bool_t force)
force writing the TStreamerInfo to the file
virtual void WriteObject(const TObject *obj)
Write object to I/O buffer.
void SetCompressionLevel(int level)
static TClass * GetClass(const char *name, Bool_t load=kTRUE, Bool_t silent=kFALSE)
Static method returning pointer to TClass of the specified class name.
virtual void WriteDouble32(Double_t *d, TStreamerElement *ele=0)
Write Double32 value.
virtual void ReadChar(Char_t &c)
Reads Char_t value from buffer.
virtual void WriteInt(Int_t i)
Writes Int_t value to buffer.
Mother of all ROOT objects.
#define TBufferSQL2_operatorin(vname)
TObject * Last() const
Return the object in the last filled slot. Returns 0 if no entries.
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.
Long64_t DefineObjectId(Bool_t recursive=kTRUE)
defines current object id, to which this structure belong make life complicated, because some objects...
virtual void ReadShort(Short_t &s)
Reads Short_t value from buffer.
virtual void WriteStdString(const std::string &s)
Write std::string to TBuffer.
Long64_t fObjIdCounter
! counter of objects id
virtual Int_t WriteObjectAny(const void *obj, const TClass *ptrClass)
Write object to I/O buffer.
virtual void * ReadObjectAny(const TClass *clCast)
Read object from buffer. Only used from TBuffer.
#define TBufferSQL2_operatorout(vname)
#define TBufferSQL2_ReadFastArray(vname)
void SetBaseVersion(Int_t v)
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 ...
friend class TSQLStructure
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.
TObject * At(Int_t idx) const
virtual void SetByteCount(UInt_t cntpos, Bool_t packInVersion=kFALSE)
Suppressed function of TBuffer.
void Streamer(void *obj, TBuffer &b, const TClass *onfile_class=0) const
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.
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
TString fReadBuffer
! Buffer for read value
Long64_t fLastObjId
! id of last object correspond to this key
TObjArray * fObjectsInfos
! array of objects info for selected key
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 ...
virtual void Print(Option_t *option="") const
print content of complete structure
virtual void WriteUInt(UInt_t i)
Writes UInt_t value to buffer.
TMap * fPoolsMap
! map of pools with data from different tables
virtual void SetOnFileClass(const TClass *cl)
Int_t Size() const
Return size of object of this class.
This class stores a (key,value) pair using an external hash.
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
!
const char * SqlReadValue(const char *tname)
Read string value from current stack node.
void Resize(Ssiz_t n)
Resize the string. Truncate or add blanks as necessary.
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.
TVirtualStreamerInfo * fStreamerInfo
StreamerInfo used to derive these actions.
UInt_t Hash(ECaseCompare cmp=kExact) const
Return hash value.