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 
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
std::string string
Definition: nybbler.cc:12
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.
p
Definition: test.py:223
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