]> git.uio.no Git - u/mrichter/AliRoot.git/blame - STEER/AliCDBStorage.h
Fix effc++ warnings and most blatant coding-convention violations.
[u/mrichter/AliRoot.git] / STEER / AliCDBStorage.h
CommitLineData
9e1ceb13 1#ifndef ALI_CDB_STORAGE_H
2#define ALI_CDB_STORAGE_H
3
fe913d8f 4/* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
6
9e1ceb13 7/////////////////////////////////////////////////////////////////////
8// //
9// class AliCDBStorage //
10// interface to specific storage classes //
11// (AliCDBGrid, AliCDBLocal, AliCDBDump) //
12// //
13/////////////////////////////////////////////////////////////////////
fe913d8f 14
9e1ceb13 15#include "AliCDBId.h"
fe913d8f 16#include "AliCDBMetaData.h"
17
9e1ceb13 18#include <TList.h>
fe913d8f 19
fe913d8f 20class AliCDBEntry;
62032124 21class AliCDBPath;
fe913d8f 22
23class AliCDBStorage: public TObject {
fe913d8f 24
9e1ceb13 25public:
26 AliCDBStorage();
9e1ceb13 27
7d160419 28 void SetURI(const TString& uri) {fURI = uri;}
29 const TString& GetURI() const {return fURI;}
62032124 30 const TString& GetType() const {return fType;}
31 const TString& GetBaseFolder() const {return fBaseFolder;}
32
7d160419 33
b05400be 34 void ReadSelectionFromFile(const char *fileName);
35
9e1ceb13 36 void AddSelection(const AliCDBId& selection);
37
38 void AddSelection(const AliCDBPath& path,
39 const AliCDBRunRange& runRange,
40 Int_t version,
41 Int_t subVersion = -1);
42
43 void AddSelection(const AliCDBPath& path,
44 Int_t firstRun,
45 Int_t lastRun,
46 Int_t version,
47 Int_t subVersion = -1);
48
49 void RemoveSelection(const AliCDBId& selection);
50
51 void RemoveSelection(const AliCDBPath& path,
52 const AliCDBRunRange& runRange);
53
54 void RemoveSelection(const AliCDBPath& path,
55 Int_t firstRun = -1,
56 Int_t lastRun = -1);
57
eb0b1051 58 void RemoveSelection(int position);
9e1ceb13 59 void RemoveAllSelections();
60
02c4845e 61 void PrintSelectionList();
62
9e1ceb13 63 AliCDBEntry* Get(const AliCDBId& query);
64 AliCDBEntry* Get(const AliCDBPath& path, Int_t runNumber,
65 Int_t version = -1, Int_t subVersion = -1);
66 AliCDBEntry* Get(const AliCDBPath& path, const AliCDBRunRange& runRange,
67 Int_t version = -1, Int_t subVersion = -1);
68
69 TList* GetAll(const AliCDBId& query);
70 TList* GetAll(const AliCDBPath& path, Int_t runNumber,
71 Int_t version = -1, Int_t subVersion = -1);
72 TList* GetAll(const AliCDBPath& path, const AliCDBRunRange& runRange,
7d160419 73 Int_t version = -1, Int_t subVersion = -1);
9e1ceb13 74
9e1ceb13 75 Bool_t Put(TObject* object, AliCDBId& id, AliCDBMetaData* metaData);
76 Bool_t Put(AliCDBEntry* entry);
77
78
fdf65bb5 79 virtual Bool_t IsReadOnly() const = 0;
80 virtual Bool_t HasSubVersion() const = 0;
b05400be 81 virtual Bool_t Contains(const char* path) const = 0;
82
62032124 83 void QueryCDB(Long64_t run, const char* pathFilter="*",
84 Int_t version=-1, AliCDBMetaData *mdFilter=0);
85 void PrintQueryCDB();
86 TList* GetQueryCDBList() {return &fValidFileIds;}
87
fe913d8f 88protected:
62032124 89
90 virtual ~AliCDBStorage();
4b5e0dce 91 void GetSelection(/*const*/ AliCDBId* id);
9e1ceb13 92 virtual AliCDBEntry* GetEntry(const AliCDBId& query) = 0;
93 virtual TList* GetEntries(const AliCDBId& query) = 0;
62032124 94 virtual Bool_t PutEntry(AliCDBEntry* entry) = 0;
b05400be 95 virtual TList *GetIdListFromFile(const char* fileName)=0;
62032124 96 virtual void QueryValidFiles() = 0;
fe913d8f 97
62032124 98 TList fValidFileIds; // list of Id's of the files valid for a given run (cached as fRun)
99 Long64_t fRun; // run number, used to manage list of valid files
100 AliCDBPath fPathFilter; // path filter, used to manage list of valid files
101 Int_t fVersion; // version, used to manage list of valid files
102 AliCDBMetaData* fMetaDataFilter; // metadata, used to manage list of valid files
fe913d8f 103
7d160419 104 TList fSelections; // list of selection criteria
62032124 105 TString fURI; // storage URI;
106 TString fType; //! Local, Grid: base folder name - Dump: file name
107 TString fBaseFolder; //! Local, Grid: base folder name - Dump: file name
fe913d8f 108
9e1ceb13 109 ClassDef(AliCDBStorage, 0);
fe913d8f 110};
111
112#endif