The Gaudi Framework  v33r1 (b1225454)
EventIterator.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3 * *
4 * This software is distributed under the terms of the Apache version 2 licence, *
5 * copied verbatim in the file "LICENSE". *
6 * *
7 * In applying this licence, CERN does not waive the privileges and immunities *
8 * granted to it by virtue of its status as an Intergovernmental Organization *
9 * or submit itself to any jurisdiction. *
10 \***********************************************************************************/
11 // ============================================================
12 //
13 // EventIterator.h
14 // ------------------------------------------------------------
15 //
16 // Package : EventSelector
17 //
18 // Author : Markus Frank
19 //
20 // ===========================================================
21 #ifndef GAUDISVC_EVENTSELECTOR_EVENTITERATOR_H
22 #define GAUDISVC_EVENTSELECTOR_EVENTITERATOR_H 1
23 
24 // Include files
27 
43  // Friend declaration
44  friend class EventSelector;
46 
47 private:
49  EvtSelectorContext( const EvtSelectorContext& ) = default;
50 
51 protected:
55  long m_count = -1;
57  long m_strCount = -1;
59  const IEvtSelector* m_pSelector = nullptr;
66  m_pSelector = sel;
67  m_context = it;
68  m_streamID = id;
69  m_pAddress = pA;
70  m_strCount = -1;
71  }
74  m_context = it;
75  m_pAddress = pA;
76  }
78  void set( IOpaqueAddress* pA ) { m_pAddress = pA; }
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 
94 public:
96  EvtSelectorContext( const IEvtSelector* selector ) : m_pSelector( selector ) {}
97 
99  virtual IDataStreamTool::size_type ID() const { return m_streamID; }
101  long numEvent() const { return m_count; }
103  long numStreamEvent() const { return m_strCount; }
104  void* identifier() const override { return (void*)m_pSelector; }
105 };
106 #endif // GAUDISVC_EVENTSELECTOR_EVENTITERATOR_H
EvtSelectorContext(const IEvtSelector *selector)
Standard constructor.
Definition: EventIterator.h:96
long m_count
Event counter.
Definition: EventIterator.h:55
IEvtSelector::Context * context() const
Access "real" iterator.
Definition: EventIterator.h:80
The Event Selector Interface.
Definition: IEvtSelector.h:28
void set(IOpaqueAddress *pA)
Set the address of the iterator.
Definition: EventIterator.h:78
long m_strCount
Event counter within stream.
Definition: EventIterator.h:57
void * identifier() const override
IEvtSelector::Context * m_context
Pointer to "real" iterator.
Definition: EventIterator.h:61
void set(IEvtSelector::Context *it, IOpaqueAddress *pA)
Set the address of the iterator.
Definition: EventIterator.h:73
IOpaqueAddress * m_pAddress
Pointer to opaque address.
Definition: EventIterator.h:63
Definition of class EventIterator.
Definition: EventIterator.h:42
long numEvent() const
Access counter.
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:65
Definition of class EventCollectionSelector.
const IEvtSelector * m_pSelector
Pointer to event selector.
Definition: EventIterator.h:59
virtual IDataStreamTool::size_type ID() const
Stream identifier.
Definition: EventIterator.h:99
long numStreamEvent() const
Access counter within stream.
IDataStreamTool::size_type increaseCounters(bool reset=false)
Increase counters.
Definition: EventIterator.h:82
Definition of class EventSelector.
Definition: EventSelector.h:63
Opaque address interface definition.
IDataStreamTool::size_type m_streamID
Stream identifier.
Definition: EventIterator.h:53
EvtSelectorContext(const EvtSelectorContext &)=default
Copy constructor.