]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - STEER/AliCDBStorage.h
Implementation of the local caching of the OCDB set required some upgrade of the...
[u/mrichter/AliRoot.git] / STEER / AliCDBStorage.h
index cba746be5e9fe98fd5580ce2f2c9f9ab0e1f19f4..d8c3fcf558c93ab90032075affff043d01013c30 100644 (file)
 
 #include "AliCDBId.h"
 #include "AliCDBMetaData.h"
+#include "AliCDBManager.h"
 
 #include <TList.h>
+#include <TObjArray.h>
 
 class AliCDBEntry;
 class AliCDBPath;
+class AliCDBParam;
+class TFile;
 
 class AliCDBStorage: public TObject {
 
 public:
+
        AliCDBStorage();
 
        void SetURI(const TString& uri) {fURI = uri;}
        const TString& GetURI() const {return fURI;}
        const TString& GetType() const {return fType;}
        const TString& GetBaseFolder() const {return fBaseFolder;}
+       AliCDBManager::DataType GetDataType() const;
 
 
        void ReadSelectionFromFile(const char *fileName);
@@ -61,7 +67,7 @@ public:
        void PrintSelectionList();
 
        AliCDBEntry* Get(const AliCDBId& query);
-       AliCDBEntry* Get(const AliCDBPath& path, Int_t runNumber, 
+       AliCDBEntry* Get(const AliCDBPath& path, Int_t runNumber,
                                Int_t version = -1, Int_t subVersion = -1);
        AliCDBEntry* Get(const AliCDBPath& path, const AliCDBRunRange& runRange,
                                 Int_t version = -1, Int_t subVersion = -1);
@@ -72,9 +78,15 @@ public:
        TList* GetAll(const AliCDBPath& path, const AliCDBRunRange& runRange,
                                 Int_t version = -1, Int_t subVersion = -1);
        
-       Bool_t Put(TObject* object, AliCDBId& id,  AliCDBMetaData* metaData);
-       Bool_t Put(AliCDBEntry* entry);
+       AliCDBId* GetId(const AliCDBId& query);
+       AliCDBId* GetId(const AliCDBPath& path, Int_t runNumber,
+                               Int_t version = -1, Int_t subVersion = -1);
+       AliCDBId* GetId(const AliCDBPath& path, const AliCDBRunRange& runRange,
+                                Int_t version = -1, Int_t subVersion = -1);
 
+       Bool_t Put(TObject* object, AliCDBId& id,  AliCDBMetaData* metaData,
+                               AliCDBManager::DataType type=AliCDBManager::kPrivate);
+       Bool_t Put(AliCDBEntry* entry, AliCDBManager::DataType type=AliCDBManager::kPrivate);
 
        virtual Bool_t IsReadOnly() const = 0;
        virtual Bool_t HasSubVersion() const = 0;
@@ -84,7 +96,7 @@ public:
        void QueryCDB(Int_t run, const char* pathFilter="*",
                        Int_t version=-1, AliCDBMetaData *mdFilter=0);
        void PrintQueryCDB();
-       TList* GetQueryCDBList() {return &fValidFileIds;}
+       TObjArray* GetQueryCDBList() {return &fValidFileIds;}
 
        virtual Int_t GetLatestVersion(const char* path, Int_t run)=0;
        virtual Int_t GetLatestSubVersion(const char* path, Int_t run, Int_t version=-1)=0;
@@ -94,12 +106,15 @@ protected:
        virtual ~AliCDBStorage();
        void    GetSelection(/*const*/ AliCDBId* id);
        virtual AliCDBEntry* GetEntry(const AliCDBId& query) = 0;
+       virtual AliCDBId* GetEntryId(const AliCDBId& query) = 0;
        virtual TList* GetEntries(const AliCDBId& query) = 0;
        virtual Bool_t PutEntry(AliCDBEntry* entry) = 0;
        virtual TList *GetIdListFromFile(const char* fileName)=0;
        virtual void   QueryValidFiles() = 0;
+       void    LoadTreeFromFile(AliCDBEntry* entry) const;
+       //void  SetTreeToFile(AliCDBEntry* entry, TFile* file) const;
 
-       TList fValidFileIds;    // list of Id's of the files valid for a given run (cached as fRun)
+       TObjArray fValidFileIds;        // list of Id's of the files valid for a given run (cached as fRun)
        Int_t fRun;             // run number, used to manage list of valid files
        AliCDBPath fPathFilter; // path filter, used to manage list of valid files
        Int_t fVersion;         // version, used to manage list of valid files