In loadlibs.C:
[u/mrichter/AliRoot.git] / OADB / AliOADBContainer.h
CommitLineData
cc336771 1#ifndef AliOADBContainer_H
2#define AliOADBContainer_H
3/* Copyright(c) 1998-2007, ALICE Experiment at CERN, All rights reserved. *
4 * See cxx source for full Copyright notice */
5
6/* $Id$ */
7
8//-------------------------------------------------------------------------
9// Offline Analysis Database Container and Service Class
10// Author: Andreas Morsch, CERN
11//-------------------------------------------------------------------------
12
13#include <TNamed.h>
58a28442 14#include <TList.h>
cc336771 15#include <TArrayI.h>
35f37af6 16#include <TObjArray.h>
cc336771 17
18class TObjArray;
19class TArrayI;
20
21class AliOADBContainer : public TNamed {
22
23 public :
24 AliOADBContainer();
25 AliOADBContainer(char* name);
26 virtual ~AliOADBContainer();
27 AliOADBContainer(const AliOADBContainer& cont);
28 AliOADBContainer& operator=(const AliOADBContainer& cont);
35f37af6 29// Object adding and removal
58a28442 30 void AppendObject(TObject* obj, Int_t lower, Int_t upper);
31 void UpdateObject(Int_t index, TObject* obj, Int_t lower, Int_t upper);
32 void RemoveObject(Int_t index);
08b752d1 33 void AddDefaultObject(TObject* obj);
58a28442 34 void CleanDefaultList();
35 TList* GetDefaultList() const {return fDefaultList;}
35f37af6 36// I/O
37 void WriteToFile(char* fname) const;
38 Int_t InitFromFile(char* fname, char* key);
39// Getters
40 Int_t GetNumberOfEntries() const {return fEntries;}
41 Int_t LowerLimit(Int_t idx) const {return fLowerLimits[idx];}
42 Int_t UpperLimit(Int_t idx) const {return fUpperLimits[idx];}
bad1b400 43 TObject* GetObject(Int_t run, char* def = "") const;
44 TObject* GetObjectByIndex(Int_t run) const;
58a28442 45 TObject* GetDefaultObject(char* key)
46 {return(fDefaultList->FindObject(key));}
35f37af6 47// Debugging
cc336771 48 void List();
08b752d1 49// Browsable
50 virtual Bool_t IsFolder() const { return kTRUE; }
51 void Browse(TBrowser *b);
3e0970a1 52 Int_t GetIndexForRun(Int_t run) const;
58a28442 53 private:
63671ce7 54 Int_t HasOverlap(Int_t lower, Int_t upper) const;
cc336771 55 private :
bad1b400 56 TObjArray* fArray; // Array with objects corresponding to run ranges
57 TList* fDefaultList; // List with default arrays
cc336771 58 TArrayI fLowerLimits; // lower limit of run range
59 TArrayI fUpperLimits; // upper limit of run range
60 Int_t fEntries; // Number of entries
08b752d1 61// TString fRelPath; // Relative path to object
62
cc336771 63 ClassDef(AliOADBContainer, 1);
64};
65
66#endif