EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairTSQLObject.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FairTSQLObject.h
1 /***************************************
2  * Author: M.Babai (M.Babai@rug.nl) *
3  * License: *
4  * Version: *
5  ***************************************/
6 #pragma once
7 #ifndef FAIR_TSQL_OBJECT_H
8 #define FAIR_TSQL_OBJECT_H
9 
10 #include <iostream>
11 
12 // ROOT
13 #include "TObject.h"
14 
15 class TDictionary;
16 class TClass;
17 class TList;
18 class TMethodCall;
19 class TMethod;
20 class TArrayC;
21 class TArrayI;
22 class TArrayF;
23 class TArrayD;
24 
32  CHAR = 2,
33  INT = 3,
34  FLOAT = 4,
35  DOUBLE = 5,
36  UINT = 6,
37  INT_ARRAY = 31,
44 
48 typedef union FairDBObjectMemberValues {
50  char c_val;
51  size_t Ui_Val;
52  int i_val;
53  float f_val;
54  double d_val;
55  TArrayI* I_Ar_val;
56  TArrayF* F_Ar_val;
57  TArrayD* D_Ar_val;
59 
65  //________ Constructor.
67  : type(UNKNOWN_TYPE),
68  c_val('a'), Ui_Val(0), i_val(0), f_val(0.0), d_val(0.0),
69  I_Ar_val(0), F_Ar_val(0), D_Ar_val(0)
70  {};
71 
73  : type(tp),
74  c_val('a'), Ui_Val(0), i_val(0), f_val(0.0), d_val(0.0),
75  I_Ar_val(0), F_Ar_val(0), D_Ar_val(0)
76  {};
77 
78  //________ Destructor.
80 
81  //________ Members.
83  char c_val;
84  size_t Ui_Val;
85  int i_val;
86  float f_val;
87  double d_val;
88  TArrayI* I_Ar_val;
89  TArrayF* F_Ar_val;
90  TArrayD* D_Ar_val;
91 
92  private:
93  // To avoid mistakes.
96 
97  ClassDef(FairDBObjectMemberValue, 0)
98 };
99 
101 class FairTSQLObject: virtual public TObject
102 {
103  public:
107  FairTSQLObject();
108 
112  virtual ~FairTSQLObject();
113 
117  TDictionary& GetcurDict();
118 
124  TClass& GetCurCls();
125 
131  TList& GetMemberList();
132 
139  TList& GetMethodList();
140 
149  virtual FairDBObjectMemberTypes GetMemberType(std::string const& mName);
150 
159  virtual std::string* GetMemberTypeName(std::string const& mName);
160  virtual std::string* GetMemberTypeName(char const* mName);
161 
169  TMethodCall* GetDataMemberGetter(std::string const& mName);
170 
178  FairDBObjectMemberValue* GetMember(std::string const& mName);
179 
187  TMethod* GetMethod(std::string const& methodName);
188 
195  std::string* GetMethodPrototype(std::string const& methodName);
196 
203  std::string* GetMethodReturnTypeName(std::string const& methodName);
204  std::string* GetMethodReturnTypeName(char const* methodName);
205 
206 
207  protected:
208  TClass* fCurCls;
209  TDictionary* fcurDict;
210  TList* fMemberList;
211  TList* fMethodList;
213  private:
214  // To avoid mistakes.
215  FairTSQLObject(FairTSQLObject const& ot);
217 
219  void InitCurClass();
220 
222  void InitMemList();
223 
225  void InitMethodList();
226 
227  ClassDef(FairTSQLObject, 0)
228 };
229 // ____ INLINE FUNCTIONS __________
230 //#ifndef __CINT__
231 //#endif /* __CINT__ */
232 #endif