Geant4 10.7.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4ParticleTableIterator< K, V > Class Template Reference

#include <G4ParticleTableIterator.hh>

Public Types

using Map = std::map< K, V, std::less< K > >
 

Public Member Functions

 G4ParticleTableIterator (Map &adict)
 
G4bool operator++ ()
 
G4bool operator() ()
 
void reset (G4bool ifSkipIon=true)
 
K * key () const
 
value () const
 

Detailed Description

template<class K, class V>
class G4ParticleTableIterator< K, V >

Definition at line 37 of file G4ParticleTableIterator.hh.

Member Typedef Documentation

◆ Map

template<class K , class V >
using G4ParticleTableIterator< K, V >::Map = std::map<K, V, std::less<K> >

Definition at line 41 of file G4ParticleTableIterator.hh.

Constructor & Destructor Documentation

◆ G4ParticleTableIterator()

template<class K , class V >
G4ParticleTableIterator< K, V >::G4ParticleTableIterator ( Map adict)
inline

Definition at line 43 of file G4ParticleTableIterator.hh.

44 : it(adict.begin()), mydict(&adict)
45 {
46 }

Member Function Documentation

◆ key()

template<class K , class V >
K * G4ParticleTableIterator< K, V >::key ( ) const
inline

Definition at line 85 of file G4ParticleTableIterator.hh.

86 {
87 return &((*it).first);
88 }

◆ operator()()

template<class K , class V >
G4bool G4ParticleTableIterator< K, V >::operator() ( )
inline

Definition at line 55 of file G4ParticleTableIterator.hh.

56 {
57 if(!defined)
58 {
59 defined=true;
60 it=mydict->begin();
61 }
62 else
63 {
64 ++it;
65 }
66 if(it==mydict->end()) return false;
67 if(skipIons)
68 {
69 while((static_cast<G4ParticleDefinition*>
70 ((*it).second))->IsGeneralIon())
71 { // Loop checking, 09.08.2015, K.Kurashige
72 ++it;
73 if(it==mydict->end()) return false;
74 }
75 }
76 return true;
77 }

◆ operator++()

template<class K , class V >
G4bool G4ParticleTableIterator< K, V >::operator++ ( )
inline

Definition at line 48 of file G4ParticleTableIterator.hh.

49 {
50 if(!defined) return false;
51 ++it;
52 return it!=mydict->end() ? true : false;
53 }

◆ reset()

◆ value()


The documentation for this class was generated from the following file: