]>
Commit | Line | Data |
---|---|---|
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 | |
17 | class AliCDBLocal: public AliCDBStorage { | |
9e1ceb13 | 18 | friend class AliCDBLocalFactory; |
19 | ||
20 | public: | |
21 | ||
fdf65bb5 | 22 | virtual Bool_t IsReadOnly() const {return kFALSE;}; |
23 | virtual Bool_t HasSubVersion() const {return kTRUE;}; | |
9e1ceb13 | 24 | |
25 | protected: | |
26 | ||
27 | virtual AliCDBEntry* GetEntry(const AliCDBId& queryId); | |
28 | virtual TList* GetEntries(const AliCDBId& queryId); | |
29 | virtual Bool_t PutEntry(AliCDBEntry* entry); | |
30 | ||
31 | private: | |
32 | ||
33 | AliCDBLocal(const char* baseDir); | |
34 | virtual ~AliCDBLocal(); | |
35 | ||
36 | Bool_t FilenameToId(const char* filename, AliCDBRunRange& runRange, | |
37 | Int_t& version, Int_t& subVersion); | |
38 | Bool_t IdToFilename(const AliCDBRunRange& runRange, Int_t version, | |
39 | Int_t subVersion, TString& filename); | |
40 | ||
41 | Bool_t PrepareId(AliCDBId& id); | |
42 | AliCDBId GetId(const AliCDBId& query); | |
43 | ||
44 | void GetEntriesForLevel0(const char* level0, const AliCDBId& query, TList* result); | |
45 | void GetEntriesForLevel1(const char* level0, const char* Level1, | |
46 | const AliCDBId& query, TList* result); | |
47 | ||
48 | TString fBaseDirectory; // path of the DB folder | |
49 | ||
50 | ClassDef(AliCDBLocal, 0); // access class to a DataBase in a local storage | |
51 | }; | |
52 | ||
53 | ///////////////////////////////////////////////////////////////////// | |
54 | // // | |
55 | // class AliCDBLocalFactory // | |
56 | // // | |
57 | ///////////////////////////////////////////////////////////////////// | |
58 | ||
59 | class AliCDBLocalFactory: public AliCDBStorageFactory { | |
fe913d8f | 60 | |
61 | public: | |
fe913d8f | 62 | |
9e1ceb13 | 63 | virtual Bool_t Validate(const char* dbString); |
64 | virtual AliCDBParam* CreateParameter(const char* dbString); | |
65 | ||
fe913d8f | 66 | protected: |
9e1ceb13 | 67 | virtual AliCDBStorage* Create(const AliCDBParam* param); |
68 | ||
69 | ClassDef(AliCDBLocalFactory, 0); | |
70 | }; | |
71 | ||
72 | ///////////////////////////////////////////////////////////////////// | |
73 | // // | |
74 | // class AliCDBLocalParam // | |
75 | // // | |
76 | ///////////////////////////////////////////////////////////////////// | |
77 | ||
78 | class AliCDBLocalParam: public AliCDBParam { | |
79 | ||
80 | public: | |
81 | AliCDBLocalParam(); | |
82 | AliCDBLocalParam(const char* dbPath); | |
83 | ||
84 | virtual ~AliCDBLocalParam(); | |
85 | ||
86 | const TString& GetPath() const {return fDBPath;}; | |
87 | ||
88 | virtual AliCDBParam* CloneParam() const; | |
89 | ||
90 | virtual ULong_t Hash() const; | |
91 | virtual Bool_t IsEqual(const TObject* obj) const; | |
fe913d8f | 92 | |
93 | private: | |
fe913d8f | 94 | |
9e1ceb13 | 95 | TString fDBPath; // path of the DB folder |
fe913d8f | 96 | |
9e1ceb13 | 97 | ClassDef(AliCDBLocalParam, 0); |
fe913d8f | 98 | }; |
99 | ||
100 | #endif |