]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUON1DMapIterator.cxx
Initial version (Laurent)
[u/mrichter/AliRoot.git] / MUON / AliMUON1DMapIterator.cxx
CommitLineData
83c386fb 1/**************************************************************************
2* Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
3* *
4* Author: The ALICE Off-line Project. *
5* Contributors are mentioned in the code where appropriate. *
6* *
7* Permission to use, copy, modify and distribute this software and its *
8* documentation strictly for non-commercial purposes is hereby granted *
9* without fee, provided that the above copyright notice appears in all *
10* copies and that both the copyright notice and this permission notice *
11* appear in the supporting documentation. The authors make no claims *
12* about the suitability of this software for any purpose. It is *
13* provided "as is" without express or implied warranty. *
14**************************************************************************/
15
16// $Id$
17
3d1463c8 18//-----------------------------------------------------------------------------
83c386fb 19/// \class AliMUON1DMapIterator
cb6388d5 20/// Implementation of TIterator for 1Dmaps
83c386fb 21///
22/// A simple implementation of VDataIterator for 1Dmaps.
23///
24/// \author Laurent Aphecetche
3d1463c8 25//-----------------------------------------------------------------------------
83c386fb 26
cb6388d5 27#include "AliMUON1DMapIterator.h"
28#include "AliMpExMap.h"
29#include "AliLog.h"
30#include "AliMpIntPair.h"
31#include "AliMpExMap.h"
32
83c386fb 33/// \cond CLASSIMP
34ClassImp(AliMUON1DMapIterator)
35/// \endcond
36
37//_____________________________________________________________________________
38AliMUON1DMapIterator::AliMUON1DMapIterator(AliMpExMap& theMap)
cb6388d5 39: TIterator(),
83c386fb 40fIter(theMap.GetIterator()),
41fCurrentI(-1)
42{
43 /// default ctor
44 Reset();
45}
46
cb6388d5 47//_____________________________________________________________________________
48AliMUON1DMapIterator::AliMUON1DMapIterator(const AliMUON1DMapIterator& rhs)
49: TIterator(rhs),
50 fIter(rhs.fIter),
51 fCurrentI(rhs.fCurrentI)
52{
53 /// copy ctor
54}
55
56//_____________________________________________________________________________
57AliMUON1DMapIterator&
58AliMUON1DMapIterator::operator=(const AliMUON1DMapIterator& rhs)
59{
60 /// assignment operator
61 if ( this != &rhs )
62 {
63 fIter = rhs.fIter;
64 fCurrentI = rhs.fCurrentI;
65 }
66 return *this;
67}
68
69//_____________________________________________________________________________
70TIterator&
71AliMUON1DMapIterator::operator=(const TIterator& rhs)
72{
73 /// overriden operator= (imposed by Root definition of TIterator::operator= ?)
74
75 if ( this != &rhs && rhs.IsA() == AliMUON1DMapIterator::Class() )
76 {
77 const AliMUON1DMapIterator& rhs1 = static_cast<const AliMUON1DMapIterator&>(rhs);
78 fIter = rhs1.fIter;
79 fCurrentI = rhs1.fCurrentI;
80 }
81 return *this;
82}
83
84
83c386fb 85//_____________________________________________________________________________
86AliMUON1DMapIterator::~AliMUON1DMapIterator()
87{
88 /// dtor
89}
90
91//_____________________________________________________________________________
92TObject*
93AliMUON1DMapIterator::Next()
94{
cb6388d5 95 /// Return next object in iteration
83c386fb 96
97 Long_t key, value;
98 Bool_t ok = fIter.Next(key,value);
99 if (!ok) return 0x0;
cb6388d5 100 return reinterpret_cast<TObject*>(value);
83c386fb 101}
102
103//_____________________________________________________________________________
104void
105AliMUON1DMapIterator::Reset()
106{
107 /// rewind the iterator
108 fIter.Reset();
109}