Logo ROOT   6.12/07
Reference Guide
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 
19 class TObjArray;
20 
21 class TSQLClassColumnInfo : public TObject {
22 
23 public:
25  TSQLClassColumnInfo(const char *name, const char *sqlname, const char *sqltype);
26  virtual ~TSQLClassColumnInfo();
27 
28  virtual const char *GetName() const { return fName.Data(); }
29  const char *GetSQLName() const { return fSQLName.Data(); }
30  const char *GetSQLType() const { return fSQLType.Data(); }
31 
32 protected:
36 
37  ClassDef(TSQLClassColumnInfo, 1); // Keeps information about single column in class table
38 };
39 
40 //_________________________________________________________________________________
41 
42 class TSQLClassInfo : public TObject {
43 public:
44  TSQLClassInfo();
45  TSQLClassInfo(Long64_t classid, const char *classname, Int_t version);
46  virtual ~TSQLClassInfo();
47 
48  Long64_t GetClassId() const { return fClassId; }
49 
50  virtual const char *GetName() const { return fClassName.Data(); }
51  Int_t GetClassVersion() const { return fClassVersion; }
52 
53  void SetClassTableName(const char *name) { fClassTable = name; }
54  void SetRawTableName(const char *name) { fRawTable = name; }
55 
56  const char *GetClassTableName() const { return fClassTable.Data(); }
57  const char *GetRawTableName() const { return fRawTable.Data(); }
58 
59  void SetTableStatus(TObjArray *columns = 0, Bool_t israwtable = kFALSE);
60  void SetColumns(TObjArray *columns);
61  void SetRawExist(Bool_t on) { fRawtableExist = on; }
62 
63  Bool_t IsClassTableExist() const { return GetColumns() != 0; }
64  Bool_t IsRawTableExist() const { return fRawtableExist; }
65 
66  TObjArray *GetColumns() const { return fColumns; }
67  Int_t FindColumn(const char *name, Bool_t sqlname = kFALSE);
68 
69 protected:
70  TString fClassName; ///<! class name
71  Int_t fClassVersion; ///<! class version
72  Long64_t fClassId; ///<! sql class id
73  TString fClassTable; ///<! name of table with class data
74  TString fRawTable; ///<! name of table with raw data
75  TObjArray *fColumns; ///<! name and type of columns - array of TNamed
76  Bool_t fRawtableExist; ///<! indicate that raw table is exist
77 
78  ClassDef(TSQLClassInfo, 1); // Keeps the table information relevant for one class
79 };
80 
81 #endif
TObjArray * GetColumns() const
Definition: TSQLClassInfo.h:66
void SetClassTableName(const char *name)
Definition: TSQLClassInfo.h:53
An array of TObjects.
Definition: TObjArray.h:37
long long Long64_t
Definition: RtypesCore.h:69
const char * GetClassTableName() const
Definition: TSQLClassInfo.h:56
void SetRawTableName(const char *name)
Definition: TSQLClassInfo.h:54
virtual const char * GetName() const
Returns name of object.
Definition: TSQLClassInfo.h:50
Contains information about tables specific to one class and version.
Definition: TSQLClassInfo.h:42
Basic string class.
Definition: TString.h:125
int Int_t
Definition: RtypesCore.h:41
bool Bool_t
Definition: RtypesCore.h:59
virtual ~TSQLClassColumnInfo()
destructor
Long64_t fClassId
! sql class id
Definition: TSQLClassInfo.h:72
TObjArray * fColumns
! name and type of columns - array of TNamed
Definition: TSQLClassInfo.h:75
#define ClassDef(name, id)
Definition: Rtypes.h:320
TString fClassName
! class name
Definition: TSQLClassInfo.h:70
Long64_t GetClassId() const
Definition: TSQLClassInfo.h:48
Bool_t IsClassTableExist() const
Definition: TSQLClassInfo.h:63
const char * GetSQLName() const
Definition: TSQLClassInfo.h:29
TSQLClassColumnInfo()
default constructor
TString fClassTable
! name of table with class data
Definition: TSQLClassInfo.h:73
void SetRawExist(Bool_t on)
Definition: TSQLClassInfo.h:61
Bool_t fRawtableExist
! indicate that raw table is exist
Definition: TSQLClassInfo.h:76
const char * GetRawTableName() const
Definition: TSQLClassInfo.h:57
const Bool_t kFALSE
Definition: RtypesCore.h:88
Int_t GetClassVersion() const
Definition: TSQLClassInfo.h:51
const char * GetSQLType() const
Definition: TSQLClassInfo.h:30
Mother of all ROOT objects.
Definition: TObject.h:37
Int_t fClassVersion
! class version
Definition: TSQLClassInfo.h:71
virtual const char * GetName() const
Returns name of object.
Definition: TSQLClassInfo.h:28
TString fRawTable
! name of table with raw data
Definition: TSQLClassInfo.h:74
Bool_t IsRawTableExist() const
Definition: TSQLClassInfo.h:64
char name[80]
Definition: TGX11.cxx:109
const char * Data() const
Definition: TString.h:345