00001 00002 // 00003 // Class AlephSession 00004 // 00005 // The Base Class for an AlephSession. 00006 // It is a Singleton 00007 // 00008 // Author : G. Dissertori , 30.10.98 00009 // Modified: C. Delaere , 16.08.02 renewed timing 00010 // 00012 00013 #ifndef ALEPHSESSION_H 00014 #define ALEPHSESSION_H 00015 00016 #include <string> 00017 #include <time.h> 00018 00019 // set the version 00020 static float AlephSessionVersion = 1.1; 00021 // enumeration of return values 00022 enum AlephRC { AlephOK=1 , AlephERROR=0 }; 00023 // forward declaration of the AlephManager 00024 class AlephManager; 00026 class AlephSession { 00027 public: 00028 00030 static AlephSession* TheAlephSession(); 00032 void setSessionType(const string& theType); 00034 string sessionType() const; 00036 AlephRC initialize(); 00038 AlephRC run(); 00040 AlephRC terminate(); 00042 AlephManager* aAlephManager(const string& aManager) const; 00043 // monitoring 00044 void startTimer(bool precision=false); 00045 void stopTimer(bool precision=false); 00047 void setDebugLevel(const int& aLevel); 00049 int debugLevel() const; 00050 00051 protected: 00052 00053 // the protected constructor 00054 AlephSession(); 00055 // the protected destructor 00056 ~AlephSession(); 00057 00058 private: 00059 00060 // the pointer to the single static instance 00061 static AlephSession* _theAlephSession; 00062 // the character string describing the session type 00063 string _thisSessionType; 00064 // pointers to the various manager 00065 AlephManager* _theAlephDbManager; // database manager 00066 AlephManager* _theAlephIoManager; // IO manager 00067 AlephManager* _theAlephExManager; // execution manager 00068 // monitoring 00069 time_t _startTime; //starting time 00070 time_t _endTime; //ending time 00071 clock_t _startClock; 00072 clock_t _endClock; 00073 double init_time; 00074 double run_time; 00075 double term_time; 00076 // debug output level 00077 int _debugLevel; 00078 }; 00079 00080 00081 00082 00083 00084 #endif