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