ROOT » IO » SQL » TSQLStructure

class TSQLStructure: public TObject

  This is hierarhical structure, which is created when data is written
  by TBufferSQL2. It contains data all structurual information such:
  version of written class, data memeber types of that class, value for
  each data memeber and so on.
  Such structure in some sense similar to XML node and subnodes structure
  Once it created, it converted to SQL statements, which are submitted
  to database server.

Function Members (Methods)

voidTObject::AbstractMethod(const char* method) const
voidAdd(TSQLStructure* child)
voidAddObjectData(TSQLObjectData* objdata)
static voidAddStrBrackets(TString& s, const char* quote)
voidAddValue(const char* value, const char* tname = 0)
voidAddVersion(const TClass* cl, Int_t version = -100)
virtual voidTObject::AppendPad(Option_t* option = "")
virtual voidTObject::Browse(TBrowser* b)
voidChangeValueOnly(const char* value)
voidChildArrayIndex(Int_t index, Int_t cnt = 1)
static TClass*Class()
virtual const char*TObject::ClassName() const
virtual voidTObject::Clear(Option_t* = "")
virtual TObject*TObject::Clone(const char* newname = "") const
virtual Int_tTObject::Compare(const TObject* obj) const
Bool_tConvertToTables(TSQLFile* f, Long64_t keyid, TObjArray* cmds)
virtual voidTObject::Copy(TObject& object) const
static TStringDefineElementColumnName(TStreamerElement* elem, TSQLFile* f, Int_t indx = 0)
static Int_tDefineElementColumnType(TStreamerElement* elem, TSQLFile* f)
Long64_tDefineObjectId(Bool_t recursive = kTRUE)
virtual voidTObject::Delete(Option_t* option = "")MENU
virtual Int_tTObject::DistancetoPrimitive(Int_t px, Int_t py)
virtual voidTObject::Draw(Option_t* option = "")
virtual voidTObject::DrawClass() constMENU
virtual TObject*TObject::DrawClone(Option_t* option = "") constMENU
virtual voidTObject::Dump() constMENU
virtual voidTObject::Error(const char* method, const char* msgfmt) const
virtual voidTObject::Execute(const char* method, const char* params, Int_t* error = 0)
virtual voidTObject::Execute(TMethod* method, TObjArray* params, Int_t* error = 0)
virtual voidTObject::ExecuteEvent(Int_t event, Int_t px, Int_t py)
virtual voidTObject::Fatal(const char* method, const char* msgfmt) const
virtual TObject*TObject::FindObject(const char* name) const
virtual TObject*TObject::FindObject(const TObject* obj) const
Int_tGetArrayIndex() const
TSQLStructure*GetChild(Int_t n) const
Bool_tGetClassInfo(TClass*& cl, Version_t& version)
TClass*GetCustomClass() const
Version_tGetCustomClassVersion() const
virtual Option_t*TObject::GetDrawOption() const
static Long_tTObject::GetDtorOnly()
TStreamerElement*GetElement() const
Int_tGetElementNumber() const
virtual const char*TObject::GetIconName() const
virtual const char*TObject::GetName() const
TClass*GetObjectClass() const
TSQLObjectData*GetObjectData(Bool_t search = false)
virtual char*TObject::GetObjectInfo(Int_t px, Int_t py) const
static Bool_tTObject::GetObjectStat()
virtual Option_t*TObject::GetOption() const
TSQLStructure*GetParent() const
Int_tGetRepeatCounter() const
static const char*GetSimpleTypeName(Int_t typ)
TStreamerInfo*GetStreamerInfo() const
virtual const char*TObject::GetTitle() const
Int_tGetType() const
virtual UInt_tTObject::GetUniqueID() const
const char*GetValue() const
const char*GetValueType() const
TClass*GetVersionClass() const
virtual Bool_tTObject::HandleTimer(TTimer* timer)
virtual ULong_tTObject::Hash() const
virtual voidTObject::Info(const char* method, const char* msgfmt) const
virtual Bool_tTObject::InheritsFrom(const char* classname) const
virtual Bool_tTObject::InheritsFrom(const TClass* cl) const
virtual voidTObject::Inspect() constMENU
voidTObject::InvertBit(UInt_t f)
virtual TClass*IsA() const
virtual Bool_tTObject::IsEqual(const TObject* obj) const
virtual Bool_tTObject::IsFolder() const
static Bool_tIsNumericType(Int_t typ)
Bool_tTObject::IsOnHeap() const
virtual Bool_tTObject::IsSortable() const
Bool_tTObject::IsZombie() const
Int_tLocateElementColumn(TSQLFile* f, TBufferSQL2* buf, TSQLObjectData* data)
virtual voidTObject::ls(Option_t* option = "") const
static TStringMakeArrayIndex(TStreamerElement* elem, Int_t n)
voidTObject::MayNotUse(const char* method) const
virtual Bool_tTObject::Notify()
Int_tNumChilds() const
voidTObject::Obsolete(const char* method, const char* asOfVers, const char* removedFromVers) const
voidTObject::operator delete(void* ptr)
voidTObject::operator delete(void* ptr, void* vp)
voidTObject::operator delete[](void* ptr)
voidTObject::operator delete[](void* ptr, void* vp)
void*TObject::operator new(size_t sz)
void*TObject::operator new(size_t sz, void* vp)
void*TObject::operator new[](size_t sz)
void*TObject::operator new[](size_t sz, void* vp)
TSQLStructure&operator=(const TSQLStructure&)
virtual voidTObject::Paint(Option_t* option = "")
virtual voidTObject::Pop()
virtual voidPrint(Option_t* option = "") const
voidPrintLevel(Int_t level) const
virtual Int_tTObject::Read(const char* name)
virtual voidTObject::RecursiveRemove(TObject* obj)
voidTObject::ResetBit(UInt_t f)
virtual voidTObject::SaveAs(const char* filename = "", Option_t* option = "") constMENU
virtual voidTObject::SavePrimitive(ostream& out, Option_t* option = "")
voidSetArray(Int_t sz = -1)
voidSetArrayIndex(Int_t indx, Int_t cnt = 1)
voidTObject::SetBit(UInt_t f)
voidTObject::SetBit(UInt_t f, Bool_t set)
voidSetClassStreamer(const TClass* cl)
voidSetCustomClass(const TClass* cl, Version_t version)
voidSetCustomElement(TStreamerElement* elem)
virtual voidTObject::SetDrawOption(Option_t* option = "")MENU
static voidTObject::SetDtorOnly(void* obj)
voidSetObjectData(TSQLObjectData* objdata)
voidSetObjectPointer(Long64_t ptrid)
voidSetObjectRef(Long64_t refid, const TClass* cl)
static voidTObject::SetObjectStat(Bool_t stat)
voidSetParent(TSQLStructure* p)
voidSetStreamerElement(const TStreamerElement* elem, Int_t number)
voidSetStreamerInfo(const TStreamerInfo* info)
voidSetType(Int_t typ)
virtual voidTObject::SetUniqueID(UInt_t uid)
voidSetValue(const char* value, const char* tname = 0)
voidSetVersion(const TClass* cl, Int_t version = -100)
virtual voidShowMembers(TMemberInspector& insp) const
virtual voidStreamer(TBuffer&)
voidStreamerNVirtual(TBuffer& ClassDef_StreamerNVirtual_b)
virtual voidTObject::SysError(const char* method, const char* msgfmt) const
Bool_tTObject::TestBit(UInt_t f) const
Int_tTObject::TestBits(UInt_t f) const
TSQLStructure(const TSQLStructure&)
static Bool_tUnpackTObject(TSQLFile* f, TBufferSQL2* buf, TSQLObjectData* data, Long64_t objid, Int_t clversion)
static Bool_tUnpackTString(TSQLFile* f, TBufferSQL2* buf, TSQLObjectData* data, Long64_t objid, Int_t clversion)
virtual voidTObject::UseCurrentStyle()
virtual voidTObject::Warning(const char* method, const char* msgfmt) const
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0)
virtual Int_tTObject::Write(const char* name = 0, Int_t option = 0, Int_t bufsize = 0) const
Bool_tCheckNormalClassPair(TSQLStructure* vers, TSQLStructure* info)
virtual voidTObject::DoError(int level, const char* location, const char* fmt, va_list va) const
voidPerformConversion(TSqlRegistry* reg, TSqlRawBuffer* blobs, const char* topname, Bool_t useblob = kFALSE)
Bool_tRecognizeTString(const char*& value)
Bool_tStoreClassInNormalForm(TSqlRegistry* reg)
Bool_tStoreElementInNormalForm(TSqlRegistry* reg, TSQLTableData* columns)
Bool_tStoreObject(TSqlRegistry* reg, Long64_t objid, TClass* cl, Bool_t registerobj = kTRUE)
Bool_tStoreObjectInNormalForm(TSqlRegistry* reg)
Bool_tStoreTObject(TSqlRegistry* reg)
Bool_tStoreTString(TSqlRegistry* reg)
Bool_tTryConvertObjectArray(TSqlRegistry* reg, TSqlRawBuffer* blobs)

