// $Id: IDbi.hxx,v 1.1 2011/01/18 05:49:19 finch Exp $ #ifndef XYZDBI_H #define XYZDBI_H #include #include #include "IVldContext.hxx" #include "IVldTimeStamp.hxx" #include "EoaCore.hxx" namespace COMET { OA_EXCEPTION(EOfflineDatabase,EoaCore); OA_EXCEPTION(ENoEnvironment,EOfflineDatabase); OA_EXCEPTION(EBadDatabase,EOfflineDatabase); OA_EXCEPTION(EQueryFailed,EOfflineDatabase); OA_EXCEPTION(EBadConnection,EOfflineDatabase); OA_EXCEPTION(EBadTDbiRegistryKeys,EOfflineDatabase); } class TList; /// /// \brief /// Concept Package-wide namespace of utilities and typedef/enums. /// /// Purpose To provide standard of utilities and typedef/enums. /// /// Contact: A.Finch@lancaster.ac.uk /// namespace IDbi { // Types and enum typedef Int_t Task; enum TaskTypes{ kAnyTask = -1, // Use to disable task selection in context queries. kDefaultTask = 0 }; enum TypeRegimes{ kRootRegime = 0, kSQLRegime = 1 }; enum DataTypes{ kUnknown, kBool, // concept kChar, // concept kUChar, // concept kTiny, kUTiny, kShort, kUShort, kInt, // concept kUInt, // concept kLong, kULong, kFloat, // concept kDouble, kString, // concept kTString, kDate // concept }; enum DbTypes{ kMySQL = 0 }; enum AbortTest{ kDisabled, kTableMissing, kDataMissing }; enum { kMAXLOCALSEQNO = 99999999, // Max local SeqNo. kMAXTABLENAMELEN = 80}; // Max length of table name. std::string GetVldDescr(const char* tableName, Bool_t isTemporary = false); ///> Return SQL needed to create VLD table. void SetLogLevel(int level); /// Time gates for each table in secs. Used to trim validity searches. Int_t GetTimeGate(const std::string& tableName); void SetTimeGate(const std::string& tableName, Int_t timeGate); /// DateTime conversion utilities. std::string MakeDateTimeString(const COMET::IVldTimeStamp& timeStamp); COMET::IVldTimeStamp MakeTimeStamp(const std::string& sqlDateTime, Bool_t* ok =0); /// SeqNo utilities Bool_t NotGlobalSeqNo(UInt_t seqNo); } #endif // XYZDBI_H