Logo ROOT  
Reference Guide
TSQLStructure.h
Go to the documentation of this file.
1 // @(#)root/sql:$Id$
2 // Author: Sergey Linev 20/11/2005
3 
4 /*************************************************************************
5  * Copyright (C) 1995-2005, Rene Brun and Fons Rademakers. *
6  * All rights reserved. *
7  * *
8  * For the licensing terms see $ROOTSYS/LICENSE. *
9  * For the list of contributors see $ROOTSYS/README/CREDITS. *
10  *************************************************************************/
11 
12 #ifndef ROOT_TSQLStructure
13 #define ROOT_TSQLStructure
14 
15 #include "TObjArray.h"
16 
17 #ifdef Bool
18 #undef Bool
19 #endif
20 #ifdef True
21 #undef True
22 #endif
23 #ifdef False
24 #undef False
25 #endif
26 
27 class TStreamerInfo;
28 class TStreamerInfo;
29 class TStreamerElement;
30 class TSQLFile;
31 class TSqlRegistry;
32 class TSqlRawBuffer;
33 class TSQLObjectData;
34 class TSQLClassInfo;
35 class TBufferSQL2;
36 
37 class TSQLColumnData final : public TObject {
38 
39 protected:
40  TString fName; ///<! name of the table column
41  TString fType; ///<! type of the table column
42  TString fValue; ///<! value of the table column
43  Bool_t fNumeric{kFALSE}; ///<! for numeric quotes (double quotes) are not required
44 public:
45  TSQLColumnData(const char *name, const char *sqltype, const char *value, Bool_t numeric);
46 
47  TSQLColumnData(const char *name, Long64_t value);
48 
49  const char *GetName() const final { return fName.Data(); }
50  const char *GetType() const { return fType.Data(); }
51  const char *GetValue() const { return fValue.Data(); }
52  Bool_t IsNumeric() const { return fNumeric; }
53 
54  ClassDefOverride(TSQLColumnData, 1); // Single SQL column data.
55 };
56 
57 //______________________________________________________________________
58 
59 class TSQLTableData : public TObject {
60 
61 protected:
62  TSQLFile *fFile{nullptr}; ///<!
63  TSQLClassInfo *fInfo{nullptr}; ///<!
64  TObjArray fColumns; ///<! collection of columns
65  TObjArray *fColInfos{nullptr}; ///<! array with TSQLClassColumnInfo, used later for TSQLClassInfo
66 
67  TString DefineSQLName(const char *fullname);
68  Bool_t HasSQLName(const char *sqlname);
69 
70 public:
71  TSQLTableData(TSQLFile *f = nullptr, TSQLClassInfo *info = nullptr);
72  virtual ~TSQLTableData();
73 
74  void AddColumn(const char *name, Long64_t value);
75  void AddColumn(const char *name, const char *sqltype, const char *value, Bool_t numeric);
76 
78 
80  const char *GetColumn(Int_t n);
82 
83  ClassDef(TSQLTableData, 1); // Collection of columns data for single SQL table
84 };
85 
86 //______________________________________________________________________
87 
88 class TSQLStructure : public TObject {
89 protected:
91 
93  void PerformConversion(TSqlRegistry *reg, TSqlRawBuffer *blobs, const char *topname, Bool_t useblob = kFALSE);
94  Bool_t StoreObject(TSqlRegistry *reg, Long64_t objid, TClass *cl, Bool_t registerobj = kTRUE);
95  Bool_t StoreObjectInNormalForm(TSqlRegistry *reg);
96  Bool_t StoreClassInNormalForm(TSqlRegistry *reg);
97  Bool_t StoreElementInNormalForm(TSqlRegistry *reg, TSQLTableData *columns);
98  Bool_t TryConvertObjectArray(TSqlRegistry *reg, TSqlRawBuffer *blobs);
99 
100  Bool_t StoreTObject(TSqlRegistry *reg);
101  Bool_t StoreTString(TSqlRegistry *reg);
102  Bool_t RecognizeTString(const char *&value);
103 
104  TSQLStructure *fParent{nullptr}; //!
105  Int_t fType{0}; //!
106  const void *fPointer{nullptr}; //!
111 
112 public:
113  TSQLStructure() {} // NOLINT: not allowed to use = default because of TObject::kIsOnHeap detection, see ROOT-10300
114  virtual ~TSQLStructure();
115 
116  TSQLStructure *GetParent() const { return fParent; }
117  void SetParent(TSQLStructure *p) { fParent = p; }
118  Int_t NumChilds() const;
119  TSQLStructure *GetChild(Int_t n) const;
120 
121  void SetType(Int_t typ) { fType = typ; }
122  Int_t GetType() const { return fType; }
123 
124  // this part requried for writing to SQL tables
125  void SetObjectRef(Long64_t refid, const TClass *cl);
126  void SetObjectPointer(Long64_t ptrid);
127  void SetVersion(const TClass *cl, Int_t version = -100);
128  void SetClassStreamer(const TClass *cl);
129  void SetStreamerInfo(const TStreamerInfo *info);
130  void SetStreamerElement(const TStreamerElement *elem, Int_t number);
131  void SetCustomClass(const TClass *cl, Version_t version);
133  void SetValue(const char *value, const char *tname = 0);
134  void SetArrayIndex(Int_t indx, Int_t cnt = 1);
135  void SetArray(Int_t sz = -1);
136  void ChangeValueOnly(const char *value);
137 
138  TClass *GetObjectClass() const;
139  TClass *GetVersionClass() const;
141  TStreamerElement *GetElement() const;
142  Int_t GetElementNumber() const;
143  TClass *GetCustomClass() const;
145  Bool_t GetClassInfo(TClass *&cl, Version_t &version);
146  const char *GetValueType() const;
147  const char *GetValue() const;
148  Int_t GetArrayIndex() const { return fArrayIndex; }
149  Int_t GetRepeatCounter() const { return fRepeatCnt; }
150 
151  void Add(TSQLStructure *child);
152  void AddVersion(const TClass *cl, Int_t version = -100);
153  void AddValue(const char *value, const char *tname = 0);
154  void ChildArrayIndex(Int_t index, Int_t cnt = 1);
155 
156  // this is part specially for reading of sql tables
157 
158  Long64_t DefineObjectId(Bool_t recursive = kTRUE);
159 
160  void SetObjectData(TSQLObjectData *objdata);
161  void AddObjectData(TSQLObjectData *objdata);
162  TSQLObjectData *GetObjectData(Bool_t search = false);
163 
164  virtual void Print(Option_t *option = "") const;
165  void PrintLevel(Int_t level) const;
166 
168 
170 
171  static Bool_t UnpackTObject(TSQLFile *f, TBufferSQL2 *buf, TSQLObjectData *data, Long64_t objid, Int_t clversion);
172  static Bool_t UnpackTString(TSQLFile *f, TBufferSQL2 *buf, TSQLObjectData *data, Long64_t objid, Int_t clversion);
173  static Bool_t IsNumericType(Int_t typ);
174  static const char *GetSimpleTypeName(Int_t typ);
178  static void AddStrBrackets(TString &s, const char *quote);
179 
180  enum ESQLTypes {
181  kSqlObject = 10001,
182  kSqlPointer = 10002,
183  kSqlVersion = 10003,
186  kSqlElement = 10006,
187  kSqlValue = 10007,
188  kSqlArray = 10008,
189  kSqlObjectData = 10009,
192  };
193 
194  enum ESQLColumns {
206  };
207 
208  enum ESQLIdType { kIdTable = 0, kIdRawTable = 1, kIdColumn = 2 };
209 
210  ClassDef(TSQLStructure, 1); // Table/structure description used internally by TBufferSQL.
211 };
212 
213 // text constants, used in SQL I/O
214 
215 namespace sqlio {
216 
217 extern Long64_t atol64(const char *value);
218 
219 extern const Int_t Ids_NullPtr;
220 extern const Int_t Ids_RootDir;
221 extern const Int_t Ids_TSQLFile;
222 extern const Int_t Ids_StreamerInfos;
223 extern const Int_t Ids_FirstKey;
224 extern const Int_t Ids_FirstObject;
225 
226 extern const char *ObjectRef;
227 extern const char *ObjectRef_Arr;
228 extern const char *ObjectPtr;
229 extern const char *ObjectInst;
230 extern const char *Version;
231 extern const char *TObjectUniqueId;
232 extern const char *TObjectBits;
233 extern const char *TObjectProcessId;
234 extern const char *TStringValue;
235 extern const char *IndexSepar;
236 extern const char *RawSuffix;
237 extern const char *ParentSuffix;
238 extern const char *ObjectSuffix;
239 extern const char *PointerSuffix;
240 extern const char *StrSuffix;
241 extern const char *LongStrPrefix;
242 
243 extern const char *Array;
244 extern const char *Bool;
245 extern const char *Char;
246 extern const char *Short;
247 extern const char *Int;
248 extern const char *Long;
249 extern const char *Long64;
250 extern const char *Float;
251 extern const char *Double;
252 extern const char *UChar;
253 extern const char *UShort;
254 extern const char *UInt;
255 extern const char *ULong;
256 extern const char *ULong64;
257 extern const char *CharStar;
258 extern const char *True;
259 extern const char *False;
260 
261 extern const char *KeysTable;
262 extern const char *KeysTableIndex;
263 extern const char *KT_Name;
264 extern const char *KT_Title;
265 extern const char *KT_Datetime;
266 extern const char *KT_Cycle;
267 extern const char *KT_Class;
268 
269 extern const char *DT_Create;
270 extern const char *DT_Modified;
271 extern const char *DT_UUID;
272 
273 extern const char *ObjectsTable;
274 extern const char *ObjectsTableIndex;
275 extern const char *OT_Class;
276 extern const char *OT_Version;
277 
278 extern const char *IdsTable;
279 extern const char *IdsTableIndex;
280 extern const char *IT_TableID;
281 extern const char *IT_SubID;
282 extern const char *IT_Type;
283 extern const char *IT_FullName;
284 extern const char *IT_SQLName;
285 extern const char *IT_Info;
286 
287 extern const char *BT_Field;
288 extern const char *BT_Value;
289 
290 extern const char *StringsTable;
291 extern const char *ST_Value;
292 
293 extern const char *ConfigTable;
294 extern const char *CT_Field;
295 extern const char *CT_Value;
296 
297 extern const char *cfg_Version;
298 extern const char *cfg_UseSufixes;
299 extern const char *cfg_ArrayLimit;
300 extern const char *cfg_TablesType;
301 extern const char *cfg_UseTransactions;
302 extern const char *cfg_UseIndexes;
303 extern const char *cfg_LockingMode;
304 extern const char *cfg_ModifyCounter;
305 }
306 
307 #endif
TSQLStructure::~TSQLStructure
virtual ~TSQLStructure()
destructor
Definition: TSQLStructure.cxx:330
sqlio::IT_SQLName
const char * IT_SQLName
Definition: TSQLStructure.cxx:116
TSQLStructure::fChilds
TObjArray fChilds
Definition: TSQLStructure.h:110
n
const Int_t n
Definition: legend1.C:16
TSQLStructure::kSqlCustomElement
@ kSqlCustomElement
Definition: TSQLStructure.h:191
sqlio::Bool
const char * Bool
Definition: TSQLStructure.cxx:69
kTRUE
const Bool_t kTRUE
Definition: RtypesCore.h:91
sqlio::DT_Create
const char * DT_Create
Definition: TSQLStructure.cxx:103
Version_t
short Version_t
Definition: RtypesCore.h:65
TSQLStructure::AddStrBrackets
static void AddStrBrackets(TString &s, const char *quote)
adds quotes around string value and replaces some special symbols
Definition: TSQLStructure.cxx:2368
TSQLStructure::kSqlVersion
@ kSqlVersion
Definition: TSQLStructure.h:183
TSQLStructure::SetVersion
void SetVersion(const TClass *cl, Int_t version=-100)
set structure type as kSqlVersion
Definition: TSQLStructure.cxx:380
TObjArray
Definition: TObjArray.h:37
TSQLTableData::TakeColInfos
TObjArray * TakeColInfos()
take ownership over colinfos
Definition: TSQLStructure.cxx:316
f
#define f(i)
Definition: RSha256.hxx:122
sqlio::IT_FullName
const char * IT_FullName
Definition: TSQLStructure.cxx:115
sqlio::IndexSepar
const char * IndexSepar
Definition: TSQLStructure.cxx:60
sqlio::IdsTableIndex
const char * IdsTableIndex
Definition: TSQLStructure.cxx:92
TSQLStructure::SetArrayIndex
void SetArrayIndex(Int_t indx, Int_t cnt=1)
set array index for this structure
Definition: TSQLStructure.cxx:458
sqlio::IT_Info
const char * IT_Info
Definition: TSQLStructure.cxx:117
TSQLStructure::GetElement
TStreamerElement * GetElement() const
return TStremerElement* if type is kSqlElement
Definition: TSQLStructure.cxx:512
TSQLClassInfo
Definition: TSQLClassInfo.h:41
TSQLStructure::kSqlElement
@ kSqlElement
Definition: TSQLStructure.h:186
TSQLStructure::SetValue
void SetValue(const char *value, const char *tname=0)
set structure type as kSqlValue
Definition: TSQLStructure.cxx:439
TString::Data
const char * Data() const
Definition: TString.h:369
TSQLStructure::CheckNormalClassPair
Bool_t CheckNormalClassPair(TSQLStructure *vers, TSQLStructure *info)
check if pair of two element corresponds to start of object, stored in normal form
Definition: TSQLStructure.cxx:1777
TSQLStructure::kSqlClassStreamer
@ kSqlClassStreamer
Definition: TSQLStructure.h:185
TSQLStructure::GetChild
TSQLStructure * GetChild(Int_t n) const
return child structure of index n
Definition: TSQLStructure.cxx:353
TSQLTableData::GetNumColumns
Int_t GetNumColumns()
returns number of columns in provided set
Definition: TSQLStructure.cxx:292
sqlio::True
const char * True
Definition: TSQLStructure.cxx:83
TSQLStructure::kColObjectPtr
@ kColObjectPtr
Definition: TSQLStructure.h:203
TSQLColumnData
Definition: TSQLStructure.h:37
sqlio::ObjectRef_Arr
const char * ObjectRef_Arr
Definition: TSQLStructure.cxx:52
TSQLTableData::DefineSQLName
TString DefineSQLName(const char *fullname)
produce suitable name for column, taking into account length limitation
Definition: TSQLStructure.cxx:234
TSQLStructure::GetValue
const char * GetValue() const
returns value for different structure kinds has different sense For kSqlVersion it version,...
Definition: TSQLStructure.cxx:573
TSQLStructure::fType
Int_t fType
Definition: TSQLStructure.h:105
TSQLStructure::AddValue
void AddValue(const char *value, const char *tname=0)
Add child structure as value.
Definition: TSQLStructure.cxx:602
TSQLStructure::LocateElementColumn
Int_t LocateElementColumn(TSQLFile *f, TBufferSQL2 *buf, TSQLObjectData *data)
find column in TSQLObjectData object, which correspond to current element
Definition: TSQLStructure.cxx:2107
sqlio::StringsTable
const char * StringsTable
Definition: TSQLStructure.cxx:93
sqlio::IdsTable
const char * IdsTable
Definition: TSQLStructure.cxx:91
Long64_t
long long Long64_t
Definition: RtypesCore.h:73
TSQLStructure::ESQLColumns
ESQLColumns
Definition: TSQLStructure.h:194
TSQLTableData::~TSQLTableData
virtual ~TSQLTableData()
destructor
Definition: TSQLStructure.cxx:190
sqlio
Definition: TSQLStructure.h:215
TSQLStructure::fParent
TSQLStructure * fParent
Definition: TSQLStructure.h:104
TSQLStructure::kColSimpleArray
@ kColSimpleArray
Definition: TSQLStructure.h:197
TSQLStructure::AddVersion
void AddVersion(const TClass *cl, Int_t version=-100)
add child as version
Definition: TSQLStructure.cxx:592
TSQLStructure::SetCustomClass
void SetCustomClass(const TClass *cl, Version_t version)
set structure type as kSqlCustomClass
Definition: TSQLStructure.cxx:420
sqlio::IT_TableID
const char * IT_TableID
Definition: TSQLStructure.cxx:112
TGeant4Unit::s
static constexpr double s
Definition: TGeant4SystemOfUnits.h:168
Int_t
int Int_t
Definition: RtypesCore.h:45
TSQLStructure::NumChilds
Int_t NumChilds() const
number of child structures
Definition: TSQLStructure.cxx:345
sqlio::cfg_ModifyCounter
const char * cfg_ModifyCounter
Definition: TSQLStructure.cxx:138
sqlio::CT_Field
const char * CT_Field
Definition: TSQLStructure.cxx:127
sqlio::ObjectSuffix
const char * ObjectSuffix
Definition: TSQLStructure.cxx:63
sqlio::KT_Title
const char * KT_Title
Definition: TSQLStructure.cxx:98
TSQLStructure
Definition: TSQLStructure.h:88
TSQLStructure::fPointer
const void * fPointer
Definition: TSQLStructure.h:106
TSQLStructure::StoreElementInNormalForm
Bool_t StoreElementInNormalForm(TSqlRegistry *reg, TSQLTableData *columns)
tries to store element data in column
Definition: TSQLStructure.cxx:1512
TSQLTableData::IsNumeric
Bool_t IsNumeric(Int_t n)
identifies if column has numeric value
Definition: TSQLStructure.cxx:308
TSQLStructure::GetType
Int_t GetType() const
Definition: TSQLStructure.h:122
TSQLStructure::RecognizeTString
Bool_t RecognizeTString(const char *&value)
prove that structure contains TString data
Definition: TSQLStructure.cxx:1870
TSQLStructure::AddObjectData
void AddObjectData(TSQLObjectData *objdata)
add element with pointer to object data
Definition: TSQLStructure.cxx:644
TSQLStructure::GetCustomClass
TClass * GetCustomClass() const
return element custom class if structures is kSqlCustomClass
Definition: TSQLStructure.cxx:536
sqlio::UInt
const char * UInt
Definition: TSQLStructure.cxx:79
TSQLColumnData::TSQLColumnData
TSQLColumnData(const char *name, const char *sqltype, const char *value, Bool_t numeric)
normal constructor of TSQLColumnData class specifies name, type and value for one column
Definition: TSQLStructure.cxx:161
sqlio::KT_Cycle
const char * KT_Cycle
Definition: TSQLStructure.cxx:100
TString
Definition: TString.h:136
TSQLTableData::fColumns
TObjArray fColumns
! collection of columns
Definition: TSQLStructure.h:64
TSQLStructure::SetObjectData
void SetObjectData(TSQLObjectData *objdata)
set element to be used for object data
Definition: TSQLStructure.cxx:635
TSQLStructure::TSQLStructure
TSQLStructure()
Definition: TSQLStructure.h:113
Bool_t
bool Bool_t
Definition: RtypesCore.h:63
TSQLStructure::kSqlStreamerInfo
@ kSqlStreamerInfo
Definition: TSQLStructure.h:184
TSQLColumnData::GetType
const char * GetType() const
Definition: TSQLStructure.h:50
TSQLStructure::StoreTString
Bool_t StoreTString(TSqlRegistry *reg)
store data of TString in special table it is required when TString stored as pointer and reference to...
Definition: TSQLStructure.cxx:1846
TSQLTableData::GetColumn
const char * GetColumn(Int_t n)
return column value
Definition: TSQLStructure.cxx:300
sqlio::ObjectInst
const char * ObjectInst
Definition: TSQLStructure.cxx:54
TSQLStructure::kIdTable
@ kIdTable
Definition: TSQLStructure.h:208
bool
TSQLStructure::TryConvertObjectArray
Bool_t TryConvertObjectArray(TSqlRegistry *reg, TSqlRawBuffer *blobs)
tries to write array of objects as list of object references in streamer table, while objects itself ...
Definition: TSQLStructure.cxx:1732
TSQLTableData::AddColumn
void AddColumn(const char *name, Long64_t value)
Add INT column to list of columns.
Definition: TSQLStructure.cxx:202
sqlio::StrSuffix
const char * StrSuffix
Definition: TSQLStructure.cxx:65
TSQLStructure::fValue
TString fValue
Definition: TSQLStructure.h:107
TSQLStructure::GetObjectData
TSQLObjectData * GetObjectData(Bool_t search=false)
searches for objects data
Definition: TSQLStructure.cxx:654
TBufferSQL2
Definition: TBufferSQL2.h:27
sqlio::RawSuffix
const char * RawSuffix
Definition: TSQLStructure.cxx:61
sqlio::TObjectUniqueId
const char * TObjectUniqueId
Definition: TSQLStructure.cxx:56
TSQLStructure::SetParent
void SetParent(TSQLStructure *p)
Definition: TSQLStructure.h:117
sqlio::DT_UUID
const char * DT_UUID
Definition: TSQLStructure.cxx:105
sqlio::cfg_LockingMode
const char * cfg_LockingMode
Definition: TSQLStructure.cxx:137
TSQLStructure::StoreObjectInNormalForm
Bool_t StoreObjectInNormalForm(TSqlRegistry *reg)
this function verify object child elements and calls transformation to class table
Definition: TSQLStructure.cxx:1396
TSQLStructure::kSqlCustomClass
@ kSqlCustomClass
Definition: TSQLStructure.h:190
sqlio::TStringValue
const char * TStringValue
Definition: TSQLStructure.cxx:59
TSQLStructure::ESQLTypes
ESQLTypes
Definition: TSQLStructure.h:180
sqlio::KT_Datetime
const char * KT_Datetime
Definition: TSQLStructure.cxx:99
sqlio::Double
const char * Double
Definition: TSQLStructure.cxx:76
TSQLStructure::DefineElementColumnName
static TString DefineElementColumnName(TStreamerElement *elem, TSQLFile *f, Int_t indx=0)
returns name of the column in class table for that element
Definition: TSQLStructure.cxx:2017
TSQLStructure::Add
void Add(TSQLStructure *child)
Add child structure.
Definition: TSQLStructure.cxx:581
TSQLStructure::ESQLIdType
ESQLIdType
Definition: TSQLStructure.h:208
sqlio::Int
const char * Int
Definition: TSQLStructure.cxx:72
TSQLStructure::GetClassInfo
Bool_t GetClassInfo(TClass *&cl, Version_t &version)
provides class info if structure kSqlStreamerInfo or kSqlCustomClass
Definition: TSQLStructure.cxx:552
sqlio::BT_Field
const char * BT_Field
Definition: TSQLStructure.cxx:120
Option_t
const typedef char Option_t
Definition: RtypesCore.h:66
TSQLStructure::kColUnknown
@ kColUnknown
Definition: TSQLStructure.h:195
sqlio::DT_Modified
const char * DT_Modified
Definition: TSQLStructure.cxx:104
sqlio::cfg_Version
const char * cfg_Version
Definition: TSQLStructure.cxx:131
TSQLStructure::kColSimple
@ kColSimple
Definition: TSQLStructure.h:196
TSQLStructure::SetClassStreamer
void SetClassStreamer(const TClass *cl)
set structure type as kSqlClassStreamer
Definition: TSQLStructure.cxx:392
TSQLColumnData::ClassDefOverride
ClassDefOverride(TSQLColumnData, 1)
sqlio::UShort
const char * UShort
Definition: TSQLStructure.cxx:78
TSQLStructure::GetValueType
const char * GetValueType() const
return value type if structure is kSqlValue
Definition: TSQLStructure.cxx:528
sqlio::PointerSuffix
const char * PointerSuffix
Definition: TSQLStructure.cxx:64
TSQLColumnData::fName
TString fName
! name of the table column
Definition: TSQLStructure.h:40
TStreamerInfo
Definition: TStreamerInfo.h:44
sqlio::IT_Type
const char * IT_Type
Definition: TSQLStructure.cxx:114
sqlio::Ids_NullPtr
const Int_t Ids_NullPtr
Definition: TSQLStructure.cxx:44
sqlio::cfg_UseSufixes
const char * cfg_UseSufixes
Definition: TSQLStructure.cxx:132
sqlio::Short
const char * Short
Definition: TSQLStructure.cxx:71
TSQLColumnData::GetValue
const char * GetValue() const
Definition: TSQLStructure.h:51
sqlio::Ids_StreamerInfos
const Int_t Ids_StreamerInfos
Definition: TSQLStructure.cxx:47
TSQLStructure::fRepeatCnt
Int_t fRepeatCnt
Definition: TSQLStructure.h:109
sqlio::Long
const char * Long
Definition: TSQLStructure.cxx:73
TSQLStructure::FindMaxObjectId
Long64_t FindMaxObjectId()
define maximum reference id, used for objects
Definition: TSQLStructure.cxx:1169
kFALSE
const Bool_t kFALSE
Definition: RtypesCore.h:92
TSQLStructure::DefineObjectId
Long64_t DefineObjectId(Bool_t recursive=kTRUE)
defines current object id, to which this structure belong make life complicated, because some objects...
Definition: TSQLStructure.cxx:614
sqlio::Ids_FirstObject
const Int_t Ids_FirstObject
Definition: TSQLStructure.cxx:49
TSQLStructure::kColObjectArray
@ kColObjectArray
Definition: TSQLStructure.h:200
TSQLColumnData::IsNumeric
Bool_t IsNumeric() const
Definition: TSQLStructure.h:52
sqlio::atol64
Long64_t atol64(const char *value)
Definition: TSQLStructure.cxx:143
TSQLStructure::GetObjectClass
TClass * GetObjectClass() const
return object class if type kSqlObject
Definition: TSQLStructure.cxx:488
sqlio::IT_SubID
const char * IT_SubID
Definition: TSQLStructure.cxx:113
sqlio::TObjectProcessId
const char * TObjectProcessId
Definition: TSQLStructure.cxx:58
TSQLTableData::fColInfos
TObjArray * fColInfos
! array with TSQLClassColumnInfo, used later for TSQLClassInfo
Definition: TSQLStructure.h:65
TSQLColumnData::fNumeric
Bool_t fNumeric
! for numeric quotes (double quotes) are not required
Definition: TSQLStructure.h:43
TSQLStructure::GetRepeatCounter
Int_t GetRepeatCounter() const
Definition: TSQLStructure.h:149
TSQLStructure::GetSimpleTypeName
static const char * GetSimpleTypeName(Int_t typ)
provides name for basic types used as suffix for column name or field suffix in raw table
Definition: TSQLStructure.cxx:756
sqlio::ObjectPtr
const char * ObjectPtr
Definition: TSQLStructure.cxx:53
TSQLStructure::kSqlObject
@ kSqlObject
Definition: TSQLStructure.h:181
TSQLStructure::kColNormObject
@ kColNormObject
Definition: TSQLStructure.h:201
sqlio::cfg_UseTransactions
const char * cfg_UseTransactions
Definition: TSQLStructure.cxx:135
TSQLStructure::UnpackTString
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.
Definition: TSQLStructure.cxx:2336
TSQLStructure::ChangeValueOnly
void ChangeValueOnly(const char *value)
change value of this structure used as "workaround" to keep object id in kSqlElement node
Definition: TSQLStructure.cxx:450
sqlio::Ids_RootDir
const Int_t Ids_RootDir
Definition: TSQLStructure.cxx:45
TSQLColumnData::GetName
const char * GetName() const final
Returns name of object.
Definition: TSQLStructure.h:49
TSQLStructure::SetObjectPointer
void SetObjectPointer(Long64_t ptrid)
set structure type as kSqlPointer
Definition: TSQLStructure.cxx:371
TSQLStructure::GetVersionClass
TClass * GetVersionClass() const
return class for version tag if type is kSqlVersion
Definition: TSQLStructure.cxx:496
TSQLStructure::kIdColumn
@ kIdColumn
Definition: TSQLStructure.h:208
sqlio::CT_Value
const char * CT_Value
Definition: TSQLStructure.cxx:128
TSQLStructure::SetStreamerElement
void SetStreamerElement(const TStreamerElement *elem, Int_t number)
set structure type as kSqlElement
Definition: TSQLStructure.cxx:410
TSQLStructure::MakeArrayIndex
static TString MakeArrayIndex(TStreamerElement *elem, Int_t n)
produce string with complete index like [1][2][0]
Definition: TSQLStructure.cxx:1493
sqlio::Version
const char * Version
Definition: TSQLStructure.cxx:55
TSQLStructure::SetArray
void SetArray(Int_t sz=-1)
Set structure as array element.
Definition: TSQLStructure.cxx:478
TSQLStructure::StoreClassInNormalForm
Bool_t StoreClassInNormalForm(TSqlRegistry *reg)
produces data for complete class table where not possible, raw data for some elements are created
Definition: TSQLStructure.cxx:1415
sqlio::CharStar
const char * CharStar
Definition: TSQLStructure.cxx:82
TSQLStructure::SetType
void SetType(Int_t typ)
Definition: TSQLStructure.h:121
TSQLStructure::ChildArrayIndex
void ChildArrayIndex(Int_t index, Int_t cnt=1)
set array index for last child element if (cnt<=1) return;
Definition: TSQLStructure.cxx:468
sqlio::LongStrPrefix
const char * LongStrPrefix
Definition: TSQLStructure.cxx:66
sqlio::UChar
const char * UChar
Definition: TSQLStructure.cxx:77
sqlio::Float
const char * Float
Definition: TSQLStructure.cxx:75
sqlio::cfg_UseIndexes
const char * cfg_UseIndexes
Definition: TSQLStructure.cxx:136
TSQLStructure::SetObjectRef
void SetObjectRef(Long64_t refid, const TClass *cl)
set structure type as kSqlObject
Definition: TSQLStructure.cxx:361
TSQLStructure::DefineElementColumnType
static Int_t DefineElementColumnType(TStreamerElement *elem, TSQLFile *f)
defines which kind of column can be assigned for this element Possible cases kColSimple - basic data ...
Definition: TSQLStructure.cxx:1923
TSQLStructure::Print
virtual void Print(Option_t *option="") const
print content of complete structure
Definition: TSQLStructure.cxx:667
sqlio::TObjectBits
const char * TObjectBits
Definition: TSQLStructure.cxx:57
sqlio::Array
const char * Array
Definition: TSQLStructure.cxx:68
TSQLStructure::PerformConversion
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,...
Definition: TSQLStructure.cxx:1216
sqlio::ULong
const char * ULong
Definition: TSQLStructure.cxx:80
TSQLObjectData
Definition: TSQLObjectData.h:47
sqlio::ObjectsTable
const char * ObjectsTable
Definition: TSQLStructure.cxx:89
TObjArray.h
TSQLStructure::kSqlObjectData
@ kSqlObjectData
Definition: TSQLStructure.h:189
sqlio::KeysTableIndex
const char * KeysTableIndex
Definition: TSQLStructure.cxx:88
TSQLStructure::kSqlArray
@ kSqlArray
Definition: TSQLStructure.h:188
sqlio::ObjectRef
const char * ObjectRef
Definition: TSQLStructure.cxx:51
TSQLStructure::SetStreamerInfo
void SetStreamerInfo(const TStreamerInfo *info)
set structure type as kSqlStreamerInfo
Definition: TSQLStructure.cxx:401
TClass
Definition: TClass.h:80
TSQLStructure::IsNumericType
static Bool_t IsNumericType(Int_t typ)
defines if value is numeric and not requires quotes when writing
Definition: TSQLStructure.cxx:729
sqlio::cfg_TablesType
const char * cfg_TablesType
Definition: TSQLStructure.cxx:134
sqlio::ConfigTable
const char * ConfigTable
Definition: TSQLStructure.cxx:94
TSQLStructure::ConvertToTables
Bool_t ConvertToTables(TSQLFile *f, Long64_t keyid, TObjArray *cmds)
Convert structure to sql statements This function is called immidiately after TBufferSQL2 produces th...
Definition: TSQLStructure.cxx:1188
TSQLStructure::GetCustomClassVersion
Version_t GetCustomClassVersion() const
return custom class version if structures is kSqlCustomClass
Definition: TSQLStructure.cxx:544
TObject
Definition: TObject.h:37
ClassDef
#define ClassDef(name, id)
Definition: Rtypes.h:325
TSQLStructure::kColRawData
@ kColRawData
Definition: TSQLStructure.h:205
sqlio::KT_Name
const char * KT_Name
Definition: TSQLStructure.cxx:97
TSQLStructure::PrintLevel
void PrintLevel(Int_t level) const
print content of current structure
Definition: TSQLStructure.cxx:675
TSQLStructure::StoreObject
Bool_t StoreObject(TSqlRegistry *reg, Long64_t objid, TClass *cl, Bool_t registerobj=kTRUE)
convert object data to sql statements if normal (column-wise) representation is not possible,...
Definition: TSQLStructure.cxx:1329
sqlio::OT_Version
const char * OT_Version
Definition: TSQLStructure.cxx:109
sqlio::ULong64
const char * ULong64
Definition: TSQLStructure.cxx:81
TSQLTableData::HasSQLName
Bool_t HasSQLName(const char *sqlname)
checks if columns list already has that sql name
Definition: TSQLStructure.cxx:274
name
char name[80]
Definition: TGX11.cxx:110
sqlio::OT_Class
const char * OT_Class
Definition: TSQLStructure.cxx:108
sqlio::ObjectsTableIndex
const char * ObjectsTableIndex
Definition: TSQLStructure.cxx:90
TSQLColumnData::fType
TString fType
! type of the table column
Definition: TSQLStructure.h:41
TSQLStructure::UnpackTObject
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.
Definition: TSQLStructure.cxx:2302
sqlio::Long64
const char * Long64
Definition: TSQLStructure.cxx:74
TSQLStructure::kIdRawTable
@ kIdRawTable
Definition: TSQLStructure.h:208
TSQLStructure::GetElementNumber
Int_t GetElementNumber() const
returns number of TStremerElement in TStreamerInfo
Definition: TSQLStructure.cxx:520
TSQLStructure::GetParent
TSQLStructure * GetParent() const
Definition: TSQLStructure.h:116
TSQLStructure::kColTString
@ kColTString
Definition: TSQLStructure.h:204
sqlio::KeysTable
const char * KeysTable
Definition: TSQLStructure.cxx:87
TSQLStructure::kSqlValue
@ kSqlValue
Definition: TSQLStructure.h:187
sqlio::KT_Class
const char * KT_Class
Definition: TSQLStructure.cxx:101
sqlio::ST_Value
const char * ST_Value
Definition: TSQLStructure.cxx:124
sqlio::Ids_FirstKey
const Int_t Ids_FirstKey
Definition: TSQLStructure.cxx:48
TSQLStructure::kColNormObjectArray
@ kColNormObjectArray
Definition: TSQLStructure.h:202
xmlio::cnt
const char * cnt
Definition: TXMLSetup.cxx:81
sqlio::Char
const char * Char
Definition: TSQLStructure.cxx:70
sqlio::BT_Value
const char * BT_Value
Definition: TSQLStructure.cxx:121
sqlio::cfg_ArrayLimit
const char * cfg_ArrayLimit
Definition: TSQLStructure.cxx:133
TSQLColumnData::fValue
TString fValue
! value of the table column
Definition: TSQLStructure.h:42
sqlio::False
const char * False
Definition: TSQLStructure.cxx:84
sqlio::ParentSuffix
const char * ParentSuffix
Definition: TSQLStructure.cxx:62
TSQLStructure::kColParent
@ kColParent
Definition: TSQLStructure.h:198
sqlio::Ids_TSQLFile
const Int_t Ids_TSQLFile
Definition: TSQLStructure.cxx:46
TSQLStructure::StoreTObject
Bool_t StoreTObject(TSqlRegistry *reg)
store data of TObject in special table workaround custom TObject streamer
Definition: TSQLStructure.cxx:1799
TStreamerElement
Definition: TStreamerElement.h:33
TSQLStructure::GetArrayIndex
Int_t GetArrayIndex() const
Definition: TSQLStructure.h:148
TSQLStructure::GetStreamerInfo
TStreamerInfo * GetStreamerInfo() const
return TStreamerInfo* if type is kSqlStreamerInfo
Definition: TSQLStructure.cxx:504
TSQLStructure::kSqlPointer
@ kSqlPointer
Definition: TSQLStructure.h:182
TSQLStructure::kColObject
@ kColObject
Definition: TSQLStructure.h:199
TSQLTableData
Definition: TSQLStructure.h:59
TSQLStructure::SetCustomElement
void SetCustomElement(TStreamerElement *elem)
set structure type as kSqlCustomElement
Definition: TSQLStructure.cxx:430
TSQLTableData::fFile
TSQLFile * fFile
!
Definition: TSQLStructure.h:62
TSQLStructure::fArrayIndex
Int_t fArrayIndex
Definition: TSQLStructure.h:108
TSQLFile
Definition: TSQLFile.h:30
int
TSQLTableData::fInfo
TSQLClassInfo * fInfo
!
Definition: TSQLStructure.h:63
TSQLTableData::TSQLTableData
TSQLTableData(TSQLFile *f=nullptr, TSQLClassInfo *info=nullptr)
normal constructor
Definition: TSQLStructure.cxx:180