KaliVeda
Toolkit for HIC analysis
Loading...
Searching...
No Matches
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
76class KVSQLROOTFile : public KVBase {
77 std::unique_ptr<TFile> fObjStore;
78 std::unique_ptr<KVSQLite::database> fObjDB;
79
86 {
87 savDir->cd();
88 }
89
91 {
92 return fObjDB->get_table("objTable");
93 }
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
105public:
106 KVSQLROOTFile(const KVString& filepath, Option_t* option = "READ");
107
109
110 void WriteObject(const TObject*, const KVNameValueList&);
111
112 TObject* Get(const KVString& name) const;
113
114 void ls(Option_t* = "") const;
115
117 void FillListOfObjectsWithSelection(KVSeqCollection* list, const KVString& where, const KVString& numberlist_column,
118 int value);
119
120 ClassDef(KVSQLROOTFile, 1) //Combine ROOT file containing objects with SQLite database with info on the objects
121};
122
123#endif
const char Option_t
#define ClassDef(name, id)
#define gDirectory
Base class for KaliVeda framework.
Definition KVBase.h:142
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.
KVSQLite::table & get_objInfos() const
void WriteObject(const TObject *, const KVNameValueList &)
KVSQLite::table & get_objTable() const
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
List the contents of the file with associated infos.
std::unordered_map< std::string, TObject * > fObjList
for quick look-up of objects using unique id
TObject * get_object_with_UUID(const KVString &name) const
Retrieve object from file using its name.
void restore_working_directory()
KVString UUID_for_object(const KVString &) const
Return unique identifier used to store object with given name in ROOT file.
std::unique_ptr< TFile > fObjStore
TDirectory * savDir
TString fCurrentROOTFilePath
full path to current ROOT file
std::unique_ptr< KVSQLite::database > fObjDB
void save_working_directory()
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()