**************************************************************************/
// $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>
: TObject(),
fNofItems(0),
fFirstArray(100),
- fSecondArray(100)
+ fSecondArray(100),
+ fCurrentIndex(0)
{
/// Standard constructor
<< 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;
+}