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