LCCD  1.3.1
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 
54  DBCondHandler(const std::string& dbInit, const std::string& folder,
55  const std::string& name, const std::string& tag="" ) ;
56 
57 
58  virtual ~DBCondHandler() ;
59 
60 
70  virtual void update( LCCDTimeStamp timeStamp ) ;
71 
75  virtual void registerDefaultCollection( lcio::LCCollection* col);
76 
77 
80  virtual lcio::LCCollection* defaultCollection() { return _defaultCollection; } ;
81 
82 
85  virtual lcio::LCCollection* lastValidCollection() { return _lastValidCollection; } ;
86 
87 
88  protected :
89 
90  DBCondHandler() {}
91 
92  lccd::DBInterface* _db ;
93 
94  // ---- data members ------
95  std::string _dbInit ;
96  std::string _folder ;
97  std::string _tag ;
98 
100  lcio::LCCollection* _defaultCollection ;
101 
103  lcio::LCCollection* _lastValidCollection ;
104 
105 
106  };
107 } //end namespace
108 
109 #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:103
Base implementation of IConditionsHandler.
Definition: ConditionsHandlerBase.hh:27
lcio::LCCollection * _defaultCollection
The registered default collection.
Definition: DBCondHandler.hh:100
virtual lcio::LCCollection * lastValidCollection()
The last valid collection held by the handler.
Definition: DBCondHandler.hh:85
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:80
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:96