bugfix
[u/mrichter/AliRoot.git] / EVE / EveHLT / AliEveHOMERSourceMapByDet.h
CommitLineData
f65a2da1 1// $Id$
2// Main authors: Matevz Tadel & Alja Mrak-Tadel: 2006, 2007
3
4/**************************************************************************
5 * Copyright(c) 1998-2008, ALICE Experiment at CERN, all rights reserved. *
6 * See http://aliceinfo.cern.ch/Offline/AliRoot/License.html for *
7 * full copyright notice. *
8 **************************************************************************/
9
10#ifndef AliEveAliEveHOMERSourceMapByDet_H
11#define AliEveAliEveHOMERSourceMapByDet_H
12
13#include "AliEveHOMERSourceMap.h"
14
15//______________________________________________________________________________
16//
17// AliEveHOMERSourceMap is an abstract container for HLT HOMER sources.
18// The concrete implementations AliEveHOMERSourceMapByDet and
19// AliEveHOMERSourceMapByType allow retrieval of HOMER sources in proper
20// order as required for their display in EVE object browser.
21
22class AliEveHOMERSourceMapByDet : public AliEveHOMERSourceMap
23{
24public:
25 AliEveHOMERSourceMapByDet(ESourceGrouping_e grouping);
26 virtual ~AliEveHOMERSourceMapByDet() {}
27
28 virtual void FillMap(const TList* handles, Bool_t def_state);
29
30protected:
31 typedef std::map<AliEveHOMERSource::SourceId,
32 AliEveHOMERSource::SourceState,
33 AliEveHOMERSource::SourceId::CmpByDet> Map_t;
34 typedef Map_t::iterator Map_i;
35
36 Map_t fMap;
37
38 struct iterator_imp : public iterator_imp_base,
39 public Map_i
40 {
41 iterator_imp() : Map_i() {}
42 iterator_imp(Map_i mi) : Map_i(mi) {}
43 virtual ~iterator_imp() {}
44
45 virtual const AliEveHOMERSource::SourceId& id() const { return Map_i::operator*().first; }
46 virtual const AliEveHOMERSource::SourceState& state() const { return Map_i::operator*().second; }
47 virtual AliEveHOMERSource::SourceState& state() { return Map_i::operator*().second; }
48
49 virtual iterator_imp* clone() const
50 { return new iterator_imp(*this); }
51
52 virtual iterator_imp& operator++()
53 { Map_i::operator++(); return *this; }
54
55 virtual bool operator!=(const iterator_imp_base& rhs) const
56 { const Map_i &lhs = *this; return lhs != dynamic_cast<const Map_i&>(rhs); }
57
58 virtual TString description() const;
59 };
60
61 void insert(AliEveHOMERSource::SourceId& sid, AliEveHOMERSource::SourceState& sst, Bool_t def_state);
62
63 virtual iterator_imp_base* iterator_imp_new() { return new iterator_imp; }
64 virtual iterator_imp_base* iterator_imp_begin() { return new iterator_imp(fMap.begin()); }
65 virtual iterator_imp_base* iterator_imp_end() { return new iterator_imp(fMap.end()); }
66
67
68 // ClassDef(AliEveHOMERSourceMapByDet, 0);
69};
70
71#endif