All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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:
39  : IEvtSelector::Context(copy),
40  m_count(copy.m_count),
41  m_strCount(copy.m_strCount),
42  m_pSelector(copy.m_pSelector),
43  m_context(copy.m_context),
45  {
46  }
47 protected:
51  long m_count;
53  long m_strCount;
62  m_pSelector = sel;
63  m_context = it;
64  m_streamID = id;
65  m_pAddress = pA;
66  m_strCount = -1;
67  }
70  m_context = it;
71  m_pAddress = pA;
72  }
74  void set(IOpaqueAddress* pA) {
75  m_pAddress = pA;
76  }
79  return m_context;
80  }
83  m_count++;
84  m_strCount = (reset) ? 0 : m_strCount+1;
85  return m_count;
86  }
89  m_count++;
90  m_strCount = (reset) ? 0 : m_strCount-1;
91  return m_count;
92  }
93 public:
95  EvtSelectorContext( const IEvtSelector* selector )
96  : m_streamID(-1),
97  m_count(-1),
98  m_strCount(-1),
99  m_pSelector(selector),
100  m_context(0),
101  m_pAddress(0)
102  {
103  }
105  virtual ~EvtSelectorContext() {
106  }
109  m_streamID = copy.m_streamID;
110  m_count = copy.m_count;
111  m_strCount = copy.m_strCount;
112  m_pSelector = copy.m_pSelector;
113  m_context = copy.m_context;
114  m_pAddress = copy.m_pAddress;
115  return *this;
116  }
118  virtual IDataStreamTool::size_type ID() const {
119  return m_streamID;
120  }
122  long numEvent() const {
123  return m_count;
124  }
126  long numStreamEvent() const {
127  return m_strCount;
128  }
129  void* identifier() const {
130  return (void*)m_pSelector;
131  }
132 };
133 #endif // GAUDISVC_EVENTSELECTOR_EVENTITERATOR_H
virtual ~EvtSelectorContext()
Standard Destructor.
IEvtSelector::Context * context() const
Access "real" iterator.
Definition: EventIterator.h:78
EvtSelectorContext(const IEvtSelector *selector)
Standard constructor.
Definition: EventIterator.h:95
virtual EvtSelectorContext & operator=(const EvtSelectorContext &copy)
Copy constructor.
long m_count
Event counter.
Definition: EventIterator.h:51
The Event Selector Interface.
Definition: IEvtSelector.h:19
void * identifier() const
void set(IOpaqueAddress *pA)
Set the address of the iterator.
Definition: EventIterator.h:74
long m_strCount
Event counter within stream.
Definition: EventIterator.h:53
IEvtSelector::Context * m_context
Pointer to "real" iterator.
Definition: EventIterator.h:57
EvtSelectorContext(const EvtSelectorContext &copy)
Copy constructor.
Definition: EventIterator.h:38
void set(IEvtSelector::Context *it, IOpaqueAddress *pA)
Set the address of the iterator.
Definition: EventIterator.h:69
IOpaqueAddress * m_pAddress
Pointer to opaque address.
Definition: EventIterator.h:59
Definition of class EventIterator.
Definition: EventIterator.h:32
long numStreamEvent() const
Access counter within stream.
IDataStreamTool::size_type decreaseCounters(bool reset=false)
Decrease counters.
Definition: EventIterator.h:88
void set(const IEvtSelector *sel, IDataStreamTool::size_type id, IEvtSelector::Context *it, IOpaqueAddress *pA)
Set the address of the iterator.
Definition: EventIterator.h:61
Definition of class EventCollectionSelector.
const IEvtSelector * m_pSelector
Pointer to event selector.
Definition: EventIterator.h:55
virtual IDataStreamTool::size_type ID() const
Stream identifier.
IDataStreamTool::size_type increaseCounters(bool reset=false)
Increase counters.
Definition: EventIterator.h:82
Definition of class EventSelector.
Definition: EventSelector.h:53
Opaque address interface definition.
IDataStreamTool::size_type m_streamID
Stream identifier.
Definition: EventIterator.h:49
long numEvent() const
Access counter.