Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4ParticleTableIterator< K, V > Class Template Reference

#include <G4ParticleTableIterator.hh>

Public Types

typedef std::map< K, V,
std::less< K > > 
Map
 

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 43 of file G4ParticleTableIterator.hh.

Member Typedef Documentation

template<class K, class V>
typedef std::map<K, V, std::less<K> > G4ParticleTableIterator< K, V >::Map

Definition at line 46 of file G4ParticleTableIterator.hh.

Constructor & Destructor Documentation

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

Definition at line 47 of file G4ParticleTableIterator.hh.

47  :
48  it(adict.begin()),
49  mydict(&adict),
50  defined(false),
51  skipIons(true)
52  {}

Member Function Documentation

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

Definition at line 80 of file G4ParticleTableIterator.hh.

80 { return &((*it).first); }
template<class K, class V>
G4bool G4ParticleTableIterator< K, V >::operator() ( )
inline

Definition at line 61 of file G4ParticleTableIterator.hh.

62  {
63  if(!defined) {
64  defined=true;
65  it=mydict->begin();
66  } else {
67  it++;
68  }
69  if(it==mydict->end()) return false;
70  if(skipIons){
71  while((static_cast<G4ParticleDefinition*>((*it).second))->IsGeneralIon()){ // Loop checking, 09.08.2015, K.Kurashige
72  it++;
73  if(it==mydict->end()) return false;
74  }
75  }
76  return true;
77  }
template<class K, class V>
G4bool G4ParticleTableIterator< K, V >::operator++ ( )
inline

Definition at line 54 of file G4ParticleTableIterator.hh.

55  {
56  if(!defined) return false;
57  it++;
58  return it!=mydict->end() ? true : false;
59  }
template<class K, class V>
void G4ParticleTableIterator< K, V >::reset ( G4bool  ifSkipIon = true)
inline

Definition at line 79 of file G4ParticleTableIterator.hh.

79 {defined=false; skipIons = ifSkipIon; }

Here is the caller graph for this function:

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

Definition at line 81 of file G4ParticleTableIterator.hh.

81 { return (*it).second; }

Here is the caller graph for this function:


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