TDbi.hxx

Go to the documentation of this file.
00001 // $Id: TDbi.hxx,v 1.1 2011/01/18 05:49:19 finch Exp $
00002 
00003 #ifndef XYZDBI_H
00004 #define XYZDBI_H
00005 
00006 
00007 
00008 
00009 #include <map>
00010 #include <string>
00011 #include "TVldContext.hxx"
00012 #include "TVldTimeStamp.hxx"
00013 
00014 
00015 #include "EoaCore.hxx"
00016     OA_EXCEPTION(EOfflineDatabase,EoaCore);
00017     OA_EXCEPTION(ENoEnvironment,EOfflineDatabase);
00018     OA_EXCEPTION(EBadDatabase,EOfflineDatabase);
00019     OA_EXCEPTION(EQueryFailed,EOfflineDatabase);
00020     OA_EXCEPTION(EBadConnection,EOfflineDatabase);
00021     OA_EXCEPTION(EBadTDbiRegistryKeys,EOfflineDatabase);
00022 
00023 
00024 class TList;
00025 namespace TDbi
00026 
00027 {
00028 
00029 ///
00030 /// \brief
00031 /// <b>Concept</b> Package-wide namespace of utilities  and typedef/enums.
00032 ///
00033 /// <b>Purpose</b> To provide standard  of utilities  and typedef/enums.
00034 ///
00035 /// Contact: A.Finch@lancaster.ac.uk
00036 ///
00037 
00038 // Types and enum
00039 
00040 typedef  Int_t Task;
00041 
00042  enum TaskTypes{  kAnyTask     = -1,   // Use to disable task selection in context queries.
00043                   kDefaultTask = 0
00044  };
00045 
00046  enum TypeRegimes{ kRootRegime = 0,
00047                    kSQLRegime  = 1
00048 };
00049 
00050  enum DataTypes{ kUnknown,
00051                  kBool,      // concept
00052                  kChar,      // concept
00053                  kUChar,     // concept
00054                  kTiny,
00055                  kUTiny,
00056                  kShort,
00057                  kUShort,
00058                  kInt,       // concept
00059                  kUInt,      // concept
00060                  kLong,
00061                  kULong,
00062                  kFloat,     // concept
00063                  kDouble,
00064                  kString,    // concept
00065                  kTString,
00066                  kDate       // concept
00067  };
00068 
00069 
00070  enum DbTypes{  kMySQL         = 0
00071  };
00072 
00073  enum AbortTest{ kDisabled,
00074                  kTableMissing,
00075                  kDataMissing
00076  };
00077 
00078   enum { kMAXLOCALSEQNO   = 99999999,    // Max local SeqNo.
00079          kMAXTABLENAMELEN = 80};         // Max length of table name.
00080 
00081      std::string GetVldDescr(const char* tableName,
00082                                    Bool_t isTemporary = false);  ///> Return SQL needed to create VLD table.
00083             void SetLogLevel(int level);
00084 
00085 
00086 ///  Time gates for each table in secs. Used to trim validity searches.
00087         Int_t GetTimeGate(const std::string& tableName);
00088          void SetTimeGate(const std::string& tableName, Int_t timeGate);
00089 
00090 
00091 /// DateTime conversion utilities.
00092   std::string MakeDateTimeString(const TVldTimeStamp& timeStamp);
00093  TVldTimeStamp MakeTimeStamp(const std::string& sqlDateTime,
00094                                   Bool_t* ok =0);
00095 
00096 
00097 /// SeqNo utilities
00098    Bool_t NotGlobalSeqNo(UInt_t seqNo);
00099 
00100 
00101 
00102 
00103 }
00104 #endif  // XYZDBI_H
00105 

Generated on 11 Aug 2013 for SKDatabase by  doxygen 1.6.1