Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

DbiLogEntry.h

Go to the documentation of this file.
00001 #ifndef DBILOGENTRY_H
00002 #define DBILOGENTRY_H
00003 
00025 #include <string>
00026 using std::string;
00027 #include <iosfwd>
00028 
00029 #include "TObject.h"
00030 
00031 #include "Conventions/Detector.h"
00032 #include "Conventions/SimFlag.h"
00033 #include "DatabaseInterface/Dbi.h"
00034 #include "DatabaseInterface/DbiTableRow.h"
00035 #include "Validity/VldTimeStamp.h"
00036 #include "LeakChecker/Lea.h"
00037 
00038 class DbiLogEntry;
00039 class DbiOutRowStream;
00040 class DbiResultSet;
00041 class DbiTableProxy;
00042 class DbiValidityRec;
00043 
00044 std::ostream& operator<<(std::ostream& s, const DbiLogEntry& logEntry);
00045 
00046 class DbiLogEntry : public DbiTableRow
00047 {
00048 
00049 public:
00050 
00051   using TObject::Write;
00052 
00053 // Constructors and destructors.
00054   DbiLogEntry(const string& tableName = "",
00055               const string& reason = "",
00056               Int_t detMask = Detector::FullMask(),
00057               Int_t simMask = SimFlag::FullMask(),
00058               Dbi::Task task = 0,
00059               Int_t logSeqNoMin = 0,
00060               Int_t logSeqNoMax = 0,
00061               Int_t logNumSeqNo = 0);
00062   virtual ~DbiLogEntry();
00063 
00064 // State testing member functions.
00065 
00066 // Inherited responsibilities.
00067   virtual DbiTableRow* CreateTableRow() const { 
00068                                               return new DbiLogEntry; }
00069          Int_t GetAggregateNo() const { return -1; }
00070 
00071 // New member functions.
00072  const string& GetLogTableName() const { return fLogTableName; }
00073          Int_t GetDetectorMask() const { return fLogDetMask; }
00074          Int_t GetLogSeqNoMin() const { return fLogSeqNoMin; }
00075          Int_t GetLogSeqNoMax() const { return fLogSeqNoMax; }
00076          Int_t GetLogNumSeqNo() const { return fLogNumSeqNo; }
00077          Int_t GetSimMask() const { return fLogSimMask; }
00078      Dbi::Task GetTask() const { return fLogTask; }
00079  const string& GetUserName() const { return fUserName; }
00080  const string& GetProcessName() const { return fProcessName; }
00081  const string& GetHostName() const { return fHostName; }
00082  const string& GetServerName() const { return fServerName; }
00083  const string& GetReason() const { return fReason; }
00084   VldTimeStamp GetUpdateTime() const { return fUpdateTime; }
00085 
00086         Bool_t HasReason() const { return fReason.size() > 0; }
00087 
00088 // State changing member functions
00089           void SetReason(const string& reason);
00090           void SetDetectorMask(Int_t detMask) { fLogDetMask = detMask; }
00091           void SetSimMask(Int_t simMask) { fLogSimMask = simMask; }
00092           void SetTask(Dbi::Task task) { fLogTask = task; }
00093           void SetUpdateTime(const VldTimeStamp& updateTime) { 
00094                                          fUpdateTime = updateTime; }
00095           void Recreate (const string& tableName = "",
00096                          const string& reason = "",
00097                          Int_t detMask = Detector::FullMask(),
00098                          Int_t simMask = SimFlag::FullMask(),
00099                          Dbi::Task task = 0,
00100                          Int_t logSeqNoMin = 0,
00101                          Int_t logSeqNoMax = 0,
00102                          Int_t logNumSeqNo = 0);
00103 
00104 // I/O  member functions
00105   virtual void Fill(DbiResultSet& rs,
00106                     const DbiValidityRec* vrec);
00107   virtual void Store(DbiOutRowStream& ors,
00108                     const DbiValidityRec* vrec) const;
00109   Bool_t Write(UInt_t dbNo,Int_t logSeqNo=0);
00110 
00111 private:  
00112 // Constructors and destructors.
00113   DbiLogEntry(const DbiLogEntry& from); // No!
00114 
00115   void SetServerName();
00116  
00117 // Data members 
00118 
00120   UInt_t fDbNo;           
00121 
00123   Int_t fSeqNo;           
00124 
00126   string fLogTableName;    
00127 
00129   Int_t fLogDetMask;      
00130 
00132   Int_t fLogSimMask;      
00133 
00135   Dbi::Task fLogTask;     
00136 
00138   Int_t fLogSeqNoMin;     
00139 
00141   Int_t fLogSeqNoMax;     
00142 
00144   Int_t fLogNumSeqNo;     
00145 
00147   VldTimeStamp fUpdateTime;
00148 
00150   string fUserName;        
00151 
00153   string fProcessName;     
00154 
00156   string fHostName;        
00157 
00159   string fServerName;      
00160 
00162   string fReason;          
00163 
00164 
00165 // Note: fLogDetMask,fLogSimMask,fLogTask,fUpdateTime are used to construct the DbiValidityRec
00166 //       of the update; they are not store in main table.
00167 
00168 ClassDef(DbiLogEntry,0)    // Configuration data. 
00169 
00170 };
00171 
00172 
00173 #endif  // DBILOGENTRY_H

Generated on Mon Feb 15 11:06:34 2010 for loon by  doxygen 1.3.9.1