Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 51 of file G4MoleculeIterator.hh.

Member Typedef Documentation

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

Definition at line 54 of file G4MoleculeIterator.hh.

Constructor & Destructor Documentation

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

Definition at line 60 of file G4MoleculeIterator.hh.

60  :
61  fMap(&_map)
62  {
63  fDefined = false;
64  }
template<typename MOLECULE >
virtual G4MoleculeIterator< MOLECULE >::~G4MoleculeIterator ( )
inlinevirtual

Definition at line 66 of file G4MoleculeIterator.hh.

67  {
68 
69  }
template<typename MOLECULE >
G4MoleculeIterator< MOLECULE >::G4MoleculeIterator ( const G4MoleculeIterator< MOLECULE > &  right)
inline

Definition at line 71 of file G4MoleculeIterator.hh.

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

Member Function Documentation

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

Definition at line 122 of file G4MoleculeIterator.hh.

123  {
124  return fIt->first;
125  }
template<typename MOLECULE >
G4bool G4MoleculeIterator< MOLECULE >::operator() ( )
inline

Definition at line 106 of file G4MoleculeIterator.hh.

107  {
108  if (fDefined == false)
109  {
110  fDefined = true;
111  fIt = fMap->begin();
112  return true;
113  }
114  else
115  {
116  fIt++;
117  }
118  if (fIt == fMap->end()) return false;
119  return true;
120  }
template<typename MOLECULE >
G4bool G4MoleculeIterator< MOLECULE >::operator++ ( int  )
inline

Definition at line 87 of file G4MoleculeIterator.hh.

88  {
89  if (!fDefined) return false;
90  fIt++;
91  return fIt != fMap->end() ? true : false;
92  }
template<typename MOLECULE >
G4bool G4MoleculeIterator< MOLECULE >::operator++ ( )
inline

Definition at line 94 of file G4MoleculeIterator.hh.

95  {
96  if (!fDefined) return false;
97  fIt++;
98  return fIt != fMap->end() ? true : false;
99  }
template<typename MOLECULE >
G4MoleculeIterator& G4MoleculeIterator< MOLECULE >::operator= ( const G4MoleculeIterator< MOLECULE > &  right)
inline

Definition at line 78 of file G4MoleculeIterator.hh.

79  {
80  if (this == &right) return *this;
81  fMap = right.fMap;
82  fDefined = right.fDefined;
83  fIt = right.fIt;
84  return *this;
85  }
template<typename MOLECULE >
void G4MoleculeIterator< MOLECULE >::reset ( )
inline

Definition at line 101 of file G4MoleculeIterator.hh.

102  {
103  fDefined = false;
104  }

Here is the caller graph for this function:

template<typename MOLECULE >
MOLECULE* G4MoleculeIterator< MOLECULE >::value ( )
inline

Definition at line 127 of file G4MoleculeIterator.hh.

128  {
129  return fIt->second;
130  }

Here is the caller graph for this function:

Member Data Documentation

template<typename MOLECULE >
G4bool G4MoleculeIterator< MOLECULE >::fDefined
protected

Definition at line 56 of file G4MoleculeIterator.hh.

template<typename MOLECULE >
MAP::iterator G4MoleculeIterator< MOLECULE >::fIt
protected

Definition at line 57 of file G4MoleculeIterator.hh.

template<typename MOLECULE >
MAP* G4MoleculeIterator< MOLECULE >::fMap
protected

Definition at line 55 of file G4MoleculeIterator.hh.


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