Geant4-11
Public Types | Public Member Functions | Private Attributes
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)
 
K * key () const
 
G4bool operator() ()
 
G4bool operator++ ()
 
void reset (G4bool ifSkipIon=true)
 
value () const
 

Private Attributes

G4bool defined = false
 
Map::iterator it
 
Mapmydict = nullptr
 
G4bool skipIons = true
 

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 }

References G4ParticleTableIterator< K, V >::defined, G4ParticleTableIterator< K, V >::it, G4ParticleTableIterator< K, V >::mydict, and G4ParticleTableIterator< K, V >::skipIons.

◆ 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 }

References G4ParticleTableIterator< K, V >::defined, G4ParticleTableIterator< K, V >::it, and G4ParticleTableIterator< K, V >::mydict.

◆ reset()

template<class K , class V >
void G4ParticleTableIterator< K, V >::reset ( G4bool  ifSkipIon = true)
inline

◆ value()

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

Field Documentation

◆ defined

template<class K , class V >
G4bool G4ParticleTableIterator< K, V >::defined = false
private

◆ it

template<class K , class V >
Map::iterator G4ParticleTableIterator< K, V >::it
private

◆ mydict

template<class K , class V >
Map* G4ParticleTableIterator< K, V >::mydict = nullptr
private

◆ skipIons

template<class K , class V >
G4bool G4ParticleTableIterator< K, V >::skipIons = true
private

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