TDbiLogEntry.hxx
Go to the documentation of this file.00001 #ifndef DBILOGENTRY_H
00002 #define DBILOGENTRY_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #include <string>
00025 using std::string;
00026 #include <iosfwd>
00027
00028 #include "TObject.h"
00029
00030 #include "DbiDetector.hxx"
00031 #include "DbiSimFlag.hxx"
00032 #include "TDbi.hxx"
00033 #include "TDbiTableRow.hxx"
00034 #include "TVldTimeStamp.hxx"
00035
00036 #include "TDbiResultSetHandle.hxx"
00037
00038
00039
00040 class TDbiLogEntry;
00041 class TDbiOutRowStream;
00042 class TDbiInRowStream;
00043 class TDbiTableProxy;
00044 class TDbiValidityRec;
00045
00046
00047 std::ostream& operator<<(std::ostream& s, const TDbiLogEntry& logEntry);
00048
00049 class TDbiLogEntry : public TDbiTableRow
00050 {
00051
00052 public:
00053
00054 using TObject::Write;
00055
00056
00057 TDbiLogEntry(const string& tableName = "",
00058 const string& reason = "",
00059 Int_t detMask = DbiDetector::FullMask(),
00060 Int_t simMask = DbiSimFlag::FullMask(),
00061 TDbi::Task task = 0,
00062 Int_t logSeqNoMin = 0,
00063 Int_t logSeqNoMax = 0,
00064 Int_t logNumSeqNo = 0);
00065 virtual ~TDbiLogEntry();
00066
00067
00068
00069
00070 virtual TDbiTableRow* CreateTableRow() const {
00071 return new TDbiLogEntry; }
00072 Int_t GetAggregateNo() const { return -1; }
00073
00074
00075 const string& GetLogTableName() const { return fLogTableName; }
00076 Int_t GetDetectorMask() const { return fLogDetMask; }
00077 Int_t GetLogSeqNoMin() const { return fLogSeqNoMin; }
00078 Int_t GetLogSeqNoMax() const { return fLogSeqNoMax; }
00079 Int_t GetLogNumSeqNo() const { return fLogNumSeqNo; }
00080 Int_t GetSimMask() const { return fLogSimMask; }
00081 TDbi::Task GetTask() const { return fLogTask; }
00082 const string& GetUserName() const { return fUserName; }
00083 const string& GetProcessName() const { return fProcessName; }
00084 const string& GetHostName() const { return fHostName; }
00085 const string& GetServerName() const { return fServerName; }
00086 const string& GetReason() const { return fReason; }
00087 TVldTimeStamp GetUpdateTime() const { return fUpdateTime; }
00088
00089 Bool_t HasReason() const { return fReason.size() > 0; }
00090
00091
00092 void SetReason(const string& reason);
00093 void SetDetectorMask(Int_t detMask) { fLogDetMask = detMask; }
00094 void SetSimMask(Int_t simMask) { fLogSimMask = simMask; }
00095 void SetTask(TDbi::Task task) { fLogTask = task; }
00096 void SetUpdateTime(const TVldTimeStamp& updateTime) {
00097 fUpdateTime = updateTime; }
00098 void Recreate (const string& tableName = "",
00099 const string& reason = "",
00100 Int_t detMask = DbiDetector::FullMask(),
00101 Int_t simMask = DbiSimFlag::FullMask(),
00102 TDbi::Task task = 0,
00103 Int_t logSeqNoMin = 0,
00104 Int_t logSeqNoMax = 0,
00105 Int_t logNumSeqNo = 0);
00106
00107
00108 virtual void Fill(TDbiInRowStream& rs,
00109 const TDbiValidityRec* vrec);
00110 virtual void Store(TDbiOutRowStream& ors,
00111 const TDbiValidityRec* vrec) const;
00112 Bool_t Write(UInt_t dbNo,Int_t logSeqNo=0);
00113
00114 private:
00115
00116 TDbiLogEntry(const TDbiLogEntry& from);
00117
00118 void SetServerName();
00119
00120
00121
00122
00123 UInt_t fDbNo;
00124
00125
00126 Int_t fSeqNo;
00127
00128
00129 string fLogTableName;
00130
00131
00132 Int_t fLogDetMask;
00133
00134
00135 Int_t fLogSimMask;
00136
00137
00138 TDbi::Task fLogTask;
00139
00140
00141 Int_t fLogSeqNoMin;
00142
00143
00144 Int_t fLogSeqNoMax;
00145
00146
00147 Int_t fLogNumSeqNo;
00148
00149
00150 TVldTimeStamp fUpdateTime;
00151
00152
00153 string fUserName;
00154
00155
00156 string fProcessName;
00157
00158
00159 string fHostName;
00160
00161
00162 string fServerName;
00163
00164
00165 string fReason;
00166
00167
00168
00169
00170
00171 ClassDef(TDbiLogEntry,0)
00172
00173 };
00174
00175
00176
00177 #endif // DBILOGENTRY_H
00178