| The Gaudi Framework v28r2-patches (bc4ad17a)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

EventIterator.h
Go to the documentation of this file.
1 // ============================================================
2 //
3 // EventIterator.h
4 // ------------------------------------------------------------
5 //
6 // Package : EventSelector
7 //
8 // Author : Markus Frank
9 //
10 // ===========================================================
11 #ifndef GAUDISVC_EVENTSELECTOR_EVENTITERATOR_H
12 #define GAUDISVC_EVENTSELECTOR_EVENTITERATOR_H 1
13
14 // Include files
15 #include "GaudiKernel/IEvtSelector.h"
16 #include "GaudiKernel/IDataStreamTool.h"
17
32 class EvtSelectorContext : public IEvtSelector::Context {
33 // Friend declaration
34 friend class EventSelector;
35 friend class EventCollectionSelector;
36 private:
38 EvtSelectorContext ( const EvtSelectorContext& ) = default;
39 protected:
41 IDataStreamTool::size_type m_streamID = -1;
43 long m_count = -1;
45 long m_strCount = -1;
47 const IEvtSelector* m_pSelector = nullptr;
49 IEvtSelector::Context* m_context = nullptr;
51 IOpaqueAddress* m_pAddress = nullptr;
53 void set(const IEvtSelector* sel, IDataStreamTool::size_type id, IEvtSelector::Context* it, IOpaqueAddress* pA) {
54 m_pSelector = sel;
55 m_context = it;
56 m_streamID = id;
57 m_pAddress = pA;
58 m_strCount = -1;
59 }
61 void set(IEvtSelector::Context* it, IOpaqueAddress* pA) {
62 m_context = it;
63 m_pAddress = pA;
64 }
66 void set(IOpaqueAddress* pA) {
67 m_pAddress = pA;
68 }
70 IEvtSelector::Context* context() const {
71 return m_context;
72 }
74 IDataStreamTool::size_type increaseCounters(bool reset=false) {
75 m_count++;
76 m_strCount = (reset) ? 0 : m_strCount+1;
77 return m_count;
78 }
80 IDataStreamTool::size_type decreaseCounters(bool reset=false) {
81 m_count++;
82 m_strCount = (reset) ? 0 : m_strCount-1;
83 return m_count;
84 }
85 public:
87 EvtSelectorContext( const IEvtSelector* selector )
88 : m_pSelector(selector) { }
90 ~EvtSelectorContext() override = default;
91
93 virtual EvtSelectorContext& operator=(const EvtSelectorContext&) = default;
95 virtual IDataStreamTool::size_type ID() const {
96 return m_streamID;
97 }
99 long numEvent() const {
100 return m_count;
101 }
103 long numStreamEvent() const {
104 return m_strCount;
105 }
106 void* identifier() const override {
107 return (void*)m_pSelector;
108 }
109 };
110 #endif // GAUDISVC_EVENTSELECTOR_EVENTITERATOR_H
EvtSelectorContext::context
IEvtSelector::Context * context() const
Access "real" iterator.
Definition: EventIterator.h:70
EvtSelectorContext::EvtSelectorContext
EvtSelectorContext(const IEvtSelector *selector)
Standard constructor.
Definition: EventIterator.h:87
EvtSelectorContext::~EvtSelectorContext
~EvtSelectorContext() override=default
Standard Destructor.
EvtSelectorContext::m_count
long m_count
Event counter.
Definition: EventIterator.h:43
IEvtSelector
The Event Selector Interface.
Definition: IEvtSelector.h:18
IOTest.sel
sel
Definition: IOTest.py:84
IEvtSelector::Context
Definition: IEvtSelector.h:23
EvtSelectorContext::m_strCount
long m_strCount
Event counter within stream.
Definition: EventIterator.h:45
EvtSelectorContext::m_context
IEvtSelector::Context * m_context
Pointer to "real" iterator.
Definition: EventIterator.h:49
IDataStreamTool.h
EvtSelectorContext::m_pAddress
IOpaqueAddress * m_pAddress
Pointer to opaque address.
Definition: EventIterator.h:51
EvtSelectorContext
Definition of class EventIterator.
Definition: EventIterator.h:32
EvtSelectorContext::identifier
void * identifier() const override
Definition: EventIterator.h:106
IDataStreamTool::size_type
long size_type
Definition: IDataStreamTool.h:28
EvtSelectorContext::numStreamEvent
long numStreamEvent() const
Access counter within stream.
Definition: EventIterator.h:103
EvtSelectorContext::decreaseCounters
IDataStreamTool::size_type decreaseCounters(bool reset=false)
Decrease counters.
Definition: EventIterator.h:80
EvtSelectorContext::operator=
virtual EvtSelectorContext & operator=(const EvtSelectorContext &)=default
Copy constructor.
EventCollectionSelector
Definition of class EventCollectionSelector.
Definition: EventCollectionSelector.h:42
EvtSelectorContext::m_pSelector
const IEvtSelector * m_pSelector
Pointer to event selector.
Definition: EventIterator.h:47
EvtSelectorContext::ID
virtual IDataStreamTool::size_type ID() const
Stream identifier.
Definition: EventIterator.h:95
IEvtSelector.h
EvtSelectorContext::increaseCounters
IDataStreamTool::size_type increaseCounters(bool reset=false)
Increase counters.
Definition: EventIterator.h:74
EventSelector
Definition of class EventSelector.
Definition: EventSelector.h:53
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
EvtSelectorContext::m_streamID
IDataStreamTool::size_type m_streamID
Stream identifier.
Definition: EventIterator.h:41
EvtSelectorContext::numEvent
long numEvent() const
Access counter.
Definition: EventIterator.h:99
EvtSelectorContext::EvtSelectorContext
EvtSelectorContext(const EvtSelectorContext &)=default
Copy constructor.