Geant4 11.1.1
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 ()
 
 G4MoleculeIterator (const G4MoleculeIterator &right)
 
G4MoleculeIteratoroperator= (const G4MoleculeIterator &right)
 
G4bool operator++ (int)
 
G4bool operator++ ()
 
void reset ()
 
G4bool operator() ()
 
const G4StringName ()
 
MOLECULE * value ()
 

Protected Types

typedef std::map< G4String, MOLECULE * > MAP
 

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 >
typedef std::map<G4String, MOLECULE*> G4MoleculeIterator< MOLECULE >::MAP
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 ( )
inlinevirtual

Definition at line 67 of file G4MoleculeIterator.hh.

68 {
69
70 }

◆ G4MoleculeIterator() [2/2]

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

Definition at line 72 of file G4MoleculeIterator.hh.

73 {
74 fMap = right.fMap;
75 fDefined = right.fDefined;
76 fIt = right.fIt;
77 }

Member Function Documentation

◆ Name()

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

Definition at line 123 of file G4MoleculeIterator.hh.

124 {
125 return fIt->first;
126 }

◆ operator()()

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

Definition at line 107 of file G4MoleculeIterator.hh.

108 {
109 if (fDefined == false)
110 {
111 fDefined = true;
112 fIt = fMap->begin();
113 return true;
114 }
115 else
116 {
117 fIt++;
118 }
119 if (fIt == fMap->end()) return false;
120 return true;
121 }

◆ operator++() [1/2]

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

Definition at line 95 of file G4MoleculeIterator.hh.

96 {
97 if (!fDefined) return false;
98 fIt++;
99 return fIt != fMap->end() ? true : false;
100 }

◆ operator++() [2/2]

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

Definition at line 88 of file G4MoleculeIterator.hh.

89 {
90 if (!fDefined) return false;
91 fIt++;
92 return fIt != fMap->end() ? true : false;
93 }

◆ operator=()

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

Definition at line 79 of file G4MoleculeIterator.hh.

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

◆ reset()

◆ value()

Member Data Documentation

◆ fDefined

◆ fIt

◆ fMap


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