10 #include "KVDataRepositoryManager.h"
11 #include "KVDataRepository.h"
12 #include "KVDataSetManager.h"
15 #include "Riostream.h"
17 #include "TObjString.h"
18 #include "TObjArray.h"
19 #include "KVDataSet.h"
34 fRepositories.SetOwner(kTRUE);
35 gDataRepositoryManager =
this;
43 KVDataRepositoryManager::~KVDataRepositoryManager()
46 fRepositories.Delete();
47 gDataRepositoryManager = 0;
85 if (fRepositories.GetSize())
86 fRepositories.Delete();
89 TString rep_list = gEnv->GetValue(
"DataRepository",
"");
92 "<KVDataRepositoryManager::Init> : no repositories defined in .kvrootrc"
97 gDataSetManager->
Init();
101 TObjArray* toks = rep_list.Tokenize(
' ');
104 for (
int i_rep = 0; i_rep < toks->GetEntries(); i_rep++) {
108 TString rep_name = ((TObjString*)(*toks)[i_rep])->String();
111 gEnv->GetValue(Form(
"%s.DataRepository.Type", rep_name.Data()),
117 new_rep->SetName(rep_name.Data());
119 if (new_rep->
Init()) {
120 fRepositories.Add(new_rep);
121 last_defined = new_rep;
134 gEnv->GetValue(
"DataRepository.Default",
"default"));
135 if (new_rep) new_rep->
cd();
136 else if (last_defined) last_defined->
cd();
175 Bool_t _all = (_opt ==
"ALL");
176 TIter nxt(&fRepositories);
177 cout <<
"Available data repositories: " << endl << endl;
183 cout <<
"\t" << rep->GetName() <<
" [";
205 return R->GetDataSetManager()->GetDataSet(dataset);
static void InitEnvironment()
Manages access to one or more data repositories.
KVDataRepository * GetRepository(const Char_t *name) const
KVDataSet * GetDataSet(const Char_t *repository, const Char_t *dataset) const
Return pointer to named dataset in the given repository.
void Print(Option_t *opt="") const
Base class for managing repositories of experimental data.
virtual Bool_t IsRemote() const
Returns kTRUE for remote repositories, kFALSE for local repositories.
static KVDataRepository * NewRepository(const Char_t *type)
virtual void Print(Option_t *opt="") const
Print info on repository.
virtual const Char_t * GetRootDirectory() const
returns root directory of data repository (fLocalrootdir)
Manage all datasets contained in a given data repository.
virtual Bool_t Init(KVDataRepository *=0)
Manage an experimental dataset corresponding to a given experiment or campaign.