| The Gaudi Framework v32r1 (f65d50dc)

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 // Friend declaration
34 friend class EventSelector;
35 friend class EventCollectionSelector;
36
37 private:
39 EvtSelectorContext( const EvtSelectorContext& ) = default;
40
41 protected:
43 IDataStreamTool::size_type m_streamID = -1;
45 long m_count = -1;
47 long m_strCount = -1;
49 const IEvtSelector* m_pSelector = nullptr;
51 IEvtSelector::Context* m_context = nullptr;
53 IOpaqueAddress* m_pAddress = nullptr;
55 void set( const IEvtSelector* sel, IDataStreamTool::size_type id, IEvtSelector::Context* it, IOpaqueAddress* pA ) {
56 m_pSelector = sel;
57 m_context = it;
58 m_streamID = id;
59 m_pAddress = pA;
60 m_strCount = -1;
61 }
63 void set( IEvtSelector::Context* it, IOpaqueAddress* pA ) {
64 m_context = it;
65 m_pAddress = pA;
66 }
68 void set( IOpaqueAddress* pA ) { m_pAddress = pA; }
70 IEvtSelector::Context* context() const { return m_context; }
72 IDataStreamTool::size_type increaseCounters( bool reset = false ) {
73 m_count++;
74 m_strCount = ( reset ) ? 0 : m_strCount + 1;
75 return m_count;
76 }
78 IDataStreamTool::size_type decreaseCounters( bool reset = false ) {
79 m_count++;
80 m_strCount = ( reset ) ? 0 : m_strCount - 1;
81 return m_count;
82 }
83
84 public:
86 EvtSelectorContext( const IEvtSelector* selector ) : m_pSelector( selector ) {}
87
89 virtual IDataStreamTool::size_type ID() const { return m_streamID; }
91 long numEvent() const { return m_count; }
93 long numStreamEvent() const { return m_strCount; }
94 void* identifier() const override { return (void*)m_pSelector; }
95 };
96 #endif // GAUDISVC_EVENTSELECTOR_EVENTITERATOR_H
EvtSelectorContext::EvtSelectorContext
EvtSelectorContext(const IEvtSelector *selector)
Standard constructor.
Definition: EventIterator.h:86
EvtSelectorContext::m_count
long m_count
Event counter.
Definition: EventIterator.h:45
EvtSelectorContext::context
IEvtSelector::Context * context() const
Access "real" iterator.
Definition: EventIterator.h:70
IEvtSelector
The Event Selector Interface.
Definition: IEvtSelector.h:18
IOTest.sel
sel
Definition: IOTest.py:93
EvtSelectorContext::set
void set(IOpaqueAddress *pA)
Set the address of the iterator.
Definition: EventIterator.h:68
IEvtSelector::Context
Definition: IEvtSelector.h:23
EvtSelectorContext::m_strCount
long m_strCount
Event counter within stream.
Definition: EventIterator.h:47
EvtSelectorContext::identifier
void * identifier() const override
Definition: EventIterator.h:94
EvtSelectorContext::m_context
IEvtSelector::Context * m_context
Pointer to "real" iterator.
Definition: EventIterator.h:51
IDataStreamTool.h
EvtSelectorContext::set
void set(IEvtSelector::Context *it, IOpaqueAddress *pA)
Set the address of the iterator.
Definition: EventIterator.h:63
EvtSelectorContext::m_pAddress
IOpaqueAddress * m_pAddress
Pointer to opaque address.
Definition: EventIterator.h:53
EvtSelectorContext
Definition of class EventIterator.
Definition: EventIterator.h:32
EvtSelectorContext::numEvent
long numEvent() const
Access counter.
Definition: EventIterator.h:91
IDataStreamTool::size_type
long size_type
Definition: IDataStreamTool.h:28
EvtSelectorContext::decreaseCounters
IDataStreamTool::size_type decreaseCounters(bool reset=false)
Decrease counters.
Definition: EventIterator.h:78
EvtSelectorContext::set
void set(const IEvtSelector *sel, IDataStreamTool::size_type id, IEvtSelector::Context *it, IOpaqueAddress *pA)
Set the address of the iterator.
Definition: EventIterator.h:55
EventCollectionSelector
Definition of class EventCollectionSelector.
Definition: EventCollectionSelector.h:42
EvtSelectorContext::m_pSelector
const IEvtSelector * m_pSelector
Pointer to event selector.
Definition: EventIterator.h:49
EvtSelectorContext::ID
virtual IDataStreamTool::size_type ID() const
Stream identifier.
Definition: EventIterator.h:89
IEvtSelector.h
EvtSelectorContext::numStreamEvent
long numStreamEvent() const
Access counter within stream.
Definition: EventIterator.h:93
EvtSelectorContext::increaseCounters
IDataStreamTool::size_type increaseCounters(bool reset=false)
Increase counters.
Definition: EventIterator.h:72
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:43
EvtSelectorContext::EvtSelectorContext
EvtSelectorContext(const EvtSelectorContext &)=default
Copy constructor.