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 #include "AliMUON1DMap.h"
21 #include "AliMpExMap.h"
22 #include "AliMUON1DMapIterator.h"
25 /// \class AliMUON1DMap
26 /// This class is simply a wrapper to an AliMpExMap, offering in addition a
27 /// control over the replacement policy when you add
30 /// \author Laurent Aphecetche
33 ClassImp(AliMUON1DMap)
36 //_____________________________________________________________________________
37 AliMUON1DMap::AliMUON1DMap(Int_t theSize)
39 fMap(new AliMpExMap(true))
45 fMap->SetSize(theSize);
47 fMap->SetOwner(kTRUE);
50 //_____________________________________________________________________________
51 AliMUON1DMap::AliMUON1DMap(const AliMUON1DMap& other)
60 //_____________________________________________________________________________
62 AliMUON1DMap::operator=(const AliMUON1DMap& other)
64 /// Assignment operator
70 //_____________________________________________________________________________
71 AliMUON1DMap::~AliMUON1DMap()
73 /// dtor, we're the owner of our internal map.
78 //_____________________________________________________________________________
80 AliMUON1DMap::CopyTo(AliMUON1DMap& dest) const
88 //_____________________________________________________________________________
90 AliMUON1DMap::Get(Int_t i) const
92 /// Get the object located at index i, if it exists, and if i is correct.
94 return fMap->GetValue(i);
97 //_____________________________________________________________________________
99 AliMUON1DMap::Iterator() const
101 // Create and return an iterator on this map
102 // Returned iterator must be deleted by user.
105 return new AliMUON1DMapIterator(*fMap);
111 //_____________________________________________________________________________
113 AliMUON1DMap::Set(Int_t i, TObject* object, Bool_t replace)
115 /// Set the object located at i
116 /// If replace=kFALSE and there's already an object at location i,
117 /// this method fails and returns kFALSE, otherwise it returns kTRUE
122 AliError(Form("Object %p is already there for i=%d",o,i));