Geant4_10
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
source
source
processes
electromagnetic
dna
management
src
G4ITManager_iterator.cc
Go to the documentation of this file.
1
//
2
// ********************************************************************
3
// * License and Disclaimer *
4
// * *
5
// * The Geant4 software is copyright of the Copyright Holders of *
6
// * the Geant4 Collaboration. It is provided under the terms and *
7
// * conditions of the Geant4 Software License, included in the file *
8
// * LICENSE and available at http://cern.ch/geant4/license . These *
9
// * include a list of copyright holders. *
10
// * *
11
// * Neither the authors of this software system, nor their employing *
12
// * institutes,nor the agencies providing financial support for this *
13
// * work make any representation or warranty, express or implied, *
14
// * regarding this software system or assume any liability for its *
15
// * use. Please see the license in the file LICENSE and URL above *
16
// * for the full disclaimer and the limitation of liability. *
17
// * *
18
// * This code implementation is the result of the scientific and *
19
// * technical work of the GEANT4 collaboration. *
20
// * By using, copying, modifying or distributing the software (or *
21
// * any work based on the software) you agree to acknowledge its *
22
// * use in resulting scientific publications, and indicate your *
23
// * acceptance of all terms of the Geant4 Software license. *
24
// ********************************************************************
25
//
26
// $Id: G4ITManager_iterator.cc 64057 2012-10-30 15:04:49Z gcosmo $
27
//
28
// Author: Mathieu Karamitros (kara (AT) cenbg . in2p3 . fr)
29
//
30
// History:
31
// -----------
32
// 10 Oct 2011 M.Karamitros created
33
//
34
// -------------------------------------------------------------------
35
36
#include "
G4ITManager.hh
"
37
38
// Description of G4ITManager<IT>::iterator
39
40
G4VITManager::iterator::iterator
(
G4ITBox
*
box
)
41
{
42
if
(box)
43
{
44
fCurrentBox
=
box
;
45
}
46
else
47
{
48
fCurrentBox
= 0;
49
}
50
51
fNextIT
= 0;
52
}
53
//______________________________________________________________________
54
55
G4bool
G4VITManager::iterator::begin
()
56
{
57
if
(fCurrentBox)
58
{
59
fNextIT = fCurrentBox->GetFirstIT();
60
61
if
(fNextIT)
62
{
63
// G4cout << "G4VITManager::allbox_iterator, fNextIT :" << fNextIT -> GetName()<< G4endl;
64
return
true
;
65
}
66
}
67
68
return
false
;
69
}
70
//______________________________________________________________________
71
72
G4VITManager::iterator
&
G4VITManager::iterator::operator++
(
G4int
)
73
{
74
if
(fCurrentBox)
75
{
76
if
(fNextIT)
77
{
78
fNextIT = fNextIT->GetNext();
79
}
80
}
81
return
*
this
;
82
}
83
84
//______________________________________________________________________
85
86
G4bool
G4VITManager::iterator::end
()
87
{
88
if
(fNextIT)
return
false
;
89
return
true ;
90
}
91
92
//______________________________________________________________________
93
94
G4VITManager::iterator
&
G4VITManager::iterator::operator=
(
const
iterator
& i)
95
{
96
if
(
this
!= &i)
97
{
98
fNextIT = i.
fNextIT
;
99
fCurrentBox = i.
fCurrentBox
;
100
}
101
return
*
this
;
102
}
103
104
//______________________________________________________________________
105
106
G4IT
*
G4VITManager::iterator::operator*
()
107
{
108
return
fNextIT;
109
}
110
111
//______________________________________________________________________
112
113
G4ITBox
*
G4VITManager::iterator::GetBox
()
114
{
115
return
fCurrentBox;
116
}
117
118
//______________________________________________________________________
119
120
void
G4VITManager::iterator::PrintNext
()
const
121
{
122
if
(fNextIT)
123
{
124
if
(fNextIT->GetTrack())
125
{
126
G4cout
127
<< fNextIT->GetTrack()->GetTrackID()
128
<<
"\t"
129
<< fNextIT->GetName()
130
<<
G4endl
;
131
}
132
}
133
else
134
{
135
G4cout
<<
"fNextIT = 0"
<<
G4endl
;
136
}
137
}
138
G4VITManager::iterator::fCurrentBox
G4ITBox * fCurrentBox
Definition:
G4ITManager.hh:116
G4VITManager::iterator::iterator
iterator(G4ITBox *)
Definition:
G4ITManager_iterator.cc:40
G4IT
Definition:
G4IT.hh:82
G4VITManager::iterator::operator++
iterator & operator++(G4int)
Definition:
G4ITManager_iterator.cc:72
G4VITManager::iterator::operator*
G4IT * operator*()
Definition:
G4ITManager_iterator.cc:106
G4int
int G4int
Definition:
G4Types.hh:78
G4VITManager::iterator::PrintNext
void PrintNext() const
Definition:
G4ITManager_iterator.cc:120
G4cout
G4GLOB_DLL std::ostream G4cout
G4bool
bool G4bool
Definition:
G4Types.hh:79
G4VITManager::iterator::GetBox
G4ITBox * GetBox()
Definition:
G4ITManager_iterator.cc:113
G4VITManager::iterator::fNextIT
G4IT * fNextIT
Definition:
G4ITManager.hh:115
G4VITManager::iterator::operator=
iterator & operator=(const iterator &i)
Definition:
G4ITManager_iterator.cc:94
G4ITBox
Definition:
G4ITBox.hh:50
G4VITManager::iterator::end
virtual G4bool end()
Definition:
G4ITManager_iterator.cc:86
G4endl
#define G4endl
Definition:
G4ios.hh:61
box
UBox box
Definition:
UPolycone.cc:32
G4VITManager::iterator
Definition:
G4ITManager.hh:97
G4ITManager.hh
G4VITManager::iterator::begin
virtual G4bool begin()
Definition:
G4ITManager_iterator.cc:55
Generated on Sat Dec 14 2013 14:34:28 for Geant4_10 by
1.8.5