Improved diagnostic messages. Different access strings for AliCDBGrid. New or renamed...
[u/mrichter/AliRoot.git] / STEER / AliCDBLocal.h
1 #ifndef ALI_CDB_LOCAL_H
2 #define ALI_CDB_LOCAL_H
3
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5  * See cxx source for full Copyright notice                               */
6
7 /////////////////////////////////////////////////////////////////////
8 //                                                                 //
9 //  class AliCDBLocal                                              //
10 //  access class to a DataBase in a local storage                  //
11 //                                                                 //
12 /////////////////////////////////////////////////////////////////////
13
14 #include "AliCDBStorage.h"
15 #include "AliCDBManager.h"
16
17 class AliCDBLocal: public AliCDBStorage {
18         friend class AliCDBLocalFactory;
19
20 public:
21
22         virtual Bool_t IsReadOnly() const {return kFALSE;};
23         virtual Bool_t HasSubVersion() const {return kTRUE;};
24         virtual Bool_t Contains(const char* path) const;
25
26 protected:
27
28         virtual AliCDBEntry* GetEntry(const AliCDBId& queryId);
29         virtual TList* GetEntries(const AliCDBId& queryId);
30         virtual Bool_t PutEntry(AliCDBEntry* entry);
31         virtual TList*          GetIdListFromFile(const char* fileName);
32
33 private:
34
35         AliCDBLocal(const char* baseDir);
36         virtual ~AliCDBLocal();
37         
38         Bool_t FilenameToId(const char* filename, AliCDBRunRange& runRange, 
39                         Int_t& version, Int_t& subVersion);
40         Bool_t IdToFilename(const AliCDBRunRange& runRange, Int_t version, 
41                         Int_t subVersion, TString& filename);
42
43         Bool_t PrepareId(AliCDBId& id);
44         AliCDBId GetId(const AliCDBId& query);
45
46         void GetEntriesForLevel0(const char* level0, const AliCDBId& query, TList* result);
47         void GetEntriesForLevel1(const char* level0, const char* Level1,
48                         const AliCDBId& query, TList* result);
49
50         TString fBaseDirectory; // path of the DB folder
51
52         ClassDef(AliCDBLocal, 0); // access class to a DataBase in a local storage
53 };
54
55 /////////////////////////////////////////////////////////////////////
56 //                                                                 //
57 //  class AliCDBLocalFactory                                       //
58 //                                                                 //
59 /////////////////////////////////////////////////////////////////////
60
61 class AliCDBLocalFactory: public AliCDBStorageFactory {
62
63 public:
64
65         virtual Bool_t Validate(const char* dbString);
66         virtual AliCDBParam* CreateParameter(const char* dbString);
67
68 protected:
69         virtual AliCDBStorage* Create(const AliCDBParam* param);
70
71         ClassDef(AliCDBLocalFactory, 0);
72 };
73
74 /////////////////////////////////////////////////////////////////////
75 //                                                                 //
76 //  class AliCDBLocalParam                                         //
77 //                                                                 //
78 /////////////////////////////////////////////////////////////////////
79
80 class AliCDBLocalParam: public AliCDBParam {
81         
82 public:
83         AliCDBLocalParam();
84         AliCDBLocalParam(const char* dbPath);
85         
86         virtual ~AliCDBLocalParam();
87
88         const TString& GetPath() const {return fDBPath;};
89
90         virtual AliCDBParam* CloneParam() const;
91
92         virtual ULong_t Hash() const;
93         virtual Bool_t IsEqual(const TObject* obj) const;
94
95 private:
96
97         TString fDBPath; // path of the DB folder
98
99         ClassDef(AliCDBLocalParam, 0);
100 };
101
102 #endif