Corrected protection.
[u/mrichter/AliRoot.git] / STEER / AliCDBLocal.h
CommitLineData
9e1ceb13 1#ifndef ALI_CDB_LOCAL_H
2#define ALI_CDB_LOCAL_H
fe913d8f 3
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 AliCDBLocal //
10// access class to a DataBase in a local storage //
11// //
12/////////////////////////////////////////////////////////////////////
fe913d8f 13
14#include "AliCDBStorage.h"
9e1ceb13 15#include "AliCDBManager.h"
fe913d8f 16
17class AliCDBLocal: public AliCDBStorage {
9e1ceb13 18 friend class AliCDBLocalFactory;
19
20public:
21
fdf65bb5 22 virtual Bool_t IsReadOnly() const {return kFALSE;};
23 virtual Bool_t HasSubVersion() const {return kTRUE;};
b05400be 24 virtual Bool_t Contains(const char* path) const;
c3a7b59a 25 virtual Int_t GetLatestVersion(const char* path, Int_t run);
26 virtual Int_t GetLatestSubVersion(const char* path, Int_t run, Int_t version=-1);
27 virtual Bool_t IdToFilename(const AliCDBId& id, TString& filename) const;
9e1ceb13 28
29protected:
30
c3a7b59a 31 virtual AliCDBEntry* GetEntry(const AliCDBId& queryId);
4667c116 32 virtual AliCDBId* GetEntryId(const AliCDBId& queryId);
c3a7b59a 33 virtual TList* GetEntries(const AliCDBId& queryId);
34 virtual Bool_t PutEntry(AliCDBEntry* entry);
b05400be 35 virtual TList* GetIdListFromFile(const char* fileName);
9e1ceb13 36
37private:
38
fe12e09c 39 AliCDBLocal(const AliCDBLocal & source);
40 AliCDBLocal & operator=(const AliCDBLocal & source);
9e1ceb13 41 AliCDBLocal(const char* baseDir);
42 virtual ~AliCDBLocal();
43
44 Bool_t FilenameToId(const char* filename, AliCDBRunRange& runRange,
45 Int_t& version, Int_t& subVersion);
9e1ceb13 46
47 Bool_t PrepareId(AliCDBId& id);
4667c116 48// Bool_t GetId(const AliCDBId& query, AliCDBId& result);
49 AliCDBId* GetId(const AliCDBId& query);
9e1ceb13 50
62032124 51 virtual void QueryValidFiles();
52
9e1ceb13 53 void GetEntriesForLevel0(const char* level0, const AliCDBId& query, TList* result);
54 void GetEntriesForLevel1(const char* level0, const char* Level1,
55 const AliCDBId& query, TList* result);
56
57 TString fBaseDirectory; // path of the DB folder
58
59 ClassDef(AliCDBLocal, 0); // access class to a DataBase in a local storage
60};
61
62/////////////////////////////////////////////////////////////////////
63// //
64// class AliCDBLocalFactory //
65// //
66/////////////////////////////////////////////////////////////////////
67
68class AliCDBLocalFactory: public AliCDBStorageFactory {
fe913d8f 69
70public:
fe913d8f 71
9e1ceb13 72 virtual Bool_t Validate(const char* dbString);
73 virtual AliCDBParam* CreateParameter(const char* dbString);
74
fe913d8f 75protected:
9e1ceb13 76 virtual AliCDBStorage* Create(const AliCDBParam* param);
77
78 ClassDef(AliCDBLocalFactory, 0);
79};
80
81/////////////////////////////////////////////////////////////////////
82// //
83// class AliCDBLocalParam //
84// //
85/////////////////////////////////////////////////////////////////////
86
87class AliCDBLocalParam: public AliCDBParam {
88
89public:
90 AliCDBLocalParam();
91 AliCDBLocalParam(const char* dbPath);
92
93 virtual ~AliCDBLocalParam();
94
95 const TString& GetPath() const {return fDBPath;};
96
97 virtual AliCDBParam* CloneParam() const;
98
99 virtual ULong_t Hash() const;
100 virtual Bool_t IsEqual(const TObject* obj) const;
fe913d8f 101
102private:
fe913d8f 103
9e1ceb13 104 TString fDBPath; // path of the DB folder
fe913d8f 105
9e1ceb13 106 ClassDef(AliCDBLocalParam, 0);
fe913d8f 107};
108
109#endif