]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/mapping/AliMpStringObjMap.h
Reverting commit from rev. 37415;
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpStringObjMap.h
1 /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
2  * See cxx source for full Copyright notice                               */
3
4 // $Id$
5
6 /// \ingroup core
7 /// \class AliMpStringObjMap
8 /// \brief Substitutes map <string, TObject> which ALICE does not allow to use 
9 ///
10 /// The map is not optimised for large data size
11 ///
12 /// \author Ivana Hrivnacova, IPN Orsay
13
14 #ifndef ALI_MP_STRING_OBJ_MAP_H
15 #define ALI_MP_STRING_OBJ_MAP_H
16
17 #include <TObject.h>
18 #include <TObjArray.h>
19 #include <TArrayI.h>
20
21 class AliMpStringObjMap : public TObject
22 {
23   public:
24     AliMpStringObjMap(Bool_t isOwner = false);
25     virtual ~AliMpStringObjMap();
26     
27     // methods
28     Bool_t    Add(const TString& first, TObject* second);
29     TObject*  Get(const TString& first) const;
30     Int_t     GetNofItems() const;
31     virtual void Clear(Option_t* /*option*/ ="");
32     virtual void Print(const char* /*option*/ = "") const;
33     void Print(const TString& key, ofstream& out) const;
34     
35     // iterating over elements
36     void  First();
37     void  Next();
38     TObject*  CurrentItem();
39     TString   CurrentKey();
40     Bool_t  IsDone() const;
41     
42   private:
43     /// Not implemented
44     AliMpStringObjMap(const AliMpStringObjMap& rhs);
45     /// Not implemented
46     AliMpStringObjMap& operator = (const AliMpStringObjMap& rhs);
47     
48     // static data members
49     static const TString fgkUndefinedKey; ///< Undefined key string
50
51     // data members
52     Int_t      fNofItems;     ///<  number of items
53     TObjArray  fFirstArray;   ///<  first item array
54     TObjArray  fSecondArray;  ///<  second item array
55     Int_t      fCurrentIndex; ///<  current item index (for iteration)
56  
57   ClassDef(AliMpStringObjMap,1)  // motif map
58 };    
59
60 #endif //ALI_MP_STRING_OBJ_MAP_H