Geant4 VMC Version 6.6
Loading...
Searching...
No Matches
TG4NameMap Class Reference

The map container for associated names. More...

#include <TG4NameMap.h>

Public Types

typedef std::map< G4String, G4String, std::less< G4String > > Map
 The map of strings to strings.
 
typedef Map::iterator MapIterator
 The iterator for the map of strings to strings.
 
typedef Map::const_iterator MapConstIterator
 The constant iterator for the map of strings to strings.
 

Public Member Functions

 TG4NameMap ()
 
 ~TG4NameMap ()
 
G4bool Add (const G4String &first, const G4String &second)
 
G4bool AddInverse (const G4String &first, const G4String &second)
 
G4bool AddName (const G4String &name)
 
const G4String & GetFirst (const G4String &second) const
 
const G4String & GetSecond (const G4String &first) const
 
void PrintAll () const
 
void Clear ()
 
void SetSecond (const G4String &name)
 

Private Member Functions

 TG4NameMap (const TG4NameMap &right)
 Not implemented.
 
TG4NameMapoperator= (const TG4NameMap &right)
 Not implemented.
 

Private Attributes

Map fMap
 map container
 
Map fInverseMap
 inverse map container
 
G4String fSecond
 the current second
 

Static Private Attributes

static G4String fgUndefined = "Undefined"
 the value of undefined second
 

Detailed Description

The map container for associated names.

The names can be added into map either in pairs (Add() method) or standalone - then they are paired with the fSecond data member (AddName() method)

Author
I. Hrivnacova; IPN, Orsay

Definition at line 30 of file TG4NameMap.h.

Member Typedef Documentation

◆ Map

std::map<G4String, G4String, std::less<G4String> > TG4NameMap::Map

The map of strings to strings.

Definition at line 34 of file TG4NameMap.h.

◆ MapIterator

Map::iterator TG4NameMap::MapIterator

The iterator for the map of strings to strings.

Definition at line 37 of file TG4NameMap.h.

◆ MapConstIterator

Map::const_iterator TG4NameMap::MapConstIterator

The constant iterator for the map of strings to strings.

Definition at line 40 of file TG4NameMap.h.

Constructor & Destructor Documentation

◆ TG4NameMap() [1/2]

TG4NameMap::TG4NameMap ( )

Default constructor

Definition at line 24 of file TG4NameMap.cxx.

◆ ~TG4NameMap()

TG4NameMap::~TG4NameMap ( )

Destructor

Definition at line 30 of file TG4NameMap.cxx.

◆ TG4NameMap() [2/2]

TG4NameMap::TG4NameMap ( const TG4NameMap & right)
private

Not implemented.

Member Function Documentation

◆ Add()

G4bool TG4NameMap::Add ( const G4String & first,
const G4String & second )

Add names pair to the map. fSecond is not used in this add method.

Definition at line 40 of file TG4NameMap.cxx.

Referenced by TG4ParticlesManager::DefineParticles().

◆ AddInverse()

G4bool TG4NameMap::AddInverse ( const G4String & first,
const G4String & second )

Add names pair only to the inverse map.

Definition at line 56 of file TG4NameMap.cxx.

Referenced by TG4ParticlesManager::DefineParticles().

◆ AddName()

G4bool TG4NameMap::AddName ( const G4String & name)

Add name to the map.

Definition at line 70 of file TG4NameMap.cxx.

◆ GetFirst()

const G4String & TG4NameMap::GetFirst ( const G4String & second) const

Get first name associated with given second name.

Definition at line 85 of file TG4NameMap.cxx.

Referenced by AddInverse(), and TG4ParticlesManager::GetParticleDefinition().

◆ GetSecond()

const G4String & TG4NameMap::GetSecond ( const G4String & first) const

Get second name associated with given first name.

Definition at line 97 of file TG4NameMap.cxx.

Referenced by Add(), AddName(), and TG4ParticlesManager::GetPDGEncoding().

◆ PrintAll()

void TG4NameMap::PrintAll ( ) const

Dump the whole map.

Definition at line 109 of file TG4NameMap.cxx.

Referenced by TG4ParticlesManager::DefineParticles().

◆ Clear()

void TG4NameMap::Clear ( )

Clear the map.

Definition at line 139 of file TG4NameMap.cxx.

◆ SetSecond()

void TG4NameMap::SetSecond ( const G4String & name)
inline

Set the current second

Definition at line 75 of file TG4NameMap.h.

◆ operator=()

TG4NameMap & TG4NameMap::operator= ( const TG4NameMap & right)
private

Not implemented.

Member Data Documentation

◆ fgUndefined

G4String TG4NameMap::fgUndefined = "Undefined"
staticprivate

the value of undefined second

Definition at line 65 of file TG4NameMap.h.

Referenced by Add(), AddInverse(), AddName(), Clear(), GetFirst(), and GetSecond().

◆ fMap

Map TG4NameMap::fMap
private

map container

Definition at line 68 of file TG4NameMap.h.

Referenced by Add(), AddName(), Clear(), GetSecond(), and PrintAll().

◆ fInverseMap

Map TG4NameMap::fInverseMap
private

inverse map container

Definition at line 69 of file TG4NameMap.h.

Referenced by Add(), AddInverse(), AddName(), Clear(), GetFirst(), and PrintAll().

◆ fSecond

G4String TG4NameMap::fSecond
private

the current second

Definition at line 70 of file TG4NameMap.h.

Referenced by AddName(), Clear(), and SetSecond().


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