Analysis Software
Documentation for
sPHENIX
simulation software
Home page
Related Pages
Modules
Namespaces
Classes
Files
Examples
External Links
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
PHPointerListIterator.h
Go to the documentation of this file.
Or view
the newest version in sPHENIX GitHub for file PHPointerListIterator.h
1
#ifndef PHOOL_PHPOINTERLISTITERATOR_H
2
#define PHOOL_PHPOINTERLISTITERATOR_H
3
4
// Declaration of class PHPointerListIterator
5
// Purpose: iterator for access to a PHPointerList
6
// Author: Matthias Messer
7
8
#include "
PHPointerList.h
"
9
10
template
<
class
T>
11
class
PHPointerListIterator
12
{
13
public
:
14
explicit
PHPointerListIterator
(
const
PHPointerList<T>
&);
15
virtual
~PHPointerListIterator
() {}
16
T
*
operator()
();
17
void
operator--
();
18
void
reset
();
19
size_t
pos
()
const
{
return
m_Index
; }
20
21
private
:
22
PHPointerListIterator
() =
delete
;
23
const
PHPointerList<T>
&
m_List
;
24
size_t
m_Index
;
25
};
26
27
template
<
class
T>
28
PHPointerListIterator<T>::PHPointerListIterator
(
const
PHPointerList<T>
& lis)
29
: m_List(lis)
30
{
31
reset
();
32
}
33
34
template
<
class
T>
35
T
*
PHPointerListIterator<T>::operator()
()
36
{
37
m_Index++;
38
if
(m_Index < m_List.length())
39
{
40
return
m_List[m_Index];
41
}
42
else
43
{
44
return
0;
45
}
46
}
47
48
template
<
class
T>
49
void
PHPointerListIterator<T>::operator--
()
50
{
51
--m_Index;
52
}
53
54
template
<
class
T>
55
void
PHPointerListIterator<T>::reset
()
56
{
57
m_Index = ~(size_t) 0;
58
}
59
60
#endif // PHOOL_PHPOINTERLISTITERATOR_H
coresoftware
blob
master
offline
framework
phool
PHPointerListIterator.h
Built by
Jin Huang
. updated:
Sat Feb 17 2024 22:18:05
using
1.8.2 with
sPHENIX GitHub integration