/************************************************************************** * Copyright(c) 1998-1999, ALICE Experiment at CERN, All rights reserved. * * * * Author: The ALICE Off-line Project. * * Contributors are mentioned in the code where appropriate. * * * * Permission to use, copy, modify and distribute this software and its * * documentation strictly for non-commercial purposes is hereby granted * * without fee, provided that the above copyright notice appears in all * * copies and that both the copyright notice and this permission notice * * appear in the supporting documentation. The authors make no claims * * about the suitability of this software for any purpose. It is * * provided "as is" without express or implied warranty. * **************************************************************************/ // $Id$ #include "AliMpExMapIterator.h" #include "AliLog.h" #include "AliMpExMap.h" #include "AliMpIntPair.h" #include #include #include /// \cond CLASSIMP ClassImp(AliMpExMapIterator) /// \endcond //_____________________________________________________________________________ AliMpExMapIterator::AliMpExMapIterator(const AliMpExMap& theMap) : fIterator(new TExMapIter(&(theMap.fMap))) { /// Standard constructor } //_____________________________________________________________________________ AliMpExMapIterator::AliMpExMapIterator(const AliMpExMapIterator& rhs) : fIterator(rhs.fIterator) { /// Copy constructor } //_____________________________________________________________________________ AliMpExMapIterator& AliMpExMapIterator::operator=(const AliMpExMapIterator& rhs) { /// Assignment operator if ( this != &rhs ) { fIterator = rhs.fIterator; } return *this; } //_____________________________________________________________________________ TIterator& AliMpExMapIterator::operator=(const TIterator& rhs) { /// overriden operator= (imposed by Root's definition of TIterator::operator= ?) if ( this != &rhs && rhs.IsA() == AliMpExMapIterator::Class() ) { const AliMpExMapIterator& rhs1 = static_cast(rhs); fIterator = rhs1.fIterator; } return *this; } //_____________________________________________________________________________ AliMpExMapIterator::~AliMpExMapIterator() { /// Destructor delete fIterator; } //_____________________________________________________________________________ Bool_t AliMpExMapIterator::Next(Long_t& index, TObject*& object) { /// Move to next object in iteration Long_t value(0); object = 0; Bool_t rv = fIterator->Next(index,value); if ( rv ) { object = reinterpret_cast (value); } return rv; } //_____________________________________________________________________________ TObject* AliMpExMapIterator::Next() { /// Return the next object in iteration. /// The returned object must not be deleted by the user. Long_t dummy; TObject* o(0x0); Next(dummy,o); return o; } //_____________________________________________________________________________ TObject* AliMpExMapIterator::Next(Int_t& key) { /// Return the next object in iteration and fill the key. /// The returned object must not be deleted by the user. TObject* o; Long_t index; Next(index,o); key = (Int_t)(index); return o; } //_____________________________________________________________________________ TObject* AliMpExMapIterator::Next(AliMpIntPair& key) { /// Return the next object in iteration and fill the key. /// The returned object must not be deleted by the user. Long_t index; TObject* o(0x0); Next(index,o); key = AliMpExMap::GetPair(index); return o; } //_____________________________________________________________________________ TObject* AliMpExMapIterator::Next(TString& key) { /// Return the next object in iteration and fill the key. /// The returned object must not be deleted by the user. Long_t index; TObject* o(0x0); Next(index,o); key = AliMpExMap::GetString(index); return o; } //_____________________________________________________________________________ void AliMpExMapIterator::Reset() { /// Reset fIterator->Reset(); } //_____________________________________________________________________________ const TCollection* AliMpExMapIterator::GetCollection() const { /// Nothing to be returned here, AliMpExMap is not a TCollection return 0x0; }