]>
Commit | Line | Data |
---|---|---|
c623aa64 | 1 | /* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * |
2 | * See cxx source for full Copyright notice */ | |
3 | ||
4 | // $Id$ | |
5 | ||
46df088d | 6 | /// \ingroup core |
c623aa64 | 7 | /// \class AliMpStringObjMap |
8 | /// \brief Substitutes map <string, TObject> which ALICE does not allow to use | |
9 | /// | |
2a116780 | 10 | /// The map is not optimised for large data size |
11 | /// | |
13985652 | 12 | /// \author Ivana Hrivnacova, IPN Orsay |
c623aa64 | 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 | ||
b80faac0 | 21 | using std::ofstream; |
22 | ||
c623aa64 | 23 | class AliMpStringObjMap : public TObject |
24 | { | |
25 | public: | |
973e9d18 | 26 | AliMpStringObjMap(Bool_t isOwner = false); |
c623aa64 | 27 | virtual ~AliMpStringObjMap(); |
28 | ||
29 | // methods | |
30 | Bool_t Add(const TString& first, TObject* second); | |
31 | TObject* Get(const TString& first) const; | |
32 | Int_t GetNofItems() const; | |
33 | virtual void Clear(Option_t* /*option*/ =""); | |
34 | virtual void Print(const char* /*option*/ = "") const; | |
35 | void Print(const TString& key, ofstream& out) const; | |
36 | ||
2a116780 | 37 | // iterating over elements |
38 | void First(); | |
39 | void Next(); | |
40 | TObject* CurrentItem(); | |
41 | TString CurrentKey(); | |
42 | Bool_t IsDone() const; | |
43 | ||
13e7956b | 44 | private: |
f5671fc3 | 45 | /// Not implemented |
c623aa64 | 46 | AliMpStringObjMap(const AliMpStringObjMap& rhs); |
f5671fc3 | 47 | /// Not implemented |
c623aa64 | 48 | AliMpStringObjMap& operator = (const AliMpStringObjMap& rhs); |
2a116780 | 49 | |
31edb2d7 | 50 | // static methods |
51 | static const TString& GetUndefinedKey(); | |
13e7956b | 52 | |
c623aa64 | 53 | // data members |
2a116780 | 54 | Int_t fNofItems; ///< number of items |
55 | TObjArray fFirstArray; ///< first item array | |
56 | TObjArray fSecondArray; ///< second item array | |
57 | Int_t fCurrentIndex; ///< current item index (for iteration) | |
c623aa64 | 58 | |
59 | ClassDef(AliMpStringObjMap,1) // motif map | |
60 | }; | |
61 | ||
62 | #endif //ALI_MP_STRING_OBJ_MAP_H |