LCCD  1.5.0
DBCondHandler.hh
1 #ifndef DBCondHandler_h
2 #define DBCondHandler_h
3 
4 #include "lccd.h"
5 #include "ConditionsHandlerBase.hh"
6 
7 #include "lcio.h"
8 #include "Exceptions.h"
9 
10 
11 namespace lccd {
12 
13  class DBInterface ;
14 
43 
44  public:
45 
46  DBCondHandler(const DBCondHandler&) = delete ;
47  DBCondHandler& operator=(const DBCondHandler&) = delete ;
48 
57  DBCondHandler(const std::string& dbInit, const std::string& folder,
58  const std::string& name, const std::string& tag="" ) ;
59 
60 
61  virtual ~DBCondHandler() ;
62 
63 
73  virtual void update( LCCDTimeStamp timeStamp ) ;
74 
78  virtual void registerDefaultCollection( lcio::LCCollection* col);
79 
80 
83  virtual lcio::LCCollection* defaultCollection() { return _defaultCollection; } ;
84 
85 
88  virtual lcio::LCCollection* lastValidCollection() { return _lastValidCollection; } ;
89 
90 
91  protected :
92 
93  DBCondHandler() {}
94 
95  lccd::DBInterface* _db = nullptr ;
96 
97  // ---- data members ------
98  std::string _dbInit{} ;
99  std::string _folder{} ;
100  std::string _tag{} ;
101 
103  lcio::LCCollection* _defaultCollection = nullptr ;
104 
106  lcio::LCCollection* _lastValidCollection = nullptr ;
107 
108 
109  };
110 } //end namespace
111 
112 #endif // DBCondHandler_h
Provides a simple interface to the conditions data base for lccd.
Definition: DBInterface.hh:53
virtual void update(LCCDTimeStamp timeStamp)
Retrieves the conditions data from the data base if time stamp exceeds current validity time range...
Definition: DBCondHandler.cc:61
lcio::LCCollection * _lastValidCollection
The last valid collection of conditions data.
Definition: DBCondHandler.hh:106
Base implementation of IConditionsHandler.
Definition: ConditionsHandlerBase.hh:27
lcio::LCCollection * _defaultCollection
The registered default collection.
Definition: DBCondHandler.hh:103
virtual lcio::LCCollection * lastValidCollection()
The last valid collection held by the handler.
Definition: DBCondHandler.hh:88
Implementation of ConditionsHandlerBase that reads the conditions data from the database.
Definition: DBCondHandler.hh:42
virtual lcio::LCCollection * defaultCollection()
The default collection registered with the handler.
Definition: DBCondHandler.hh:83
virtual void registerDefaultCollection(lcio::LCCollection *col)
Register a pointer to a default collection which will be passed to the IConditionsChangeListener if n...
Definition: DBCondHandler.cc:49
lcio::long64 LCCDTimeStamp
The timestamp in LCCD is a 64bit int as defined in LCIO.
Definition: lccd.h:24
virtual const std::string name()
The name of this conditions handler - used, e.g.
Definition: ConditionsHandlerBase.hh:99