Data Members

static TObject::(anonymous)TObject::kBitMask
static TObject::EStatusBitsTObject::kCanDelete
static TObject::EStatusBitsTObject::kCannotPick
static TSQLStructure::ESQLColumnskColNormObject
static TSQLStructure::ESQLColumnskColNormObjectArray
static TSQLStructure::ESQLColumnskColObject
static TSQLStructure::ESQLColumnskColObjectArray
static TSQLStructure::ESQLColumnskColObjectPtr
static TSQLStructure::ESQLColumnskColParent
static TSQLStructure::ESQLColumnskColRawData
static TSQLStructure::ESQLColumnskColSimple
static TSQLStructure::ESQLColumnskColSimpleArray
static TSQLStructure::ESQLColumnskColTString
static TSQLStructure::ESQLColumnskColUnknown
static TObject::EStatusBitsTObject::kHasUUID
static TSQLStructure::ESQLIdTypekIdColumn
static TSQLStructure::ESQLIdTypekIdRawTable
static TSQLStructure::ESQLIdTypekIdTable
static TObject::EStatusBitsTObject::kInvalidObject
static TObject::(anonymous)TObject::kIsOnHeap
static TObject::EStatusBitsTObject::kIsReferenced
static TObject::EStatusBitsTObject::kMustCleanup
static TObject::EStatusBitsTObject::kNoContextMenu
static TObject::(anonymous)TObject::kNotDeleted
static TObject::EStatusBitsTObject::kObjInCanvas
static TObject::(anonymous)TObject::kOverwrite
static TObject::(anonymous)TObject::kSingleKey
static TSQLStructure::ESQLTypeskSqlArray
static TSQLStructure::ESQLTypeskSqlClassStreamer
static TSQLStructure::ESQLTypeskSqlCustomClass
static TSQLStructure::ESQLTypeskSqlCustomElement
static TSQLStructure::ESQLTypeskSqlElement
static TSQLStructure::ESQLTypeskSqlObject
static TSQLStructure::ESQLTypeskSqlObjectData
static TSQLStructure::ESQLTypeskSqlPointer
static TSQLStructure::ESQLTypeskSqlStreamerInfo
static TSQLStructure::ESQLTypeskSqlValue
static TSQLStructure::ESQLTypeskSqlVersion
static TObject::(anonymous)TObject::kWriteDelete
static TObject::(anonymous)TObject::kZombie
const void*fPointer!

