]> git.uio.no Git - u/mrichter/AliRoot.git/blobdiff - MUON/AliMUONStringIntMap.cxx
- Adding check and flagging for HG present
[u/mrichter/AliRoot.git] / MUON / AliMUONStringIntMap.cxx
index 23b28985520053362a46d2cf82dff053119f23e1..c933730a0ac5a022e0bd7196c36e6f3e957e7e85 100644 (file)
  **************************************************************************/
 
 // $Id$
-//
-// ------------------------------------ 
+
+//-----------------------------------------------------------------------------
 // Class AliMUONStringIntMap
 // ------------------------------------ 
 // Helper class that substitutes map <string, int> 
 // which ALICE does not allow to use 
 // Author: Ivana Hrivnacova, IPN Orsay
+//-----------------------------------------------------------------------------
 
 #include <Riostream.h>
 #include <TObjString.h>
@@ -37,7 +38,8 @@ AliMUONStringIntMap::AliMUONStringIntMap()
  : TObject(),
    fNofItems(0),
    fFirstArray(100),
-   fSecondArray(100)
+   fSecondArray(100),
+   fCurrentIndex(0)
 {
 /// Standard constructor
 
@@ -171,3 +173,30 @@ void AliMUONStringIntMap::Print(const TString& key, ofstream& out) const
         << endl;
   }
 }       
+
+//______________________________________________________________________________
+Bool_t  AliMUONStringIntMap::Next(TString& first, Int_t& second)
+{
+/// Iterator: next method.
+/// Returns false if the iterator reached the end.
+
+  if ( fCurrentIndex >= fNofItems ) return false;
+  
+  TObjString* objString = (TObjString*)fFirstArray.At(fCurrentIndex);
+  first = objString->GetString();
+  
+  second = fSecondArray.At(fCurrentIndex);
+  
+  ++fCurrentIndex;
+  
+  return true;
+}  
+
+//______________________________________________________________________________
+void  AliMUONStringIntMap::ResetItr()
+{
+/// Reset iterator
+  fCurrentIndex = 0;
+}