All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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  // Friend declaration
34  friend class EventSelector;
36 private:
38  EvtSelectorContext ( const EvtSelectorContext& ) = default;
39 protected:
43  long m_count = -1;
45  long m_strCount = -1;
47  const IEvtSelector* m_pSelector = nullptr;
54  m_pSelector = sel;
55  m_context = it;
56  m_streamID = id;
57  m_pAddress = pA;
58  m_strCount = -1;
59  }
62  m_context = it;
63  m_pAddress = pA;
64  }
66  void set(IOpaqueAddress* pA) {
67  m_pAddress = pA;
68  }
71  return m_context;
72  }
75  m_count++;
76  m_strCount = (reset) ? 0 : m_strCount+1;
77  return m_count;
78  }
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
IEvtSelector::Context * context() const
Access "real" iterator.
Definition: EventIterator.h:70
EvtSelectorContext(const IEvtSelector *selector)
Standard constructor.
Definition: EventIterator.h:87
~EvtSelectorContext() override=default
Standard Destructor.
long m_count
Event counter.
Definition: EventIterator.h:43
The Event Selector Interface.
Definition: IEvtSelector.h:18
sel
Definition: IOTest.py:84
long m_strCount
Event counter within stream.
Definition: EventIterator.h:45
IEvtSelector::Context * m_context
Pointer to "real" iterator.
Definition: EventIterator.h:49
IOpaqueAddress * m_pAddress
Pointer to opaque address.
Definition: EventIterator.h:51
Definition of class EventIterator.
Definition: EventIterator.h:32
void * identifier() const override
long numStreamEvent() const
Access counter within stream.
IDataStreamTool::size_type decreaseCounters(bool reset=false)
Decrease counters.
Definition: EventIterator.h:80
virtual EvtSelectorContext & operator=(const EvtSelectorContext &)=default
Copy constructor.
Definition of class EventCollectionSelector.
const IEvtSelector * m_pSelector
Pointer to event selector.
Definition: EventIterator.h:47
virtual IDataStreamTool::size_type ID() const
Stream identifier.
Definition: EventIterator.h:95
IDataStreamTool::size_type increaseCounters(bool reset=false)
Increase counters.
Definition: EventIterator.h:74
Definition of class EventSelector.
Definition: EventSelector.h:53
Opaque address interface definition.
IDataStreamTool::size_type m_streamID
Stream identifier.
Definition: EventIterator.h:41
long numEvent() const
Access counter.
Definition: EventIterator.h:99
EvtSelectorContext(const EvtSelectorContext &)=default
Copy constructor.