| The Gaudi Framework v29r1 (5cd95fa2)

- 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/IDataStreamTool.h"
16 #include "GaudiKernel/IEvtSelector.h"
17
32 class EvtSelectorContext : public IEvtSelector::Context
33 {
34 // Friend declaration
35 friend class EventSelector;
36 friend class EventCollectionSelector;
37
38 private:
40 EvtSelectorContext( const EvtSelectorContext& ) = default;
41
42 protected:
44 IDataStreamTool::size_type m_streamID = -1;
46 long m_count = -1;
48 long m_strCount = -1;
50 const IEvtSelector* m_pSelector = nullptr;
52 IEvtSelector::Context* m_context = nullptr;
54 IOpaqueAddress* m_pAddress = nullptr;
56 void set( const IEvtSelector* sel, IDataStreamTool::size_type id, IEvtSelector::Context* it, IOpaqueAddress* pA )
57 {
58 m_pSelector = sel;
59 m_context = it;
60 m_streamID = id;
61 m_pAddress = pA;
62 m_strCount = -1;
63 }
65 void set( IEvtSelector::Context* it, IOpaqueAddress* pA )
66 {
67 m_context = it;
68 m_pAddress = pA;
69 }
71 void set( IOpaqueAddress* pA ) { m_pAddress = pA; }
73 IEvtSelector::Context* context() const { return m_context; }
75 IDataStreamTool::size_type increaseCounters( bool reset = false )
76 {
77 m_count++;
78 m_strCount = ( reset ) ? 0 : m_strCount + 1;
79 return m_count;
80 }
82 IDataStreamTool::size_type decreaseCounters( bool reset = false )
83 {
84 m_count++;
85 m_strCount = ( reset ) ? 0 : m_strCount - 1;
86 return m_count;
87 }
88
89 public:
91 EvtSelectorContext( const IEvtSelector* selector ) : m_pSelector( selector ) {}
92
94 virtual IDataStreamTool::size_type ID() const { return m_streamID; }
96 long numEvent() const { return m_count; }
98 long numStreamEvent() const { return m_strCount; }
99 void* identifier() const override { return (void*)m_pSelector; }
100 };
101 #endif // GAUDISVC_EVENTSELECTOR_EVENTITERATOR_H
EvtSelectorContext::context
IEvtSelector::Context * context() const
Access "real" iterator.
Definition: EventIterator.h:73
EvtSelectorContext::EvtSelectorContext
EvtSelectorContext(const IEvtSelector *selector)
Standard constructor.
Definition: EventIterator.h:91
EvtSelectorContext::m_count
long m_count
Event counter.
Definition: EventIterator.h:46
IEvtSelector
The Event Selector Interface.
Definition: IEvtSelector.h:18
IOTest.sel
sel
Definition: IOTest.py:95
IEvtSelector::Context
Definition: IEvtSelector.h:24
EvtSelectorContext::m_strCount
long m_strCount
Event counter within stream.
Definition: EventIterator.h:48
EvtSelectorContext::m_context
IEvtSelector::Context * m_context
Pointer to "real" iterator.
Definition: EventIterator.h:52
IDataStreamTool.h
EvtSelectorContext::m_pAddress
IOpaqueAddress * m_pAddress
Pointer to opaque address.
Definition: EventIterator.h:54
EvtSelectorContext
Definition of class EventIterator.
Definition: EventIterator.h:32
EvtSelectorContext::identifier
void * identifier() const override
Definition: EventIterator.h:99
IDataStreamTool::size_type
long size_type
Definition: IDataStreamTool.h:29
EvtSelectorContext::numStreamEvent
long numStreamEvent() const
Access counter within stream.
Definition: EventIterator.h:98
EvtSelectorContext::decreaseCounters
IDataStreamTool::size_type decreaseCounters(bool reset=false)
Decrease counters.
Definition: EventIterator.h:82
EventCollectionSelector
Definition of class EventCollectionSelector.
Definition: EventCollectionSelector.h:42
EvtSelectorContext::m_pSelector
const IEvtSelector * m_pSelector
Pointer to event selector.
Definition: EventIterator.h:50
EvtSelectorContext::ID
virtual IDataStreamTool::size_type ID() const
Stream identifier.
Definition: EventIterator.h:94
IEvtSelector.h
EvtSelectorContext::increaseCounters
IDataStreamTool::size_type increaseCounters(bool reset=false)
Increase counters.
Definition: EventIterator.h:75
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:44
EvtSelectorContext::numEvent
long numEvent() const
Access counter.
Definition: EventIterator.h:96
EvtSelectorContext::EvtSelectorContext
EvtSelectorContext(const EvtSelectorContext &)=default
Copy constructor.