]>
Commit | Line | Data |
---|---|---|
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 | /// |
7332f213 | 22 | /// A simple implementation of iterator for 1Dmaps. |
83c386fb | 23 | /// |
24 | /// \author Laurent Aphecetche | |
3d1463c8 | 25 | //----------------------------------------------------------------------------- |
83c386fb | 26 | |
cb6388d5 | 27 | #include "AliMUON1DMapIterator.h" |
28 | #include "AliMpExMap.h" | |
cb6388d5 | 29 | |
83c386fb | 30 | /// \cond CLASSIMP |
31 | ClassImp(AliMUON1DMapIterator) | |
32 | /// \endcond | |
33 | ||
34 | //_____________________________________________________________________________ | |
7332f213 | 35 | AliMUON1DMapIterator::AliMUON1DMapIterator(const AliMpExMap& theMap) |
cb6388d5 | 36 | : TIterator(), |
7332f213 | 37 | fkMap(&theMap), |
38 | fCurrentI(-1) | |
83c386fb | 39 | { |
40 | /// default ctor | |
83c386fb | 41 | } |
42 | ||
cb6388d5 | 43 | //_____________________________________________________________________________ |
44 | AliMUON1DMapIterator::AliMUON1DMapIterator(const AliMUON1DMapIterator& rhs) | |
45 | : TIterator(rhs), | |
7332f213 | 46 | fkMap(rhs.fkMap), |
cb6388d5 | 47 | fCurrentI(rhs.fCurrentI) |
48 | { | |
49 | /// copy ctor | |
50 | } | |
51 | ||
52 | //_____________________________________________________________________________ | |
53 | AliMUON1DMapIterator& | |
54 | AliMUON1DMapIterator::operator=(const AliMUON1DMapIterator& rhs) | |
55 | { | |
56 | /// assignment operator | |
57 | if ( this != &rhs ) | |
58 | { | |
7332f213 | 59 | fkMap = rhs.fkMap; |
cb6388d5 | 60 | fCurrentI = rhs.fCurrentI; |
61 | } | |
62 | return *this; | |
63 | } | |
64 | ||
65 | //_____________________________________________________________________________ | |
66 | TIterator& | |
67 | AliMUON1DMapIterator::operator=(const TIterator& rhs) | |
68 | { | |
69 | /// overriden operator= (imposed by Root definition of TIterator::operator= ?) | |
70 | ||
71 | if ( this != &rhs && rhs.IsA() == AliMUON1DMapIterator::Class() ) | |
72 | { | |
73 | const AliMUON1DMapIterator& rhs1 = static_cast<const AliMUON1DMapIterator&>(rhs); | |
7332f213 | 74 | fkMap = rhs1.fkMap; |
cb6388d5 | 75 | fCurrentI = rhs1.fCurrentI; |
76 | } | |
77 | return *this; | |
78 | } | |
79 | ||
80 | ||
83c386fb | 81 | //_____________________________________________________________________________ |
82 | AliMUON1DMapIterator::~AliMUON1DMapIterator() | |
83 | { | |
84 | /// dtor | |
85 | } | |
86 | ||
87 | //_____________________________________________________________________________ | |
88 | TObject* | |
89 | AliMUON1DMapIterator::Next() | |
90 | { | |
cb6388d5 | 91 | /// Return next object in iteration |
7332f213 | 92 | return (++fCurrentI < fkMap->GetSize()) ? fkMap->GetObjectFast(fCurrentI) : 0x0; |
83c386fb | 93 | } |
94 | ||
95 | //_____________________________________________________________________________ | |
96 | void | |
97 | AliMUON1DMapIterator::Reset() | |
98 | { | |
99 | /// rewind the iterator | |
7332f213 | 100 | fCurrentI = -1; |
83c386fb | 101 | } |