All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
DatabaseRetrievalAlg.h
Go to the documentation of this file.
1 /**
2  * \file DatabaseRetrievalAlg.h
3  *
4  * \ingroup WebDBI
5  *
6  * \brief Class def header for a class DatabaseRetrievalAlg
7  *
8  * @author kterao, eberly@slac.stanford.edu
9  */
10 
11 /** \addtogroup WebDBI
12 
13  @{*/
14 #ifndef DATABASERETRIEVALALG_H
15 #define DATABASERETRIEVALALG_H
16 
17 #include <memory>
18 #include "DBFolder.h"
19 
20 namespace fhicl { class ParameterSet; }
21 
22 namespace lariov {
23 
24  class IOVTimeStamp;
25 
26  /**
27  \class DatabaseRetrievalAlg
28  User defined class DatabaseRetrievalAlg ... these comments are used to generate
29  doxygen documentation!
30  */
32 
33  public:
34 
35  /// Constructors
36  DatabaseRetrievalAlg(const std::string& foldername, const std::string& url,
37  const std::string& url2="", const std::string& tag="",
38  bool usesqlite=false, bool testmode=false) :
39  fFolder(new DBFolder(foldername, url, url2, tag, usesqlite, testmode)) {}
40 
41  DatabaseRetrievalAlg(fhicl::ParameterSet const& p) {
42  this->Reconfigure(p);
43  }
44 
45  /// Default destructor
47 
48  /// Configure using fhicl::ParameterSet
49  virtual void Reconfigure(fhicl::ParameterSet const& p);
50 
51  /// Return true if fFolder is successfully updated
53  return fFolder->UpdateData(ts);
54  }
55 
56  /// Get connection information
57  const std::string& URL() const {return fFolder->URL();}
58  const std::string& FolderName() const {return fFolder->FolderName();}
59  const std::string& Tag() const {return fFolder->Tag();}
60 
61  /// Get Timestamp information
62  const IOVTimeStamp& Begin() const {return fFolder->CachedStart();}
63  const IOVTimeStamp& End() const {return fFolder->CachedEnd();}
64 
65 
66  protected:
67 
68  std::unique_ptr<DBFolder> fFolder;
69  };
70 }
71 
72 
73 #endif
74 /** @} */ // end of doxygen group
std::unique_ptr< DBFolder > fFolder
virtual void Reconfigure(fhicl::ParameterSet const &p)
Configure using fhicl::ParameterSet.
pdgs p
Definition: selectors.fcl:22
DatabaseRetrievalAlg(fhicl::ParameterSet const &p)
std::uint64_t DBTimeStamp_t
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.
const IOVTimeStamp & End() const
virtual ~DatabaseRetrievalAlg()
Default destructor.
const std::string & Tag() const
const IOVTimeStamp & Begin() const
Get Timestamp information.
const std::string & FolderName() const