Logo ROOT   6.18/05
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
19class TObjArray;
20
22
23public:
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
32protected:
36
37 ClassDef(TSQLClassColumnInfo, 1); // Keeps information about single column in class table
38};
39
40//_________________________________________________________________________________
41
42class TSQLClassInfo : public TObject {
43public:
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(); }
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);
62
63 Bool_t IsClassTableExist() const { return GetColumns() != 0; }
65
66 TObjArray *GetColumns() const { return fColumns; }
67 Int_t FindColumn(const char *name, Bool_t sqlname = kFALSE);
68
69protected:
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
int Int_t
Definition: RtypesCore.h:41
const Bool_t kFALSE
Definition: RtypesCore.h:88
bool Bool_t
Definition: RtypesCore.h:59
long long Long64_t
Definition: RtypesCore.h:69
#define ClassDef(name, id)
Definition: Rtypes.h:326
char name[80]
Definition: TGX11.cxx:109
An array of TObjects.
Definition: TObjArray.h:37
Mother of all ROOT objects.
Definition: TObject.h:37
const char * GetSQLName() const
Definition: TSQLClassInfo.h:29
TSQLClassColumnInfo()
default constructor
const char * GetSQLType() const
Definition: TSQLClassInfo.h:30
virtual const char * GetName() const
Returns name of object.
Definition: TSQLClassInfo.h:28
virtual ~TSQLClassColumnInfo()
destructor
Contains information about tables specific to one class and version.
Definition: TSQLClassInfo.h:42
Bool_t IsClassTableExist() const
Definition: TSQLClassInfo.h:63
void SetRawTableName(const char *name)
Definition: TSQLClassInfo.h:54
Int_t FindColumn(const char *name, Bool_t sqlname=kFALSE)
Search for column of that name.
Int_t fClassVersion
! class version
Definition: TSQLClassInfo.h:71
TString fRawTable
! name of table with raw data
Definition: TSQLClassInfo.h:74
Long64_t fClassId
! sql class id
Definition: TSQLClassInfo.h:72
virtual ~TSQLClassInfo()
destructor
void SetRawExist(Bool_t on)
Definition: TSQLClassInfo.h:61
void SetClassTableName(const char *name)
Definition: TSQLClassInfo.h:53
TString fClassName
! class name
Definition: TSQLClassInfo.h:70
Int_t GetClassVersion() const
Definition: TSQLClassInfo.h:51
Long64_t GetClassId() const
Definition: TSQLClassInfo.h:48
const char * GetClassTableName() const
Definition: TSQLClassInfo.h:56
Bool_t fRawtableExist
! indicate that raw table is exist
Definition: TSQLClassInfo.h:76
TObjArray * GetColumns() const
Definition: TSQLClassInfo.h:66
void SetTableStatus(TObjArray *columns=0, Bool_t israwtable=kFALSE)
set current status of class tables
const char * GetRawTableName() const
Definition: TSQLClassInfo.h:57
TObjArray * fColumns
! name and type of columns - array of TNamed
Definition: TSQLClassInfo.h:75
virtual const char * GetName() const
Returns name of object.
Definition: TSQLClassInfo.h:50
void SetColumns(TObjArray *columns)
assigns new list of columns
TString fClassTable
! name of table with class data
Definition: TSQLClassInfo.h:73
Bool_t IsRawTableExist() const
Definition: TSQLClassInfo.h:64
TSQLClassInfo()
default constructor
Basic string class.
Definition: TString.h:131
const char * Data() const
Definition: TString.h:364