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