Fix for bug#78633
[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);
33 void AddDefaultObject(TNamed* obj);
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();
58a28442 49 private:
50 Int_t HasOverlap(Int_t lower, Int_t upper);
51 Int_t GetIndexForRun(Int_t run) const;
cc336771 52 private :
bad1b400 53 TObjArray* fArray; // Array with objects corresponding to run ranges
54 TList* fDefaultList; // List with default arrays
cc336771 55 TArrayI fLowerLimits; // lower limit of run range
56 TArrayI fUpperLimits; // upper limit of run range
57 Int_t fEntries; // Number of entries
58 ClassDef(AliOADBContainer, 1);
59};
60
61#endif