Class Reference for E1039 Core & Analysis Software
PdbBankManager.h
Go to the documentation of this file.
1 // Declaration of class PdbBankManager
2 // Purpose: Abstract factory class to handle banks
3 // Author: Matthias Messer
4 
5 #ifndef PDBBANKMANAGER_HH__
6 #define PDBBANKMANAGER_HH__
7 
8 #include "PdbBankID.h"
9 
10 #include <phool/PHTimeStamp.h>
11 
12 #include <ctime>
13 #include <map>
14 #include <set>
15 #include <string>
16 
17 class PdbCalBank;
18 class PdbApplication;
19 class PdbBankList;
20 class PdbCalBankIterator;
21 
23 {
24 
25 protected:
26 
28  virtual ~PdbBankManager();
29 
30 public:
31 
32  static PdbBankManager *instance();
33 
36 
37  virtual PdbCalBank* createBank(const std::string &,
38  PdbBankID,
39  const std::string &,
40  PHTimeStamp &,
41  PHTimeStamp &,
42  const std::string &) = 0;
43 
44  // create bank with run number as key
45  virtual PdbCalBank* createBank(const int,
46  const std::string &,
47  PdbBankID,
48  const std::string &,
49  const std::string &,
50  const time_t duration=60) = 0;
51 
52  // create bank for a given range of run numbers rather than timestamps
53  virtual PdbCalBank* createBank(const int,
54  const int,
55  const std::string &,
56  PdbBankID,
57  const std::string &,
58  const std::string &) = 0;
59 
60  virtual PdbCalBank* fetchBank(const std::string &,
61  PdbBankID,
62  const std::string &,
63  const int) = 0;
64 
65  virtual PdbCalBank* fetchClosestBank(const std::string &,
66  PdbBankID,
67  const std::string &,
68  const int) = 0;
69  // virtual void fetchAllBanks(PdbBankList &,
70  // const std::string &,
71  // PdbBankID,
72  // const std::string &,
73  // const int) = 0;
74 
75  // virtual void fetchAllBanks(PdbBankList &,
76  // const std::string &,
77  // const std::string &,
78  // const int) = 0;
79 
80  virtual PdbCalBank* fetchBank(const std::string &,
81  PdbBankID,
82  const std::string &,
83  const PHTimeStamp &) = 0;
84 
85  virtual PdbCalBank* fetchClosestBank(const std::string &,
86  PdbBankID,
87  const std::string &,
88  PHTimeStamp &) = 0;
89 
90  // virtual void fetchAllBanks(PdbBankList &,
91  // const std::string &,
92  // PdbBankID,
93  // const std::string &,
94  // PHTimeStamp &) = 0;
95 
96  // virtual void fetchAllBanks(PdbBankList &,
97  // const std::string &,
98  // const std::string &,
99  // PHTimeStamp &) = 0;
100 
102 
104  const std::string &,
105  PHTimeStamp &) = 0;
106 
107  virtual void GetUsedBankRids(std::map<std::string,std::set<int> > &usedbanks) const {}
108  virtual void ClearUsedBankRids() {}
109  virtual void SetMaxInsertTime(const PHTimeStamp &tMax) {}
110 
111 protected:
112 
114 
115 };
116 
117 #endif /* PDBBANKMANAGER_HH__ */
virtual PdbCalBank * fetchClosestBank(const std::string &, PdbBankID, const std::string &, PHTimeStamp &)=0
virtual PdbCalBank * fetchClosestBank(const std::string &, PdbBankID, const std::string &, const int)=0
virtual ~PdbBankManager()
virtual PdbCalBank * createBank(const int, const int, const std::string &, PdbBankID, const std::string &, const std::string &)=0
virtual PdbCalBankIterator * getIterator()=0
Get an iterator to loop over banks.
virtual void GetUsedBankRids(std::map< std::string, std::set< int > > &usedbanks) const
virtual PdbCalBank * fetchBank(const std::string &, PdbBankID, const std::string &, const int)=0
static PdbBankManager * instance()
virtual void ClearUsedBankRids()
virtual PdbCalBank * fetchBank(const std::string &, PdbBankID, const std::string &, const PHTimeStamp &)=0
virtual PdbApplication * getApplication()=0
virtual void SetMaxInsertTime(const PHTimeStamp &tMax)
virtual void fillCalibObject(PdbCalBank *, const std::string &, PHTimeStamp &)=0
static PdbBankManager * __instance
virtual PdbCalBank * createBank(const std::string &, PdbBankID, const std::string &, PHTimeStamp &, PHTimeStamp &, const std::string &)=0
virtual PdbCalBank * createBank(const int, const std::string &, PdbBankID, const std::string &, const std::string &, const time_t duration=60)=0