BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
Event/RootCnvSvc/include/RootCnvSvc/RootEvtIterator.h
Go to the documentation of this file.
1#ifndef GLASTCNV_GLASTEVENTSELECTORITERATOR_H
2#define GLASTCNV_GLASTEVENTSELECTORITERATOR_H 1
3
4#include "GaudiKernel/IEvtSelector.h"
5#include "GaudiKernel/ISvcLocator.h"
6#include "GaudiKernel/Service.h"
7
8#include <list>
9#include <stdio.h>
10#include <string>
11
12/** @class RootEvtIterator
13 * @brief implements the IEvtSelector::Iterator interface
14 *
15 * $Header: /bes/bes/BossCvs/Event/RootCnvSvc/RootCnvSvc/RootEvtIterator.h,v 1.8 2008/01/09
16 * 00:05:48 codeman Exp $
17 */
18class RootEvtIterator : public IEvtSelector::Iterator {
19public:
20 friend class RootEvtSelector;
22 RootEvtIterator( const IEvtSelector* glastEvtSel )
23 : m_glastEvtSel( glastEvtSel ), m_recId( 0 ) {}
24 RootEvtIterator( const IEvtSelector* glastEvtSel, int recId )
25 : m_glastEvtSel( glastEvtSel ) {
26 m_recId = recId;
27 }
28 virtual ~RootEvtIterator() {}
29 virtual IOpaqueAddress* operator*() const { return m_glastEvtSel->reference( *this ); }
30 virtual IOpaqueAddress* operator->() const { return m_glastEvtSel->reference( *this ); }
31 virtual IEvtSelector::Iterator& operator++() { return m_glastEvtSel->next( *this ); }
32 virtual IEvtSelector::Iterator& operator--() { return m_glastEvtSel->previous( *this ); }
33 virtual IEvtSelector::Iterator& operator++( int ) { return m_glastEvtSel->next( *this ); }
34 virtual IEvtSelector::Iterator& operator--( int ) {
35 return m_glastEvtSel->previous( *this );
36 }
37 virtual bool operator==( const IEvtSelector::Iterator& it ) const {
38 const RootEvtIterator* glastIt = dynamic_cast<const RootEvtIterator*>( &it );
39 return ( ( m_recId == glastIt->m_recId ) );
40 }
41 virtual bool operator!=( const IEvtSelector::Iterator& it ) const {
42 const RootEvtIterator* glastIt = dynamic_cast<const RootEvtIterator*>( &it );
43 return ( ( m_recId != glastIt->m_recId ) );
44 }
45
46private:
47 /// pointer to RootEvtSelector
48 const IEvtSelector* m_glastEvtSel;
49 /// counts number of event
50 int m_recId;
51};
52
53#endif // GLASTEvtIterator_H
virtual IEvtSelector::Iterator & operator--()
virtual IEvtSelector::Iterator & operator++()
virtual bool operator==(const IEvtSelector::Iterator &it) const
RootEvtIterator(const IEvtSelector *glastEvtSel, int recId)
virtual bool operator!=(const IEvtSelector::Iterator &it) const
RootEvtIterator(const IEvtSelector *glastEvtSel)
virtual IEvtSelector::Iterator & operator++(int)
virtual IEvtSelector::Iterator & operator--(int)