Geant4 11.2.2
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 39 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 42 of file G4ParticleTableIterator.hh.

Constructor & Destructor Documentation

◆ G4ParticleTableIterator()

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

Definition at line 44 of file G4ParticleTableIterator.hh.

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

Member Function Documentation

◆ key()

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

Definition at line 79 of file G4ParticleTableIterator.hh.

79{ return &((*it).first); }

◆ operator()()

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

Definition at line 53 of file G4ParticleTableIterator.hh.

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

◆ operator++()

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

Definition at line 46 of file G4ParticleTableIterator.hh.

47 {
48 if (!defined) return false;
49 ++it;
50 return static_cast<bool>(it != mydict->end());
51 }

◆ reset()

◆ value()


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