4 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
5 * See cxx source for full Copyright notice */
7 /////////////////////////////////////////////////////////////////////
10 // access class to a DataBase in a dump storage (single file) //
12 /////////////////////////////////////////////////////////////////////
14 #include "AliCDBStorage.h"
15 #include "AliCDBManager.h"
20 class AliCDBDump: public AliCDBStorage {
21 friend class AliCDBDumpFactory;
25 virtual Bool_t IsReadOnly() const {return fReadOnly;};
26 virtual Bool_t HasSubVersion() const {return kFALSE;};
27 virtual Bool_t Contains(const char* path) const;
28 virtual Int_t GetLatestVersion(const char* path, Int_t run);
29 virtual Int_t GetLatestSubVersion(const char* path, Int_t run, Int_t version=-1);
30 virtual Bool_t IdToFilename(const AliCDBId& id, TString& filename) const;
34 virtual AliCDBEntry* GetEntry(const AliCDBId& query);
35 virtual TList* GetEntries(const AliCDBId& query);
36 virtual Bool_t PutEntry(AliCDBEntry* entry);
37 virtual TList* GetIdListFromFile(const char* fileName);
41 AliCDBDump(const AliCDBDump & source);
42 AliCDBDump & operator=(const AliCDBDump & source);
43 AliCDBDump(const char* dbFile, Bool_t readOnly);
44 virtual ~AliCDBDump();
46 Bool_t KeyNameToId(const char* keyname, AliCDBRunRange& runRange,
47 Int_t& version, Int_t& subVersion);
48 Bool_t IdToKeyName(const AliCDBRunRange& runRange, Int_t version,
49 Int_t subVersion, TString& keyname);
51 Bool_t MkDir(const TString& dir);
54 Bool_t PrepareId(AliCDBId& id);
55 Bool_t GetId(const AliCDBId& query, AliCDBId& result);
57 virtual void QueryValidFiles();
59 void GetEntriesForLevel0(const AliCDBId& query, TList* result);
60 void GetEntriesForLevel1(const AliCDBId& query, TList* result);
62 TFile* fFile; // Dump file
63 Bool_t fReadOnly; // ReadOnly flag
65 ClassDef(AliCDBDump, 0);
68 /////////////////////////////////////////////////////////////////////
70 // class AliCDBDumpFactory //
72 /////////////////////////////////////////////////////////////////////
74 class AliCDBDumpFactory: public AliCDBStorageFactory {
78 virtual Bool_t Validate(const char* dbString);
79 virtual AliCDBParam* CreateParameter(const char* dbString);
82 virtual AliCDBStorage* Create(const AliCDBParam* param);
84 ClassDef(AliCDBDumpFactory, 0);
87 /////////////////////////////////////////////////////////////////////
89 // class AliCDBDumpParam //
91 /////////////////////////////////////////////////////////////////////
93 class AliCDBDumpParam: public AliCDBParam {
97 AliCDBDumpParam(const char* dbPath, Bool_t readOnly = kFALSE);
99 virtual ~AliCDBDumpParam();
101 const TString& GetPath() const {return fDBPath;};
102 Bool_t IsReadOnly() const {return fReadOnly;};
104 virtual AliCDBParam* CloneParam() const;
106 virtual ULong_t Hash() const;
107 virtual Bool_t IsEqual(const TObject* obj) const;
111 TString fDBPath; // Dump file path name
112 Bool_t fReadOnly; // ReadOnly flag
114 ClassDef(AliCDBDumpParam, 0);