]> git.uio.no Git - u/mrichter/AliRoot.git/blob - MUON/AliMUONCheckItemIterator.cxx
Initialisation.
[u/mrichter/AliRoot.git] / MUON / AliMUONCheckItemIterator.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 #include "AliMUONCheckItemIterator.h"
19 #include "TExMap.h"
20 #include "AliMpExMap.h"
21 #include "AliMUONCheckItem.h"
22
23 //-----------------------------------------------------------------------------
24 /// \class AliMUONCheckItemIterator
25 ///
26 /// Iterator on AliMUONCheckItem objects
27 /// 
28 ///
29 /// \author Laurent Aphecetche
30 //-----------------------------------------------------------------------------
31
32 /// \cond CLASSIMP
33 ClassImp(AliMUONCheckItemIterator)
34 /// \endcond
35
36 //_____________________________________________________________________________
37 AliMUONCheckItemIterator::AliMUONCheckItemIterator() : TObject(), fIter(0x0)
38 {
39   /// default ctor
40 }
41
42 //_____________________________________________________________________________
43 AliMUONCheckItemIterator::AliMUONCheckItemIterator(const AliMUONCheckItem& item)
44 : TObject(),
45 fIter(0x0)
46 {
47   /// ctor
48   AliMpExMap* m = item.fMissing;
49   fIter = new TExMapIter(m->GetIterator());
50 }
51
52 //_____________________________________________________________________________
53 AliMUONCheckItemIterator::~AliMUONCheckItemIterator()
54 {
55   /// dtor
56   delete fIter;
57 }
58
59 //_____________________________________________________________________________
60 void
61 AliMUONCheckItemIterator::First()
62 {
63   /// Rewind the iterator
64   if ( fIter) fIter->Reset();
65 }
66
67 //_____________________________________________________________________________
68 TObject*
69 AliMUONCheckItemIterator::Next()
70 {
71   /// Advance one object. Return 0 if ended.
72   if (!fIter) return 0x0;
73   Long_t key, value;
74   Bool_t ok = fIter->Next(key,value);
75   if (ok)
76   {
77     return reinterpret_cast<TObject*>(value);
78   }
79   else
80   {
81     return 0x0;
82   }
83 }