EIC Software
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
FairDbValidityRec.h
Go to the documentation of this file. Or view the newest version in sPHENIX GitHub for file FairDbValidityRec.h
1 #ifndef FAIRDBVALIDITYREC_H
2 #define FAIRDBVALIDITYREC_H
3 
4 #include "FairDb.h"
5 #include "FairDbTableRow.h"
6 #include "ValRange.h"
7 #include "ValTimeStamp.h"
8 
9 #include <iosfwd>
10 #include <string>
11 
12 class FairDbBinaryFile;
13 class FairDbTableProxy;
14 class FairDbValidityRec;
15 
16 ostream& operator<<(ostream& s, const FairDbValidityRec& vRec);
17 
19 {
20 
21 
22  public:
23 
24 // Constructors and destructors.
25  FairDbValidityRec(Int_t dbNo = -1, Bool_t isGap = kTRUE);
27  FairDbValidityRec(const ValRange& range,
28  FairDb::Task task,
29  Int_t aggNo,
30  UInt_t seqNo,
31  Int_t dbNo = -1,
32  Bool_t isGap = kFALSE,
34 
35  virtual ~FairDbValidityRec();
36 
37 // State testing member functions
38 
39  virtual FairDbTableRow* CreateTableRow() const {
40  return new FairDbValidityRec;
41  }
42  Int_t GetAggregateNo() const { return fAggregateNo; }
44  UInt_t GetDbNo() const { return fDbNo; }
46  FairDb::Task GetTask() const { return fTask; }
47  std::string GetL2CacheName() const;
48  UInt_t GetSeqNo() const { return fSeqNo; }
49  const FairDbTableProxy* GetTableProxy() const { return fTableProxy; }
50  const ValRange& GetValRange() const { return fValRange;}
51  Bool_t HasExpired(const FairDbValidityRec& other) const;
52  Bool_t HasExpired(const ValContext& vc,
53  const FairDb::Task& task) const;
54  Bool_t IsCompatible(const ValContext& vc,
55  const FairDb::Task& task) const;
56  Bool_t IsGap() const { return fIsGap; }
57 
58  static std::string GetL2CacheName(UInt_t seqLo, UInt_t seqHi, ValTimeStamp ts);
59 
60 // State changing member functions
61  void AndTimeWindow(const ValTimeStamp& start,
62  const ValTimeStamp& end);
63  void SetAggregateNo(Int_t aggNo) { fAggregateNo = aggNo; }
64  void SetDbNo(Int_t dbNo) { fDbNo = dbNo; }
65  void SetTableProxy(const FairDbTableProxy* tp) { fTableProxy = tp; }
66  void SetTimeWindow(const ValTimeStamp& start,
67  const ValTimeStamp& end);
68  void SetValRange(const ValRange& range) { fValRange=range;}
69  void Trim(const ValTimeStamp& queryTime,
70  const FairDbValidityRec& other);
71 
72 // I/O member functions
73  virtual void Fill(FairDbResultSet& rs,
74  const FairDbValidityRec* vrec);
75  virtual void Store(FairDbOutRowStream& ors,
76  const FairDbValidityRec* vrec) const;
78 
79  private:
80  Int_t fAggregateNo;
82  Int_t fDbNo;
84  Bool_t fIsGap;
86  Int_t fSeqNo;
89 
90  // FairDbValidityRec& operator=(const FairDbValidityRec& from);
91 
92  ClassDef(FairDbValidityRec,0) // Validity range table row.
93 
94 };
95 
96 
97 #endif // DBIVALIDITYREC_H