1 #ifndef ALI_CDB_LOCAL_H
2 #define ALI_CDB_LOCAL_H
4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 /////////////////////////////////////////////////////////////////////
9 // class AliCDBLocal //
10 // access class to a DataBase in a local storage //
12 /////////////////////////////////////////////////////////////////////
14 #include "AliCDBStorage.h"
15 #include "AliCDBManager.h"
17 class AliCDBLocal: public AliCDBStorage {
18 friend class AliCDBLocalFactory;
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 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;
31 virtual AliCDBEntry* GetEntry(const AliCDBId& queryId);
32 virtual AliCDBId* GetEntryId(const AliCDBId& queryId);
33 virtual TList* GetEntries(const AliCDBId& queryId);
34 virtual Bool_t PutEntry(AliCDBEntry* entry);
35 virtual TList* GetIdListFromFile(const char* fileName);
39 AliCDBLocal(const AliCDBLocal & source);
40 AliCDBLocal & operator=(const AliCDBLocal & source);
41 AliCDBLocal(const char* baseDir);
42 virtual ~AliCDBLocal();
44 Bool_t FilenameToId(const char* filename, AliCDBRunRange& runRange,
45 Int_t& version, Int_t& subVersion);
47 Bool_t PrepareId(AliCDBId& id);
48 // Bool_t GetId(const AliCDBId& query, AliCDBId& result);
49 AliCDBId* GetId(const AliCDBId& query);
51 virtual void QueryValidFiles();
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);
57 TString fBaseDirectory; // path of the DB folder
59 ClassDef(AliCDBLocal, 0); // access class to a DataBase in a local storage
62 /////////////////////////////////////////////////////////////////////
64 // class AliCDBLocalFactory //
66 /////////////////////////////////////////////////////////////////////
68 class AliCDBLocalFactory: public AliCDBStorageFactory {
72 virtual Bool_t Validate(const char* dbString);
73 virtual AliCDBParam* CreateParameter(const char* dbString);
76 virtual AliCDBStorage* Create(const AliCDBParam* param);
78 ClassDef(AliCDBLocalFactory, 0);
81 /////////////////////////////////////////////////////////////////////
83 // class AliCDBLocalParam //
85 /////////////////////////////////////////////////////////////////////
87 class AliCDBLocalParam: public AliCDBParam {
91 AliCDBLocalParam(const char* dbPath);
93 virtual ~AliCDBLocalParam();
95 const TString& GetPath() const {return fDBPath;};
97 virtual AliCDBParam* CloneParam() const;
99 virtual ULong_t Hash() const;
100 virtual Bool_t IsEqual(const TObject* obj) const;
104 TString fDBPath; // path of the DB folder
106 ClassDef(AliCDBLocalParam, 0);