DBFolder.h
Go to the documentation of this file.
1 #ifndef DBFOLDER_H
2 #define DBFOLDER_H
3 
7 #include <string>
8 #include <vector>
9 
10 namespace lariov {
11 
12  typedef void *Dataset;
13  typedef void *Tuple;
14 
15  class DBFolder {
16 
17  public:
18  DBFolder(const std::string& name, const std::string& url, const std::string& url2,
19  const std::string& tag = "", bool useqlite=false, bool testmode=false);
20  virtual ~DBFolder();
21 
22  int GetNamedChannelData(DBChannelID_t channel, const std::string& name, bool& data);
23  int GetNamedChannelData(DBChannelID_t channel, const std::string& name, long& data);
24  int GetNamedChannelData(DBChannelID_t channel, const std::string& name, double& data);
25  int GetNamedChannelData(DBChannelID_t channel, const std::string& name, std::string& data);
26  //int GetNamedChannelData(DBChannelID_t channel, const std::string& name, std::vector<double>& data);
27 
28  const std::string& URL() const {return fURL;}
29  const std::string& FolderName() const {return fFolderName;}
30  const std::string& Tag() const {return fTag;}
31 
32  const IOVTimeStamp& CachedStart() const {return fCache.beginTime();}
33  const IOVTimeStamp& CachedEnd() const {return fCache.endTime();}
34 
35  bool UpdateData(DBTimeStamp_t raw_time);
36 
37  void GetSQLiteData(int t, DBDataset& data) const;
38 
39  int GetChannelList( std::vector<DBChannelID_t>& channels ) const;
40 
41  void DumpDataset(const DBDataset& data) const;
42 
43  bool CompareDataset(const DBDataset& data1, const DBDataset& data2) const;
44 
45  private:
46 
47  void GetRow(DBChannelID_t channel);
48  size_t GetColumn(const std::string& name) const;
49 
50  bool IsValid(const IOVTimeStamp& time) const {
51  if (time >= fCache.beginTime() && time < fCache.endTime()) return true;
52  else return false;
53  }
54 
55 
60  bool fUseSQLite;
61  bool fTestMode;
64 
65  // Database cache.
66 
68 
69  // Database row cache.
70 
74  };
75 }
76 
77 #endif
static QCString name
Definition: declinfo.cpp:673
const IOVTimeStamp & CachedEnd() const
Definition: DBFolder.h:33
std::string fURL
Definition: DBFolder.h:56
virtual ~DBFolder()
Definition: DBFolder.cxx:66
int GetNamedChannelData(DBChannelID_t channel, const std::string &name, bool &data)
Definition: DBFolder.cxx:70
const IOVTimeStamp & CachedStart() const
Definition: DBFolder.h:32
DBDataset fCache
Definition: DBFolder.h:67
int fCachedRowNumber
Definition: DBFolder.h:71
const std::string & URL() const
Definition: DBFolder.h:28
bool UpdateData(DBTimeStamp_t raw_time)
Definition: DBFolder.cxx:254
std::string string
Definition: nybbler.cc:12
std::uint32_t DBChannelID_t
void GetRow(DBChannelID_t channel)
Definition: DBFolder.cxx:208
DBDataset::DBRow fCachedRow
Definition: DBFolder.h:73
std::uint64_t DBTimeStamp_t
uint8_t channel
Definition: CRTFragment.hh:201
void * Tuple
Definition: DBFolder.h:13
int GetChannelList(std::vector< DBChannelID_t > &channels) const
Definition: DBFolder.cxx:200
DBChannelID_t fCachedChannel
Definition: DBFolder.h:72
Class def header for a class IOVTimeStamp.
int fMaximumTimeout
Definition: DBFolder.h:63
bool IsValid(const IOVTimeStamp &time) const
Definition: DBFolder.h:50
const std::string & FolderName() const
Definition: DBFolder.h:29
std::string fURL2
Definition: DBFolder.h:57
const IOVTimeStamp & endTime() const
Definition: DBDataset.h:122
const std::string & Tag() const
Definition: DBFolder.h:30
void DumpDataset(const DBDataset &data) const
Definition: DBFolder.cxx:693
bool CompareDataset(const DBDataset &data1, const DBDataset &data2) const
Definition: DBFolder.cxx:749
const IOVTimeStamp & beginTime() const
Definition: DBDataset.h:121
std::string fFolderName
Definition: DBFolder.h:58
std::string fTag
Definition: DBFolder.h:59
Filters for channels, events, etc.
void * Dataset
Definition: DBFolder.h:12
size_t GetColumn(const std::string &name) const
Definition: DBFolder.cxx:237
std::string fSQLitePath
Definition: DBFolder.h:62
DBFolder(const std::string &name, const std::string &url, const std::string &url2, const std::string &tag="", bool useqlite=false, bool testmode=false)
Definition: DBFolder.cxx:19
void GetSQLiteData(int t, DBDataset &data) const
Definition: DBFolder.cxx:335