Class Charts

Inheritance Chart:

Function documentation

 default constructor
Int_t NumChilds() const
 number of child structures
TSQLStructure* GetChild(Int_t n) const
 return child structure of index n
void SetObjectRef(Long64_t refid, const TClass* cl)
 set structure type as kSqlObject
void SetObjectPointer(Long64_t ptrid)
 set structure type as kSqlPointer
void SetVersion(const TClass* cl, Int_t version = -100)
 set structure type as kSqlVersion
void SetClassStreamer(const TClass* cl)
 set structure type as kSqlClassStreamer
void SetStreamerInfo(const TStreamerInfo* info)
 set structure type as kSqlStreamerInfo
void SetStreamerElement(const TStreamerElement* elem, Int_t number)
 set structure type as kSqlElement
void SetCustomClass(const TClass* cl, Version_t version)
 set structure type as kSqlCustomClass
void SetCustomElement(TStreamerElement* elem)
 set structure type as kSqlCustomElement
void SetValue(const char* value, const char* tname = 0)
 set structure type as kSqlValue
void ChangeValueOnly(const char* value)
 change value of this structure
 used as "workaround" to keep object id in kSqlElement node
void SetArrayIndex(Int_t indx, Int_t cnt = 1)
 set array index for this structure
void ChildArrayIndex(Int_t index, Int_t cnt = 1)
 set array index for last child element
   if (cnt<=1) return;
void SetArray(Int_t sz = -1)
 Set structure as array element
TClass* GetObjectClass() const
 return object class if type kSqlObject
TClass* GetVersionClass() const
 return class for version tag if type is kSqlVersion
TStreamerInfo* GetStreamerInfo() const
 return TStreamerInfo* if type is kSqlStreamerInfo
TStreamerElement* GetElement() const
 return TStremerElement* if type is kSqlElement
Int_t GetElementNumber() const
 returns number of TStremerElement in TStreamerInfo
const char* GetValueType() const
 return value type if structure is kSqlValue
TClass* GetCustomClass() const
 return element custom class if strutures is kSqlCustomClass
Version_t GetCustomClassVersion() const
 return custom class version if strutures is kSqlCustomClass
