LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
DatabaseRetrievalAlg.h
Go to the documentation of this file.
1 
14 #ifndef DATABASERETRIEVALALG_H
15 #define DATABASERETRIEVALALG_H
16 
17 #include "DBFolder.h"
18 #include <memory>
19 
20 namespace fhicl {
21  class ParameterSet;
22 }
23 
24 namespace lariov {
25 
26  class IOVTimeStamp;
27 
34 
35  public:
37  DatabaseRetrievalAlg(const std::string& foldername,
38  const std::string& url,
39  const std::string& url2 = "",
40  const std::string& tag = "",
41  bool usesqlite = false,
42  bool testmode = false)
43  : fFolder(new DBFolder(foldername, url, url2, tag, usesqlite, testmode))
44  {}
45 
46  DatabaseRetrievalAlg(fhicl::ParameterSet const& p) { this->Reconfigure(p); }
47 
49  virtual ~DatabaseRetrievalAlg() {}
50 
52  virtual void Reconfigure(fhicl::ParameterSet const& p);
53 
55  bool UpdateFolder(DBTimeStamp_t ts) { return fFolder->UpdateData(ts); }
56 
58  const std::string& URL() const { return fFolder->URL(); }
59  const std::string& FolderName() const { return fFolder->FolderName(); }
60  const std::string& Tag() const { return fFolder->Tag(); }
61 
63  const IOVTimeStamp& Begin() const { return fFolder->CachedStart(); }
64  const IOVTimeStamp& End() const { return fFolder->CachedEnd(); }
65 
66  protected:
67  std::unique_ptr<DBFolder> fFolder;
68  };
69 }
70 
71 #endif
72  // end of doxygen group
std::unique_ptr< DBFolder > fFolder
DatabaseRetrievalAlg(fhicl::ParameterSet const &p)
const std::string & URL() const
Get connection information.
DatabaseRetrievalAlg(const std::string &foldername, const std::string &url, const std::string &url2="", const std::string &tag="", bool usesqlite=false, bool testmode=false)
Constructors.
bool UpdateFolder(DBTimeStamp_t ts)
Return true if fFolder is successfully updated.
parameter set interface
const IOVTimeStamp & End() const
virtual ~DatabaseRetrievalAlg()
Default destructor.
const std::string & Tag() const
Filters for channels, events, etc.
const IOVTimeStamp & Begin() const
Get Timestamp information.
const std::string & FolderName() const