00001
00002
00003 #ifndef DBMLOGFILE
00004 #define DBMLOGFILE
00005
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00018
00019
00020 #include <fstream>
00021 #include <list>
00022 #include <map>
00023 #include <string>
00024 using std::string;
00025
00026 #include "Rtypes.h"
00027
00028 class DbiValidityRec;
00029 class DbmCmdOptions;
00030
00031 class DbmLogFile
00032 {
00033
00034 public:
00035
00036
00037 DbmLogFile(const string& fileName = "",UInt_t dbNo = 0);
00038 virtual ~DbmLogFile();
00039
00040
00041 Bool_t IsValid() const { return fLogFile && fLogFile->is_open(); }
00042
00043
00044 ofstream* GetStream() { return IsValid() ? fLogFile : 0; }
00045 void LogCmd(const string& cmd,const DbmCmdOptions& opts);
00046 void LogMsg(const string& msg,Bool_t addDateStamp=kTRUE);
00047 void LogRec(const DbiValidityRec* vrec =0);
00048 void LogRec(const string tableName, UInt_t seqNo);
00049
00050 private:
00051
00052
00053
00054
00055 UInt_t fDbNo;
00056 std::list<UInt_t> fLogDBSrcNos;
00057
00058 std::map<UInt_t,UInt_t> fLogNumSeqNo;
00059 std::map<UInt_t,UInt_t> fLogSeqNoMax;
00060 std::map<UInt_t,UInt_t> fLogSeqNoMin;
00061 string fLogTableName;
00062
00063 ofstream* fLogFile;
00064
00065 ClassDef(DbmLogFile,0)
00066
00067 };
00068
00069
00070 #endif // DBMLOGFILE