Bool_t GetClassInfo(TClass*& cl, Version_t& version)
 provides class info if structure kSqlStreamerInfo or kSqlCustomClass
const char* GetValue() const
 returns value
 for different structure kinds has different sense
 For kSqlVersion it version, for kSqlReference it is object id and so on
void Add(TSQLStructure* child)
 Add child strucure
void AddVersion(const TClass* cl, Int_t version = -100)
 add child as version
void AddValue(const char* value, const char* tname = 0)
 Add child structure as value
Long64_t DefineObjectId(Bool_t recursive = kTRUE)
 defines current object id, to which this structure belong
 make life complicated, because some objects do not get id
 automatically in TBufferSQL, but afterwards
void SetObjectData(TSQLObjectData* objdata)
 set element to be used for object data
void AddObjectData(TSQLObjectData* objdata)
 add element with pointer to object data
TSQLObjectData* GetObjectData(Bool_t search = false)
 searchs for objects data
void Print(Option_t* option = "") const
 print content of complete structure
void PrintLevel(Int_t level) const
 print content of current structure
Bool_t IsNumericType(Int_t typ)
 defines if value is numeric and not requires quotes when writing
const char* GetSimpleTypeName(Int_t typ)
 provides name for basic types
 used as suffix for column name or field suffix in raw table
Long64_t FindMaxObjectId()
 define maximum reference id, used for objects
Bool_t ConvertToTables(TSQLFile* f, Long64_t keyid, TObjArray* cmds)
 Convert structure to sql statements
 This function is called immidiately after TBufferSQL2 produces
 this structure with object data
 Should be only called for toplevel structure
void PerformConversion(TSqlRegistry* reg, TSqlRawBuffer* blobs, const char* topname, Bool_t useblob = kFALSE)
 perform conversion of structure to sql statements
 first tries convert it to normal form
 if fails, produces data for raw table
Bool_t StoreObject(TSqlRegistry* reg, Long64_t objid, TClass* cl, Bool_t registerobj = kTRUE)
 convert object data to sql statements
 if normal (columnwise) representation is not possible,
 complete object will be converted to raw format
Bool_t StoreObjectInNormalForm(TSqlRegistry* reg)
 this function verify object child elements and
 calls transformation to class table
Bool_t StoreClassInNormalForm(TSqlRegistry* reg)
 produces data for complete class table
 where not possible, raw data for some elements are created
TString MakeArrayIndex(TStreamerElement* elem, Int_t n)
 produce string with complete index like [1][2][0]
Bool_t StoreElementInNormalForm(TSqlRegistry* reg, TSQLTableData* columns)
 tries to store element data in column
Bool_t TryConvertObjectArray(TSqlRegistry* reg, TSqlRawBuffer* blobs)
 tries to write array of objects as lis of object refereneces
 in _streamer_ table, while objects itself will be stored in
 other tables. If not successfull, object data will be stored
 in _streamer_ table
Bool_t CheckNormalClassPair(TSQLStructure* vers, TSQLStructure* info)
 check if pair of two element corresponds
 to start of object, stored in normal form
Bool_t StoreTObject(TSqlRegistry* reg)
 store data of TObject in special table
 workaround custom TObject streamer
Bool_t StoreTString(TSqlRegistry* reg)
 store data of TString in special table
 it is required when TString stored as pointer and reference to it possible
Bool_t RecognizeTString(const char*& value)
 prove that structure containes TString data
Int_t DefineElementColumnType(TStreamerElement* elem, TSQLFile* f)
 defines which kind of column can be assigned for this element
 Possible cases
    kColSimple       -  basic data type
    kColSimpleArray  -  fixed arary of basic types
    kColParent       -  parent class
    kColObject       -  object as data memeber
    kColObjectPtr    -  object as pointer
    kColTString      -  TString
    kColRawData      -  anything else as raw data
TString DefineElementColumnName(TStreamerElement* elem, TSQLFile* f, Int_t indx = 0)
 returns name of the column in class table for that element
Int_t LocateElementColumn(TSQLFile* f, TBufferSQL2* buf, TSQLObjectData* data)
 find column in TSQLObjectData object, which correspond to current element
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
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
void AddStrBrackets(TString& s, const char* quote)
 adds quotes arround string value and replaces some special symbols
const char* GetType() const
{ return fType.Data(); }
TSQLStructure* GetParent() const
{ return fParent; }
void SetParent(TSQLStructure* p)
{ fParent = p; }
void SetType(Int_t typ)
{ fType = typ; }
Int_t GetArrayIndex() const
{ return fArrayIndex; }
Int_t GetRepeatCounter() const
{ return fRepeatCnt; }