Geant4.10
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Types | Public Member Functions
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 85 of file G4ParticleTableIterator.hh.

85 { 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  {
65  defined=true;
66  it=mydict->begin();
67  }
68  else
69  {
70  it++;
71  }
72  if(it==mydict->end()) return false;
73  if(skipIons)
74  {
75  while((static_cast<G4ParticleDefinition*>((*it).second))->IsGeneralIon())
76  {
77  it++;
78  if(it==mydict->end()) return false;
79  }
80  }
81  return true;
82  }
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
template<class K, class V>
V G4ParticleTableIterator< K, V >::value ( ) const
inline

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