Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
TSQLClassInfo.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_TSQLClassInfo
13#define ROOT_TSQLClassInfo
14
15#include "TObject.h"
16
17#include "TString.h"
18
19class TObjArray;
20
21class TSQLClassColumnInfo final : public TObject {
22
23public:
24 TSQLClassColumnInfo() {} // NOLINT: not allowed to use = default because of TObject::kIsOnHeap detection, see ROOT-10300
25 TSQLClassColumnInfo(const char *name, const char *sqlname, const char *sqltype);
26
27 const char *GetName() const final { return fName.Data(); }
28 const char *GetSQLName() const { return fSQLName.Data(); }
29 const char *GetSQLType() const { return fSQLType.Data(); }
30
31protected:
35
36 ClassDefOverride(TSQLClassColumnInfo, 1); // Keeps information about single column in class table
37};
38
39//_________________________________________________________________________________
40
41class TSQLClassInfo final : public TObject {
42public:
43 TSQLClassInfo() {} // NOLINT: not allowed to use = default because of TObject::kIsOnHeap detection, see ROOT-10300
44 TSQLClassInfo(Long64_t classid, const char *classname, Int_t version);
45 virtual ~TSQLClassInfo();
46
47 Long64_t GetClassId() const { return fClassId; }
48
49 const char *GetName() const final { return fClassName.Data(); }
51
52 void SetClassTableName(const char *name) { fClassTable = name; }
53 void SetRawTableName(const char *name) { fRawTable = name; }
54
55 const char *GetClassTableName() const { return fClassTable.Data(); }
56 const char *GetRawTableName() const { return fRawTable.Data(); }
57
58 void SetTableStatus(TObjArray *columns = 0, Bool_t israwtable = kFALSE);
59 void SetColumns(TObjArray *columns);
61
62 Bool_t IsClassTableExist() const { return GetColumns() != 0; }
64
65 TObjArray *GetColumns() const { return fColumns; }
66 Int_t FindColumn(const char *name, Bool_t sqlname = kFALSE);
67
68protected:
69 TString fClassName; ///<! class name
70 Int_t fClassVersion{0}; ///<! class version
71 Long64_t fClassId{0}; ///<! sql class id
72 TString fClassTable; ///<! name of table with class data
73 TString fRawTable; ///<! name of table with raw data
74 TObjArray *fColumns{nullptr}; ///<! name and type of columns - array of TNamed
75 Bool_t fRawtableExist{kFALSE}; ///<! indicate that raw table is exist
76
77 ClassDefOverride(TSQLClassInfo, 1); // Keeps the table information relevant for one class
78};
79
80#endif
int Int_t
Definition RtypesCore.h:45
const Bool_t kFALSE
Definition RtypesCore.h:92
bool Bool_t
Definition RtypesCore.h:63
long long Long64_t
Definition RtypesCore.h:73
char name[80]
Definition TGX11.cxx:110
An array of TObjects.
Definition TObjArray.h:37
Mother of all ROOT objects.
Definition TObject.h:37
const char * GetSQLName() const
const char * GetSQLType() const
ClassDefOverride(TSQLClassColumnInfo, 1)
const char * GetName() const final
Returns name of object.
Contains information about tables specific to one class and version.
Bool_t IsClassTableExist() const
void SetRawTableName(const char *name)
Int_t FindColumn(const char *name, Bool_t sqlname=kFALSE)
Search for column of that name.
Int_t fClassVersion
! class version
TString fRawTable
! name of table with raw data
Long64_t fClassId
! sql class id
virtual ~TSQLClassInfo()
destructor
void SetRawExist(Bool_t on)
void SetClassTableName(const char *name)
TString fClassName
! class name
Int_t GetClassVersion() const
const char * GetName() const final
Returns name of object.
Long64_t GetClassId() const
const char * GetClassTableName() const
Bool_t fRawtableExist
! indicate that raw table is exist
TObjArray * GetColumns() const
void SetTableStatus(TObjArray *columns=0, Bool_t israwtable=kFALSE)
set current status of class tables
const char * GetRawTableName() const
TObjArray * fColumns
! name and type of columns - array of TNamed
ClassDefOverride(TSQLClassInfo, 1)
void SetColumns(TObjArray *columns)
assigns new list of columns
TString fClassTable
! name of table with class data
Bool_t IsRawTableExist() const
Basic string class.
Definition TString.h:136
const char * Data() const
Definition TString.h:369