Geant4 11.2.2
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4MoleculeIterator< MOLECULE > Class Template Reference

#include <G4MoleculeIterator.hh>

Public Member Functions

 G4MoleculeIterator (MAP &_map)
 
virtual ~G4MoleculeIterator ()=default
 
 G4MoleculeIterator (const G4MoleculeIterator &right)
 
G4MoleculeIteratoroperator= (const G4MoleculeIterator &right)
 
G4bool operator++ (int)
 
G4bool operator++ ()
 
void reset ()
 
G4bool operator() ()
 
const G4StringName ()
 
MOLECULE * value ()
 

Protected Types

using MAP = std::map<G4String, MOLECULE *>
 

Protected Attributes

MAPfMap
 
G4bool fDefined
 
MAP::iterator fIt
 

Detailed Description

template<typename MOLECULE>
class G4MoleculeIterator< MOLECULE >

Definition at line 52 of file G4MoleculeIterator.hh.

Member Typedef Documentation

◆ MAP

template<typename MOLECULE >
using G4MoleculeIterator< MOLECULE >::MAP = std::map<G4String, MOLECULE *>
protected

Definition at line 55 of file G4MoleculeIterator.hh.

Constructor & Destructor Documentation

◆ G4MoleculeIterator() [1/2]

template<typename MOLECULE >
G4MoleculeIterator< MOLECULE >::G4MoleculeIterator ( MAP & _map)
inline

Definition at line 61 of file G4MoleculeIterator.hh.

61 :
62 fMap(&_map)
63 {
64 fDefined = false;
65 }

◆ ~G4MoleculeIterator()

template<typename MOLECULE >
virtual G4MoleculeIterator< MOLECULE >::~G4MoleculeIterator ( )
virtualdefault

◆ G4MoleculeIterator() [2/2]

template<typename MOLECULE >
G4MoleculeIterator< MOLECULE >::G4MoleculeIterator ( const G4MoleculeIterator< MOLECULE > & right)
inline

Definition at line 70 of file G4MoleculeIterator.hh.

71 {
72 fMap = right.fMap;
73 fDefined = right.fDefined;
74 fIt = right.fIt;
75 }

Member Function Documentation

◆ Name()

template<typename MOLECULE >
const G4String & G4MoleculeIterator< MOLECULE >::Name ( )
inline

Definition at line 119 of file G4MoleculeIterator.hh.

120 {
121 return fIt->first;
122 }

◆ operator()()

template<typename MOLECULE >
G4bool G4MoleculeIterator< MOLECULE >::operator() ( )
inline

Definition at line 105 of file G4MoleculeIterator.hh.

106 {
107 if (!fDefined)
108 {
109 fDefined = true;
110 fIt = fMap->begin();
111 return true;
112 }
113
114 fIt++;
115
116 return static_cast<G4bool>(fIt != fMap->end());
117 }
bool G4bool
Definition G4Types.hh:86

◆ operator++() [1/2]

template<typename MOLECULE >
G4bool G4MoleculeIterator< MOLECULE >::operator++ ( )
inline

Definition at line 93 of file G4MoleculeIterator.hh.

94 {
95 if (!fDefined) return false;
96 fIt++;
97 return static_cast<G4bool>(fIt != fMap->end());
98 }

◆ operator++() [2/2]

template<typename MOLECULE >
G4bool G4MoleculeIterator< MOLECULE >::operator++ ( int )
inline

Definition at line 86 of file G4MoleculeIterator.hh.

87 {
88 if (!fDefined) return false;
89 fIt++;
90 return static_cast<G4bool>(fIt != fMap->end());
91 }

◆ operator=()

template<typename MOLECULE >
G4MoleculeIterator & G4MoleculeIterator< MOLECULE >::operator= ( const G4MoleculeIterator< MOLECULE > & right)
inline

Definition at line 77 of file G4MoleculeIterator.hh.

78 {
79 if (this == &right) return *this;
80 fMap = right.fMap;
81 fDefined = right.fDefined;
82 fIt = right.fIt;
83 return *this;
84 }

◆ reset()

◆ value()

Member Data Documentation

◆ fDefined

◆ fIt

◆ fMap


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