EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairDb.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FairDb.h
1 #ifndef FAIRDB_H
2 #define FAIRDB_H
3 
4 #include <map>
5 #include <string>
6 #include <iostream>
7 #ifndef ROOT_Rtypes
8 #if !defined(__CINT__) || defined(__MAKECINT__)
9 #include "Rtypes.h"
10 #endif
11 #endif
12 #include "TString.h"
13 #include "ValContext.h"
14 #include "ValTimeStamp.h"
15 
16 using namespace std;
17 
18 namespace FairDb
19 {
20 
21 
22 typedef Int_t Task;
23 
24 enum TaskTypes { kAnyTask = -1, // Use to disable task selection in context queries.
26  };
27 
30  };
31 
32 
33 
35  kBool, // concept
36  kChar, // concept
37  kUChar, // concept
42  kInt, // concept
43  kUInt, // concept
46  kFloat, // concept
48  kString, // concept
50  kDate // concept
51  };
52 
53 
54 enum DbTypes { kUnknownDbType = -1,
55  kMySQL = 0,
56  kOracle = 1
57  };
58 
62  };
63 
64 enum {
65  // Max local Sequence No
66  kMAXLOCALSEQNO = 99999999,
67  // Max. length of a table name
69 };
70 
71 
72 
73 
74 // Time gates for each table in secs.
75 // Used to trim validity searches.
76 Int_t GetTimeGate(const std::string& tableName);
77 void SetTimeGate(const std::string& tableName, Int_t timeGate);
78 
79 
80 // DateTime conversion utilities.
81 TString MakeDateTimeString(const ValTimeStamp& timeStamp);
82 ValTimeStamp MakeTimeStamp(const std::string& sqlDateTime,
83  Bool_t* ok =0);
84 
85 TString GetValDescr(const char* tableName,
86  Bool_t isTemporary = kFALSE);
87 
88 Bool_t NotGlobalSeqNo(UInt_t seqNo);
89 }
90 
91 #endif // FAIRDB_H