12 #ifndef ROOT_TSQLStructure
13 #define ROOT_TSQLStructure
19 #ifndef ROOT_TObjArray
153 void SetValue(
const char* value,
const char* tname = 0);
173 void AddValue(
const char* value,
const char* tname = 0);
268 extern const char*
Array;
269 extern const char*
Bool;
270 extern const char*
Char;
271 extern const char*
Short;
272 extern const char*
Int;
273 extern const char*
Long;
274 extern const char*
Long64;
275 extern const char*
Float;
276 extern const char*
Double;
277 extern const char*
UChar;
278 extern const char*
UShort;
279 extern const char*
UInt;
280 extern const char*
ULong;
283 extern const char*
True;
284 extern const char*
False;
void SetObjectData(TSQLObjectData *objdata)
set element to be used for object data
Describe Streamer information for one class version.
TString fName
! name of the table column
static Int_t DefineElementColumnType(TStreamerElement *elem, TSQLFile *f)
defines which kind of column can be assigned for this element Possible cases kColSimple - basic data ...
Bool_t StoreTObject(TSqlRegistry *reg)
store data of TObject in special table workaround custom TObject streamer
const char * IdsTableIndex
TStreamerInfo * GetStreamerInfo() const
return TStreamerInfo* if type is kSqlStreamerInfo
Long64_t FindMaxObjectId()
define maximum reference id, used for objects
static Bool_t IsNumericType(Int_t typ)
defines if value is numeric and not requires quotes when writing
TSQLStructure * GetChild(Int_t n) const
return child structure of index n
void AddValue(const char *value, const char *tname=0)
Add child structure as value.
Bool_t fNumeric
! for numeric quotes (double quotes) are not required
Bool_t GetClassInfo(TClass *&cl, Version_t &version)
provides class info if structure kSqlStreamerInfo or kSqlCustomClass
TSQLStructure * GetParent() const
const char * cfg_UseTransactions
ClassDef(TSQLStructure, 1)
TClass * GetCustomClass() const
return element custom class if strutures is kSqlCustomClass
static TString MakeArrayIndex(TStreamerElement *elem, Int_t n)
produce string with complete index like [1][2][0]
void PrintLevel(Int_t level) const
print content of current structure
Int_t GetNumColumns()
returns number of columns in provided set
TObjArray * fColInfos
! array with TSQLClassColumnInfo, used later for TSQLClassInfo
Contains information about tables specific to one class and version.
const char * GetValue() const
void SetVersion(const TClass *cl, Int_t version=-100)
set structure type as kSqlVersion
const char * cfg_LockingMode
void SetObjectRef(Long64_t refid, const TClass *cl)
set structure type as kSqlObject
void SetValue(const char *value, const char *tname=0)
set structure type as kSqlValue
ClassDef(TSQLTableData, 1)
void SetParent(TSQLStructure *p)
virtual const char * GetName() const
Returns name of object.
Int_t GetElementNumber() const
returns number of TStremerElement in TStreamerInfo
Bool_t CheckNormalClassPair(TSQLStructure *vers, TSQLStructure *info)
check if pair of two element corresponds to start of object, stored in normal form ...
const char * ParentSuffix
const char * cfg_UseIndexes
TObjArray * TakeColInfos()
take ownership over colinfos
void SetStreamerInfo(const TStreamerInfo *info)
set structure type as kSqlStreamerInfo
TSQLObjectData is used in TBufferSQL2 class in reading procedure.
const char * Data() const
void Add(TSQLStructure *child)
Add child strucure.
const char * StringsTable
const char * GetValue() const
returns value for different structure kinds has different sense For kSqlVersion it version...
Long64_t atol64(const char *value)
const char * TStringValue
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.
void SetStreamerElement(const TStreamerElement *elem, Int_t number)
set structure type as kSqlElement
const char * ObjectsTableIndex
TString fValue
! value of the table column
Bool_t RecognizeTString(const char *&value)
prove that structure containes TString data
void ChildArrayIndex(Int_t index, Int_t cnt=1)
set array index for last child element if (cnt<=1) return;
This is hierarhical structure, which is created when data is written by TBufferSQL2.
Bool_t StoreElementInNormalForm(TSqlRegistry *reg, TSQLTableData *columns)
tries to store element data in column
const char * cfg_TablesType
Bool_t TryConvertObjectArray(TSqlRegistry *reg, TSqlRawBuffer *blobs)
tries to write array of objects as lis of object refereneces in streamer table, while objects itself ...
Bool_t StoreTString(TSqlRegistry *reg)
store data of TString in special table it is required when TString stored as pointer and reference to...
Int_t LocateElementColumn(TSQLFile *f, TBufferSQL2 *buf, TSQLObjectData *data)
find column in TSQLObjectData object, which correspond to current element
virtual ~TSQLStructure()
destructor
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.
TSQLObjectData * GetObjectData(Bool_t search=false)
searchs for objects data
static TString DefineElementColumnName(TStreamerElement *elem, TSQLFile *f, Int_t indx=0)
returns name of the column in class table for that element
const char * KeysTableIndex
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...
void AddColumn(const char *name, Long64_t value)
Add INT column to list of columns.
Access an SQL db via the TFile interface.
void SetCustomClass(const TClass *cl, Version_t version)
set structure type as kSqlCustomClass
void ChangeValueOnly(const char *value)
change value of this structure used as "workaround" to keep object id in kSqlElement node ...
TString DefineSQLName(const char *fullname)
produce suitable name for column, taking into account length limitation
const char * ObjectSuffix
const char * LongStrPrefix
void SetArray(Int_t sz=-1)
Set structure as array element.
Bool_t HasSQLName(const char *sqlname)
checks if columns list already has that sql name
The ROOT global object gROOT contains a list of all defined classes.
void AddObjectData(TSQLObjectData *objdata)
add element with pointer to object data
TSQLTableData(TSQLFile *f=0, TSQLClassInfo *info=0)
normal constructor
const char * TObjectUniqueId
const char * ObjectRef_Arr
virtual ~TSQLColumnData()
TSQLColumnData destructor.
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...
Bool_t IsNumeric(Int_t n)
identifies if column has numeric value
void SetCustomElement(TStreamerElement *elem)
set structure type as kSqlCustomElement
const char * GetValueType() const
return value type if structure is kSqlValue
Converts data to SQL statements or read data from SQL tables.
const Int_t Ids_FirstObject
void SetObjectPointer(Long64_t ptrid)
set structure type as kSqlPointer
void AddVersion(const TClass *cl, Int_t version=-100)
add child as version
static const char * GetSimpleTypeName(Int_t typ)
provides name for basic types used as suffix for column name or field suffix in raw table ...
const Int_t Ids_StreamerInfos
Int_t NumChilds() const
number of child structures
const char * TObjectProcessId
const char * GetColumn(Int_t n)
returm column value
TStreamerElement * GetElement() const
return TStremerElement* if type is kSqlElement
static void AddStrBrackets(TString &s, const char *quote)
adds quotes arround string value and replaces some special symbols
Int_t GetRepeatCounter() const
ClassDef(TSQLColumnData, 1)
const char * cfg_ArrayLimit
Mother of all ROOT objects.
TString fType
! type of the table column
Version_t GetCustomClassVersion() const
return custom class version if strutures is kSqlCustomClass
const char * GetType() const
Bool_t StoreClassInNormalForm(TSqlRegistry *reg)
produces data for complete class table where not possible, raw data for some elements are created ...
const char * PointerSuffix
const char * ObjectsTable
Long64_t DefineObjectId(Bool_t recursive=kTRUE)
defines current object id, to which this structure belong make life complicated, because some objects...
TClass * GetObjectClass() const
return object class if type kSqlObject
Bool_t StoreObjectInNormalForm(TSqlRegistry *reg)
this function verify object child elements and calls transformation to class table ...
Bool_t ConvertToTables(TSQLFile *f, Long64_t keyid, TObjArray *cmds)
Convert structure to sql statements This function is called immidiately after TBufferSQL2 produces th...
virtual void Print(Option_t *option="") const
print content of complete structure
Int_t GetArrayIndex() const
TClass * GetVersionClass() const
return class for version tag if type is kSqlVersion
TObjArray fColumns
! collection of columns
const char * cfg_UseSufixes
virtual ~TSQLTableData()
destructor
void SetArrayIndex(Int_t indx, Int_t cnt=1)
set array index for this structure
const char * cfg_ModifyCounter
void SetClassStreamer(const TClass *cl)
set structure type as kSqlClassStreamer