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 AliCDBId* GetEntryId(const AliCDBId& query);
36 virtual TList* GetEntries(const AliCDBId& query);
37 virtual Bool_t PutEntry(AliCDBEntry* entry);
38 virtual TList* GetIdListFromFile(const char* fileName);
42 AliCDBDump(const AliCDBDump & source);
43 AliCDBDump & operator=(const AliCDBDump & source);
44 AliCDBDump(const char* dbFile, Bool_t readOnly);
45 virtual ~AliCDBDump();
47 Bool_t KeyNameToId(const char* keyname, AliCDBRunRange& runRange,
48 Int_t& version, Int_t& subVersion);
49 Bool_t IdToKeyName(const AliCDBRunRange& runRange, Int_t version,
50 Int_t subVersion, TString& keyname);
52 Bool_t MkDir(const TString& dir);
55 Bool_t PrepareId(AliCDBId& id);
56 // Bool_t GetId(const AliCDBId& query, AliCDBId& result);
57 AliCDBId* GetId(const AliCDBId& query);
59 virtual void QueryValidFiles();
61 void GetEntriesForLevel0(const AliCDBId& query, TList* result);
62 void GetEntriesForLevel1(const AliCDBId& query, TList* result);
64 TFile* fFile; // Dump file
65 Bool_t fReadOnly; // ReadOnly flag
67 ClassDef(AliCDBDump, 0);
70 /////////////////////////////////////////////////////////////////////
72 // class AliCDBDumpFactory //
74 /////////////////////////////////////////////////////////////////////
76 class AliCDBDumpFactory: public AliCDBStorageFactory {
80 virtual Bool_t Validate(const char* dbString);
81 virtual AliCDBParam* CreateParameter(const char* dbString);
84 virtual AliCDBStorage* Create(const AliCDBParam* param);
86 ClassDef(AliCDBDumpFactory, 0);
89 /////////////////////////////////////////////////////////////////////
91 // class AliCDBDumpParam //
93 /////////////////////////////////////////////////////////////////////
95 class AliCDBDumpParam: public AliCDBParam {
99 AliCDBDumpParam(const char* dbPath, Bool_t readOnly = kFALSE);
101 virtual ~AliCDBDumpParam();
103 const TString& GetPath() const {return fDBPath;};
104 Bool_t IsReadOnly() const {return fReadOnly;};
106 virtual AliCDBParam* CloneParam() const;
108 virtual ULong_t Hash() const;
109 virtual Bool_t IsEqual(const TObject* obj) const;
113 TString fDBPath; // Dump file path name
114 Bool_t fReadOnly; // ReadOnly flag
116 ClassDef(AliCDBDumpParam, 0);