KaliVeda
Toolkit for HIC analysis
KVSQLROOTFile.h
1 #ifndef __KVSQLROOTFILE_H
2 #define __KVSQLROOTFILE_H
3 
4 #include "KVBase.h"
5 #include "TFile.h"
6 #include "SQLiteDB.h"
7 #include <unordered_map>
8 
76 class KVSQLROOTFile : public KVBase {
77  std::unique_ptr<TFile> fObjStore;
78  std::unique_ptr<KVSQLite::database> fObjDB;
79 
80  TDirectory* savDir;
81  void save_working_directory()
82  {
83  savDir = gDirectory;
84  }
85  void restore_working_directory()
86  {
87  savDir->cd();
88  }
89 
90  KVSQLite::table& get_objTable() const
91  {
92  return fObjDB->get_table("objTable");
93  }
94  KVSQLite::table& get_objInfos() const
95  {
96  return fObjDB->get_table("objInfos");
97  }
98 
99  mutable std::unordered_map<std::string, TObject*> fObjList;
100 
101  KVString UUID_for_object(const KVString&) const;
102  TObject* get_object_with_UUID(const KVString& name) const;
103 
104  TString fCurrentROOTFilePath;
105 public:
106  KVSQLROOTFile(const KVString& filepath, Option_t* option = "READ");
107 
108  ~KVSQLROOTFile();
109 
110  void WriteObject(const TObject*, const KVNameValueList&);
111 
112  TObject* Get(const KVString& name) const;
113 
114  void ls(Option_t* = "") const override;
115 
116  void FillListOfObjectsWithSelection(KVSeqCollection* list, const KVString& where);
117  void FillListOfObjectsWithSelection(KVSeqCollection* list, const KVString& where, const KVString& numberlist_column,
118  int value);
119 
120  ClassDefOverride(KVSQLROOTFile, 1) //Combine ROOT file containing objects with SQLite database with info on the objects
121 };
122 
123 #endif
const char Option_t
#define ClassDefOverride(name, id)
#define gDirectory
Option_t Option_t option
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void value
char name[80]
Base class for KaliVeda framework.
Definition: KVBase.h:140
Handles lists of named parameters with different types, a list of KVNamedParameter objects.
Combine ROOT file containing objects with SQLite database with info on the objects.
Definition: KVSQLROOTFile.h:76
void WriteObject(const TObject *, const KVNameValueList &)
void FillListOfObjectsWithSelection(KVSeqCollection *list, const KVString &where)
TObject * Get(const KVString &name) const
Return pointer to object with given name.
void ls(Option_t *="") const override
List the contents of the file with associated infos.
KVSQLROOTFile(const KVString &filepath, Option_t *option="READ")
KaliVeda extensions to ROOT collection classes.
Extension of ROOT TString class which allows backwards compatibility with ROOT v3....
Definition: KVString.h:73
virtual Bool_t cd()