]> git.uio.no Git - u/mrichter/AliRoot.git/blame - MUON/AliMUON1DMapIterator.cxx
- Adding comment lines to class description needed for Root documentation
[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
83c386fb 18/// \class AliMUON1DMapIterator
cb6388d5 19/// Implementation of TIterator for 1Dmaps
83c386fb 20///
21/// A simple implementation of VDataIterator for 1Dmaps.
22///
23/// \author Laurent Aphecetche
24
cb6388d5 25#include "AliMUON1DMapIterator.h"
26#include "AliMpExMap.h"
27#include "AliLog.h"
28#include "AliMpIntPair.h"
29#include "AliMpExMap.h"
30
83c386fb 31/// \cond CLASSIMP
32ClassImp(AliMUON1DMapIterator)
33/// \endcond
34
35//_____________________________________________________________________________
36AliMUON1DMapIterator::AliMUON1DMapIterator(AliMpExMap& theMap)
cb6388d5 37: TIterator(),
83c386fb 38fIter(theMap.GetIterator()),
39fCurrentI(-1)
40{
41 /// default ctor
42 Reset();
43}
44
cb6388d5 45//_____________________________________________________________________________
46AliMUON1DMapIterator::AliMUON1DMapIterator(const AliMUON1DMapIterator& rhs)
47: TIterator(rhs),
48 fIter(rhs.fIter),
49 fCurrentI(rhs.fCurrentI)
50{
51 /// copy ctor
52}
53
54//_____________________________________________________________________________
55AliMUON1DMapIterator&
56AliMUON1DMapIterator::operator=(const AliMUON1DMapIterator& rhs)
57{
58 /// assignment operator
59 if ( this != &rhs )
60 {
61 fIter = rhs.fIter;
62 fCurrentI = rhs.fCurrentI;
63 }
64 return *this;
65}
66
67//_____________________________________________________________________________
68TIterator&
69AliMUON1DMapIterator::operator=(const TIterator& rhs)
70{
71 /// overriden operator= (imposed by Root definition of TIterator::operator= ?)
72
73 if ( this != &rhs && rhs.IsA() == AliMUON1DMapIterator::Class() )
74 {
75 const AliMUON1DMapIterator& rhs1 = static_cast<const AliMUON1DMapIterator&>(rhs);
76 fIter = rhs1.fIter;
77 fCurrentI = rhs1.fCurrentI;
78 }
79 return *this;
80}
81
82
83c386fb 83//_____________________________________________________________________________
84AliMUON1DMapIterator::~AliMUON1DMapIterator()
85{
86 /// dtor
87}
88
89//_____________________________________________________________________________
90TObject*
91AliMUON1DMapIterator::Next()
92{
cb6388d5 93 /// Return next object in iteration
83c386fb 94
95 Long_t key, value;
96 Bool_t ok = fIter.Next(key,value);
97 if (!ok) return 0x0;
cb6388d5 98 return reinterpret_cast<TObject*>(value);
83c386fb 99}
100
101//_____________________________________________________________________________
102void
103AliMUON1DMapIterator::Reset()
104{
105 /// rewind the iterator
106 fIter.Reset();
107}