The Gaudi Framework  master (37c0b60a)
EventIterator.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 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:
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::increaseCounters
IDataStreamTool::size_type increaseCounters(bool reset=false)
Increase counters.
Definition: EventIterator.h:82
IOpaqueAddress
Definition: IOpaqueAddress.h:33
IEvtSelector
Definition: IEvtSelector.h:28
EvtSelectorContext::context
IEvtSelector::Context * context() const
Access "real" iterator.
Definition: EventIterator.h:80
IEvtSelector.h
EvtSelectorContext::EvtSelectorContext
EvtSelectorContext(const EvtSelectorContext &)=default
Copy constructor.
EvtSelectorContext::ID
virtual IDataStreamTool::size_type ID() const
Stream identifier.
Definition: EventIterator.h:99
IEvtSelector::Context
Definition: IEvtSelector.h:33
GaudiPartProp.tests.id
id
Definition: tests.py:111
EvtSelectorContext::decreaseCounters
IDataStreamTool::size_type decreaseCounters(bool reset=false)
Decrease counters.
Definition: EventIterator.h:88
EvtSelectorContext
Definition of class EventIterator.
Definition: EventIterator.h:42
EvtSelectorContext::set
void set(IEvtSelector::Context *it, IOpaqueAddress *pA)
Set the address of the iterator.
Definition: EventIterator.h:73
EvtSelectorContext::numEvent
long numEvent() const
Access counter.
Definition: EventIterator.h:101
EvtSelectorContext::numStreamEvent
long numStreamEvent() const
Access counter within stream.
Definition: EventIterator.h:103
EvtSelectorContext::m_pAddress
IOpaqueAddress * m_pAddress
Pointer to opaque address.
Definition: EventIterator.h:63
EvtSelectorContext::m_count
long m_count
Event counter.
Definition: EventIterator.h:55
IOTest.sel
sel
Definition: IOTest.py:106
EvtSelectorContext::identifier
void * identifier() const override
Definition: EventIterator.h:104
EvtSelectorContext::m_pSelector
const IEvtSelector * m_pSelector
Pointer to event selector.
Definition: EventIterator.h:59
IDataStreamTool::size_type
long size_type
Definition: IDataStreamTool.h:38
EvtSelectorContext::EvtSelectorContext
EvtSelectorContext(const IEvtSelector *selector)
Standard constructor.
Definition: EventIterator.h:96
EventCollectionSelector
Definition of class EventCollectionSelector.
Definition: EventCollectionSelector.h:52
EvtSelectorContext::set
void set(IOpaqueAddress *pA)
Set the address of the iterator.
Definition: EventIterator.h:78
EvtSelectorContext::m_strCount
long m_strCount
Event counter within stream.
Definition: EventIterator.h:57
IDataStreamTool.h
EvtSelectorContext::m_context
IEvtSelector::Context * m_context
Pointer to "real" iterator.
Definition: EventIterator.h:61
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:65
EventSelector
Definition of class EventSelector.
Definition: EventSelector.h:63
EvtSelectorContext::m_streamID
IDataStreamTool::size_type m_streamID
Stream identifier.
Definition: EventIterator.h:53