55 #ifdef R__VISUAL_CPLUSPLUS 56 #define FLong64 "%I64d" 57 #define FULong64 "%I64u" 59 #define FLong64 "%lld" 60 #define FULong64 "%llu" 69 :
TBufferFile(), fSQL(0), fStructure(0), fStk(0), fObjMap(0), fReadBuffer(), fErrorFlag(0), fExpectedChain(
kFALSE),
70 fCompressLevel(0), fReadVersionBuffer(-1), fObjIdCounter(1), fIgnoreVerification(
kFALSE), fCurrentData(0),
71 fObjectsInfos(0), fFirstObjId(0), fLastObjId(0), fPoolsMap(0)
153 std::cout <<
"==== Printout of Sql structures ===== " << std::endl;
155 std::cout <<
"=========== End printout ============ " << std::endl;
207 if ((shift >= 0) && (shift <= fObjectsInfos->GetLast())) {
215 Info(
"SqlObjectInfo",
"Standard not works %lld", objid);
259 Info(
"SqlObjectData",
"After request res = 0x%lx", (
Long_t)alldata);
275 Error(
"SqlObjectData",
"Missmatch in pools map !!! CANNOT BE !!!");
283 Error(
"SqlObjectData",
"Can not find row for objid = %lld in table %s", objid, sqlinfo->
GetClassTableName());
294 return new TSQLObjectData(sqlinfo, objid, classdata, classrow, blobdata, blobstmt);
305 std::cout <<
" SqlWriteObject " << obj <<
" : cl = " << (cl ? cl->
GetName() :
"null") << std::endl;
324 std::cout <<
" Find objectid = " << objid << std::endl;
345 (*streamer)(*
this, (
void *)obj, streamer_index);
347 ((
TClass *)cl)->Streamer((
void *)obj, *
this);
350 std::cout <<
"Done write of " << cl->
GetName() << std::endl;
361 const TClass *onFileClass)
372 if ((refid == 0) || (strlen(refid) == 0)) {
373 Error(
"SqlReadObject",
"Invalid object reference value");
379 sscanf(refid,
FLong64, &objid);
407 if ((
gDebug > 3) && findptr)
408 std::cout <<
" Found pointer " << (obj ? obj : 0) <<
" class = " << ((cl && *cl) ? (*cl)->GetName() :
"null")
418 Error(
"SqlReadObject",
"Object reference or pointer is not found in blob data");
425 if ((
gDebug > 2) || (objid < 0))
426 std::cout <<
"Found object reference " << objid << std::endl;
445 Info(
"SqlReadObjectDirect",
"objid = %lld clname = %s ver = %d", objid, clname.
Data(), version);
453 if ((objClass == 0) || (sqlinfo == 0)) {
454 Error(
"SqlReadObjectDirect",
"Class %s is not known", clname.
Data());
459 obj = objClass->
New();
470 if (sqlinfo->IsClassTableExist()) {
489 Error(
"SqlReadObjectDirect",
"No found raw data for obj %lld in class %s version %d table", objid,
490 clname.
Data(), version);
502 (*streamer)(*
this, (
void *)obj, streamer_index);
504 objClass->
Streamer((
void *)obj, *
this, onFileClass);
510 std::cout <<
"Read object of class " << objClass->
GetName() <<
" done" << std::endl << std::endl;
534 std::cout <<
" IncrementLevel " << info->
GetName() << std::endl;
556 std::cout <<
" DecrementLevel " << info->
GetClass()->
GetName() << std::endl;
566 if (
Stack()->GetElement())
572 Error(
"SetStreamerElementNumber",
"Error in structures stack");
617 if (classversion < 0)
659 if ((name == 0) || (strlen(name) == 0)) {
660 Error(
"ClassMember",
"Invalid member name");
669 if (strcmp(typeName,
"raw:data") == 0)
680 if (strcmp(name, typeName) == 0) {
688 if (tname[tname.
Length() - 1] ==
'*') {
694 Error(
"ClassMember",
"Invalid class specifier %s", typeName);
723 if ((typ_id > 0) && (typ_id < 20)) {
749 Error(
"ClassMember",
"Invalid combination name = %s type = %s", name, typeName);
790 sobjid.
Form(
"%lld", objid);
795 Error(
"WorkWithClass",
"cannot define object id");
802 Error(
"WorkWithClass",
"Can not find table for class %s version %d", classname, classversion);
809 Error(
"WorkWithClass",
"Request error for data of object %lld for class %s version %d", objid, classname,
830 Info(
"WorkWithElement",
"elem = %s", elem->
GetName());
844 Error(
"WorkWithElement",
"Object data is lost");
854 Error(
"WorkWithElement",
"Cannot locate correct column in the table");
929 std::cout <<
"TBufferSQL2::ReadVersion from buffer = " << res << std::endl;
938 Error(
"ReadVersion",
"No correspondent tags to read version");
953 std::cout <<
"TBufferSQL2::WriteVersion " << (cl ? cl->
GetName() :
"null")
985 std::cout <<
"TBufferSQL2::WriteObject of class " << (actualClass ? actualClass->
GetName() :
" null")
990 #define SQLReadArrayUncompress(vname, arrsize) \ 992 while (indx < arrsize) \ 993 SqlReadBasic(vname[indx++]); \ 996 #define SQLReadArrayCompress(vname, arrsize) \ 998 while (indx < arrsize) { \ 999 const char *name = fCurrentData->GetBlobPrefixName(); \ 1000 Int_t first, last, res; \ 1001 if (strstr(name, sqlio::IndexSepar) == 0) { \ 1002 res = sscanf(name, "[%d", &first); \ 1005 res = sscanf(name, "[%d..%d", &first, &last); \ 1007 std::cout << name << " first = " << first << " last = " << last << " res = " << res << std::endl; \ 1008 if ((first != indx) || (last < first) || (last >= arrsize)) { \ 1009 Error("SQLReadArrayCompress", "Error reading array content %s", name); \ 1013 SqlReadBasic(vname[indx]); \ 1015 while (indx <= last) \ 1016 vname[indx++] = vname[first]; \ 1021 #define SQLReadArrayContent(vname, arrsize, withsize) \ 1024 std::cout << "SQLReadArrayContent " << (arrsize) << std::endl; \ 1025 PushStack()->SetArray(withsize ? arrsize : -1); \ 1027 if (fCurrentData->IsBlobData()) \ 1028 SQLReadArrayCompress(vname, arrsize) else SQLReadArrayUncompress(vname, arrsize) PopStack(); \ 1030 std::cout << "SQLReadArrayContent done " << std::endl; \ 1034 #define TBufferSQL2_ReadArray(tname, vname) \ 1036 Int_t n = SqlReadArraySize(); \ 1040 vname = new tname[n]; \ 1041 SQLReadArrayContent(vname, n, kTRUE); \ 1238 #define TBufferSQL2_ReadStaticArray(vname) \ 1240 Int_t n = SqlReadArraySize(); \ 1245 SQLReadArrayContent(vname, n, kTRUE); \ 1371 #define TBufferSQL2_ReadFastArray(vname) \ 1375 TStreamerElement *elem = Stack(0)->GetElement(); \ 1376 if ((elem != 0) && (elem->GetType() > TStreamerInfo::kOffsetL) && (elem->GetType() < TStreamerInfo::kOffsetP) && \ 1377 (elem->GetArrayLength() != n)) \ 1378 fExpectedChain = kTRUE; \ 1379 if (fExpectedChain) { \ 1380 fExpectedChain = kFALSE; \ 1381 Int_t startnumber = Stack(0)->GetElementNumber(); \ 1382 TStreamerInfo *info = Stack(1)->GetStreamerInfo(); \ 1384 while (index < n) { \ 1385 elem = (TStreamerElement *)info->GetElements()->At(startnumber++); \ 1388 WorkWithElement(elem, elem->GetType()); \ 1390 if (elem->GetType() < TStreamerInfo::kOffsetL) { \ 1391 SqlReadBasic(vname[index]); \ 1394 Int_t elemlen = elem->GetArrayLength(); \ 1395 SQLReadArrayContent((vname + index), elemlen, kFALSE); \ 1400 SQLReadArrayContent(vname, n, kFALSE); \ 1419 if ((buf == 0) || (n <= 0))
1421 Int_t size = strlen(buf);
1424 memcpy(c, buf, size);
1573 const TClass *onFileClass)
1576 Info(
"ReadFastArray",
"(void *");
1584 int objectSize = cl->
Size();
1585 char *obj = (
char *)start;
1586 char *end = obj + n * objectSize;
1588 for (; obj < end; obj += objectSize) {
1601 const TClass *onFileClass)
1604 Info(
"ReadFastArray",
"(void ** pre = %d n = %d", isPreAlloc, n);
1608 for (
Int_t j = 0; j <
n; j++) {
1610 start[j] = ((
TClass *)cl)->New();
1613 StreamObject((
void *)start, streamer, cl, 0, onFileClass);
1620 for (
Int_t j = 0; j <
n; j++) {
1629 for (
Int_t j = 0; j <
n; j++) {
1631 start[j] = ((
TClass *)cl)->New();
1637 Info(
"ReadFastArray",
"(void ** Done");
1649 if ((value == 0) || (strlen(value) == 0))
1651 Int_t sz = atoi(value);
1656 #define SQLWriteArrayNoncompress(vname, arrsize) \ 1658 for (Int_t indx = 0; indx < arrsize; indx++) { \ 1659 SqlWriteBasic(vname[indx]); \ 1660 Stack()->ChildArrayIndex(indx, 1); \ 1665 #define SQLWriteArrayCompress(vname, arrsize) \ 1668 while (indx < arrsize) { \ 1669 Int_t curr = indx; \ 1671 while ((indx < arrsize) && (vname[indx] == vname[curr])) \ 1673 SqlWriteBasic(vname[curr]); \ 1674 Stack()->ChildArrayIndex(curr, indx - curr); \ 1678 #define SQLWriteArrayContent(vname, arrsize, withsize) \ 1680 PushStack()->SetArray(withsize ? arrsize : -1); \ 1681 if (fCompressLevel > 0) { \ 1682 SQLWriteArrayCompress(vname, arrsize) \ 1684 SQLWriteArrayNoncompress(vname, arrsize) \ 1690 #define TBufferSQL2_WriteArray(vname) \ 1692 SQLWriteArrayContent(vname, n, kTRUE); \ 1817 #define TBufferSQL2_WriteFastArray(vname) \ 1821 TStreamerElement *elem = Stack(0)->GetElement(); \ 1822 if ((elem != 0) && (elem->GetType() > TStreamerInfo::kOffsetL) && (elem->GetType() < TStreamerInfo::kOffsetP) && \ 1823 (elem->GetArrayLength() != n)) \ 1824 fExpectedChain = kTRUE; \ 1825 if (fExpectedChain) { \ 1826 TStreamerInfo *info = Stack(1)->GetStreamerInfo(); \ 1827 Int_t startnumber = Stack(0)->GetElementNumber(); \ 1829 while (index < n) { \ 1830 elem = (TStreamerElement *)info->GetElements()->At(startnumber++); \ 1833 WorkWithElement(elem, elem->GetType()); \ 1835 if (elem->GetType() < TStreamerInfo::kOffsetL) { \ 1836 SqlWriteBasic(vname[index]); \ 1839 Int_t elemlen = elem->GetArrayLength(); \ 1840 SQLWriteArrayContent((vname + index), elemlen, kFALSE); \ 1843 fExpectedChain = kFALSE; \ 1846 SQLWriteArrayContent(vname, n, kFALSE); \ 1869 for (
int i = 0; i <
n; i++)
2004 char *obj = (
char *)start;
2007 int size = cl->
Size();
2009 for (
Int_t j = 0; j <
n; j++, obj += size)
2035 for (
Int_t j = 0; j <
n; j++) {
2037 if (!strInfo && !start[j])
2046 for (
Int_t j = 0; j <
n; j++) {
2048 start[j] = ((
TClass *)cl)->New();
2079 std::cout <<
" TBufferSQL2::StreamObject class = " << (cl ? cl->
GetName() :
"none") << std::endl;
2098 const TClass *onFileClass)
2104 std::cout <<
"Stream object of class = " << cl->
GetName() << std::endl;
2114 #define TBufferSQL2_operatorin(vname) \ 2116 SqlReadBasic(vname); \ 2282 #define TBufferSQL2_operatorout(vname) \ 2284 SqlWriteBasic(vname); \ 2405 snprintf(buf,
sizeof(buf),
"%d", value);
2415 snprintf(buf,
sizeof(buf),
"%hd", value);
2425 snprintf(buf,
sizeof(buf),
"%d", value);
2435 snprintf(buf,
sizeof(buf),
"%ld", value);
2445 snprintf(buf,
sizeof(buf),
"%lld", value);
2483 snprintf(buf,
sizeof(buf),
"%u", value);
2493 snprintf(buf,
sizeof(buf),
"%hu", value);
2503 snprintf(buf,
sizeof(buf),
"%u", value);
2513 snprintf(buf,
sizeof(buf),
"%lu", value);
2546 sscanf(res,
"%d", &n);
2559 sscanf(res,
"%hd", &value);
2571 sscanf(res,
"%d", &value);
2583 sscanf(res,
"%ld", &value);
2607 sscanf(res,
"%f", &value);
2619 sscanf(res,
"%lf", &value);
2644 sscanf(res,
"%ud", &n);
2657 sscanf(res,
"%hud", &value);
2669 sscanf(res,
"%u", &value);
2681 sscanf(res,
"%lu", &value);
2707 Error(
"SqlReadValue",
"No object data to read from");
2723 std::cout <<
" SqlReadValue " << tname <<
" = " <<
fReadBuffer << std::endl;
2734 if ((res == 0) || (
fSQL == 0))
2781 while ((depth-- > 0) && (curr != 0))
2815 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
2816 for (TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin(); iter != end;
2820 (*iter).PrintDebug(*
this, obj);
2821 (*iter)(*
this, obj);
2826 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
2827 for (TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin(); iter != end;
2831 (*iter)(*
this, obj);
2844 void *end_collection)
2851 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
2852 for (TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin(); iter != end;
2857 *
this, *(
char **)start_collection);
2858 (*iter)(*
this, start_collection, end_collection);
2863 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
2864 for (TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin(); iter != end;
2868 (*iter)(*
this, start_collection, end_collection);
2880 void *end_collection)
2891 void *arr0 = loopconfig->
GetFirstAddress(start_collection, end_collection);
2893 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
2894 for (TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin(); iter != end;
2898 (*iter).PrintDebug(*
this, arr0);
2899 (*iter)(*
this, start_collection, end_collection, loopconfig);
2904 TStreamerInfoActions::ActionContainer_t::const_iterator end = sequence.
fActions.end();
2905 for (TStreamerInfoActions::ActionContainer_t::const_iterator iter = sequence.
fActions.begin(); iter != end;
2909 (*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...
virtual const char * GetName() const
Returns name of object.
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)
virtual void Info(const char *method, const char *msgfmt,...) const
Issue info message.
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
void ShiftToNextValue()
shift to next column or next row in blob data
const char * GetValue() const
TSQLResult * GetNormalClassDataAll(Long64_t minobjid, Long64_t maxobjid, TSQLClassInfo *sqlinfo)
Return data for several objects from the range from normal class table.
const char * GetObjClassName() const
const char * GetClassTableName() const
virtual void WriteCharStar(char *s)
Write a char* string.
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
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.
static void SetFloatFormat(const char *fmt="%e")
set printf format for float/double members, default "%e" changes global TSQLServer variable ...
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.
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
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 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.
virtual void WriteCharStar(char *s)
Write char* into TBuffer.
#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 specified 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.
TObject * At(Int_t idx) const
virtual void WriteUChar(UChar_t c)
Writes UChar_t value to buffer.
Bool_t IsBlobData() const
Int_t SqlWriteObject(const void *obj, const TClass *objClass, Bool_t cacheReuse, TMemberStreamer *streamer=0, Int_t streamer_index=0)
Write object 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.
virtual void WriteStdString(const std::string *s)
Write a std::string.
void SetStreamerInfo(const TStreamerInfo *info)
set structure type as kSqlStreamerInfo
TSQLObjectData is used in TBufferSQL2 class in reading procedure.
UInt_t Hash(ECaseCompare cmp=kExact) const
Return hash value.
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.
void Add(TSQLStructure *child)
Add child structure.
virtual void WriteDouble(Double_t d)
Writes Double_t value to buffer.
TObject * Last() const
Return the object in the last filled slot. Returns 0 if no entries.
static Bool_t UnpackTObject(TSQLFile *f, TBufferSQL2 *buf, TSQLObjectData *data, Long64_t objid, Int_t clversion)
Unpack TObject data in form, accepted 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
virtual void ReadCharStar(char *&s)
Read char* from TBuffer.
TSQLFile * fSQL
! instance of TSQLFile
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.
virtual void WriteStdString(const std::string *s)
Write std::string to TBuffer.
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 hierarchical structure, which is created when data is written by TBufferSQL2.
virtual void WriteUShort(UShort_t s)
Writes UShort_t value to buffer.
virtual void Print(Option_t *option="") const
print content of complete structure
Bool_t IsClassTableExist() const
virtual void WriteObjectClass(const void *actualObjStart, const TClass *actualClass, Bool_t cacheReuse)
Write object to buffer. Only used from TBuffer.
TStreamerElement * GetElement() const
return TStremerElement* if type is kSqlElement
virtual void ReadStdString(std::string *s)
Read std::string from TBuffer.
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, accepted by custom TString streamer.
virtual void ReadCharP(Char_t *c)
Reads array of characters from buffer.
virtual void StreamObject(void *obj, const std::type_info &typeinfo, const TClass *onFileClass=0)
Stream object to/from buffer.
TSQLObjectData * GetObjectData(Bool_t search=false)
searches for objects data
Int_t GetLast() const
Return index of last object in array.
virtual void WriteArrayDouble32(const Double_t *d, Int_t n, TStreamerElement *ele=0)
Write array of Double32_t to buffer.
Long64_t GetValue(ULong64_t hash, Long64_t key)
Return the value belonging to specified key and hash value.
TSQLResult * GetClassData() const
Access an SQL db via the TFile interface.
void SetCustomClass(const TClass *cl, Version_t version)
set structure type as kSqlCustomClass
Version_t GetObjVersion() const
Basic data type descriptor (datatype information is obtained from CINT).
virtual void WriteLong(Long_t l)
Writes Long_t value to buffer.
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.
const char * GetBlobPrefixName() const
virtual void Error(const char *method, const char *msgfmt,...) const
Issue error message.
Int_t Size() const
Return size of object of this class.
TSQLClassInfo * GetSqlInfo() const
TSQLStructure * Stack(Int_t depth=0)
returns head of stack
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.
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.
const char * GetLocatedField() const
TSQLRow * GetObjectRow(Long64_t objid)
Returns single sql row with object data for that class.
void Streamer(void *obj, TBuffer &b, const TClass *onfile_class=0) const
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.
Version_t GetClassVersion() const
virtual Int_t WriteObjectAny(const void *obj, const TClass *ptrClass, Bool_t cacheReuse=kTRUE)
Write object to I/O 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
virtual void ReadStdString(std::string *s)
Read a std::string.
TMap implements an associative array of (key,value) pairs using a THashTable for efficient retrieval ...
unsigned long long ULong64_t
Int_t IndexOf(const TObject *obj) const
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)
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.
static constexpr double s
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
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.
TObjArray * GetElements() const
#define TBufferSQL2_operatorin(vname)
Int_t GetClassVersion() const
Bool_t IsTObject() const
Return kTRUE is the class inherits from TObject.
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 ...
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.
you should not use this method at all Int_t Int_t Double_t Double_t Double_t Int_t Double_t Double_t Double_t Double_t b
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.
Long64_t fObjIdCounter
! counter of objects id
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
Long64_t GetObjId() const
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 WriteCharP(const Char_t *c)
Writes array of characters to buffer.
Abstract Interface class describing Streamer information for one class.
virtual void ReadCharStar(char *&s)
Read a char* string.
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 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 GetCompressionLevel() const
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.
TSQLStructure * GetParent() const
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...
void * New(ENewType defConstructor=kClassNew, Bool_t quiet=kFALSE) const
Return a pointer to a newly allocated object of this class.
const char * Data() const
virtual void WriteChar(Char_t c)
Writes Char_t value to buffer.
TVirtualStreamerInfo * fStreamerInfo
StreamerInfo used to derive these actions.