]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/mapping/AliMpExMap.h
Reverting commit from rev. 37415;
[u/mrichter/AliRoot.git] / MUON / mapping / AliMpExMap.h
index 0395a54e14ce30a31ec085ff9c3be7a91b125730..b965e058884159114359cdfa10f64dc0b920d123 100644 (file)
@@ -2,16 +2,16 @@
  * See cxx source for full Copyright notice                               */
 
 // $Id$
-// $MpId: AliMpExMap.h,v 1.1 2005/09/26 16:16:16 ivana Exp $
+// $MpId: AliMpExMap.h,v 1.4 2006/05/24 13:58:07 ivana Exp $
 
-/// \ingroup basic
+/// \ingroup core
 /// \class AliMpExMap
 /// \brief Helper class making Root persistent TExMap
 ///
 /// The objects and keys from TExMap are store in additional
 /// arrays which are Root persistent.
 ///
-/// Author: Ivana Hrivnacova; IPN Orsay
+/// \author Ivana Hrivnacova; IPN Orsay
 
 #ifndef ALI_MP_EX_MAP_H
 #define ALI_MP_EX_MAP_H
 #include <TArrayL.h>
 #include <TExMap.h>
 
-class TString;
+class AliMpExMapIterator;
 
-class AliMpIntPair;
+class TString;
 
 class AliMpExMap : public TObject
 {
+  friend class AliMpExMapIterator;
+  
   public:
-    AliMpExMap(Bool_t standardConstructor);
     AliMpExMap();
+    AliMpExMap(TRootIOCtor* /*ioCtor*/);
+    AliMpExMap(const AliMpExMap& rhs);
+    AliMpExMap& operator=(const AliMpExMap& rhs);
     virtual ~AliMpExMap();
     
+    
     // static methods
-    // conversion between varius keys and Long_t
-    //
-    static Long_t  GetIndex(const AliMpIntPair& pair);
+    // conversion between String and Long_t
     static Long_t  GetIndex(const TString& s);
-    static AliMpIntPair  GetPair(Long_t index);
-    static TString       GetString(Long_t index);
+    static TString GetString(Long_t index);
+
+    // methods from base class
+    virtual void Clear(Option_t* opt="");
+    virtual void Print(Option_t* opt="") const;
 
     // set methods
-    void Add(const AliMpIntPair& key, TObject* object);
+    void Add(Int_t keyFirst, Int_t keySecond, TObject* object);
     void Add(const TString& key, TObject* object);
     void Add(Int_t key, TObject* object);
 
@@ -49,33 +55,42 @@ class AliMpExMap : public TObject
     void SetOwner(Bool_t owner);
     
     // get methods
-    Int_t       GetSize() const;
-    TExMapIter  GetIterator() const;
-
-    TObject*    GetValue(const AliMpIntPair& key) const;
+    Int_t GetSize() const;
+    Int_t GetCapacity() const;
+    
+    TObject*    GetValue(Int_t keyFirst, Int_t keySecond) const;
     TObject*    GetValue(const TString& key) const;
     TObject*    GetValue(Int_t key) const;
+
+    AliMpExMapIterator* CreateIterator() const;
     
   private:  
     // methods
+
+    // conversion between Int_t pair key and Long_t
+    static Long_t  GetIndex(Int_t first, Int_t second);
+    static Int_t   GetPairFirst(Long_t index);
+    static Int_t   GetPairSecond(Long_t index);
+
     void FillMap();
     void AddKey(Long_t key);
+    void Copy(TObject& dest) const;
     
     // static data members
-    static const Int_t    fgkDefaultSize;      // Default initial size
-    static const Bool_t   fgkDefaultOwnership; // Default ownership
-
-    static const Int_t    fgkSeparator1; // the separator used for conversion
-                                         // of AliMpIntPair to Int_t
-    static const Int_t    fgkSeparator2; // the separator used for conversion
-                                         // of TString to Int_t
-    static const TString  fgkCharacterMap; // the string mapping characters 
-                                           // to integers 
+    static const Int_t    fgkDefaultSize;      ///< Default initial size
+    static const Bool_t   fgkDefaultOwnership; ///< Default ownership
+
+    static const Int_t    fgkSeparator1; ///< \brief the separator used for conversion
+                                         ///  of Int_t pair to Int_t
+    static const Int_t    fgkSeparator2; ///< \brief the separator used for conversion
+                                         // of TString to Int_t
+    static const TString  fgkCharacterMap; ///< \brief the string mapping characters 
+                                           // to integers 
     
     // data members
-    mutable TExMap  fMap;     //! Transient map class
-    TObjArray       fObjects; // Array of objects 
-    TArrayL         fKeys;    // Array of keys 
+    mutable TExMap  fMap;     //! Transient map class
+    TObjArray       fObjects; ///<  Array of objects 
+    TArrayL         fKeys;    ///<  Array of keys 
 
   ClassDef(AliMpExMap,1)  // Root persistent TExMap
 };