1 /**************************************************************************
2 * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. *
4 * Author: The ALICE Off-line Project. *
5 * Contributors are mentioned in the code where appropriate. *
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 **************************************************************************/
18 //-----------------------------------------------------------------------------
19 // Class AliMpExMapIterator
20 // ------------------------
21 // Implementation of TIterator for AliMpExMap
22 // Author: Laurent Aphecetche
23 //-----------------------------------------------------------------------------
25 #include "AliMpExMapIterator.h"
26 #include "AliMpExMap.h"
35 ClassImp(AliMpExMapIterator)
38 //_____________________________________________________________________________
39 AliMpExMapIterator::AliMpExMapIterator(const AliMpExMap& theMap)
41 fIterator(new TExMapIter(&(theMap.fMap)))
43 /// Standard constructor
46 //_____________________________________________________________________________
47 AliMpExMapIterator::AliMpExMapIterator(const AliMpExMapIterator& rhs)
49 fIterator(rhs.fIterator)
54 //_____________________________________________________________________________
56 AliMpExMapIterator::operator=(const AliMpExMapIterator& rhs)
58 /// Assignment operator
62 fIterator = rhs.fIterator;
67 //_____________________________________________________________________________
69 AliMpExMapIterator::operator=(const TIterator& rhs)
71 /// Overriden operator= (imposed by Root's definition of TIterator::operator= ?)
73 if ( this != &rhs && rhs.IsA() == AliMpExMapIterator::Class() )
75 const AliMpExMapIterator& rhs1 = static_cast<const AliMpExMapIterator&>(rhs);
76 fIterator = rhs1.fIterator;
81 //_____________________________________________________________________________
82 AliMpExMapIterator::~AliMpExMapIterator()
89 //_____________________________________________________________________________
90 #if ROOT_SVN_REVISION >= 29598
92 AliMpExMapIterator::Next(Long64_t& index, TObject*& object)
95 AliMpExMapIterator::Next(Long_t& index, TObject*& object)
98 /// Move to next object in iteration
100 #if ROOT_SVN_REVISION >= 29598
108 Bool_t rv = fIterator->Next(index,value);
112 object = reinterpret_cast<TObject*> (value);
118 //_____________________________________________________________________________
120 AliMpExMapIterator::Next()
122 /// Return the next object in iteration.
123 /// The returned object must not be deleted by the user.
125 #if ROOT_SVN_REVISION >= 29598
135 //_____________________________________________________________________________
137 AliMpExMapIterator::Next(Int_t& key)
139 /// Return the next object in iteration and fill the key.
140 /// The returned object must not be deleted by the user.
143 #if ROOT_SVN_REVISION >= 29598
149 key = (Int_t)(index);
153 //_____________________________________________________________________________
155 AliMpExMapIterator::Next(Int_t& keyFirst, Int_t& keySecond)
157 /// Return the next object in iteration and fill the key.
158 /// The returned object must not be deleted by the user.
160 #if ROOT_SVN_REVISION >= 29598
167 keyFirst = AliMpExMap::GetPairFirst(index);
168 keySecond = AliMpExMap::GetPairSecond(index);
172 //_____________________________________________________________________________
174 AliMpExMapIterator::Next(TString& key)
176 /// Return the next object in iteration and fill the key.
177 /// The returned object must not be deleted by the user.
179 #if ROOT_SVN_REVISION >= 29598
186 key = AliMpExMap::GetString(index);
190 //_____________________________________________________________________________
192 AliMpExMapIterator::Reset()
199 //_____________________________________________________________________________
201 AliMpExMapIterator::GetCollection() const
203 /// Nothing to be returned here, AliMpExMap is not a TCollection