Geant4 9.6.0
Toolkit for the simulation of the passage of particles through matter
Loading...
Searching...
No Matches
G4AttDefStore Namespace Reference

Functions

std::map< G4String, G4AttDef > * GetInstance (G4String storeKey, G4bool &isNew)
 
G4bool GetStoreKey (const std::map< G4String, G4AttDef > *definitions, G4String &key)
 

Variables

std::map< G4String, std::map< G4String, G4AttDef > * > m_defsmaps
 

Function Documentation

◆ GetInstance()

std::map< G4String, G4AttDef > * G4AttDefStore::GetInstance ( G4String  storeKey,
G4bool isNew 
)

Definition at line 38 of file G4AttDefStore.cc.

39{
40 // Allocate the new map if not existing already
41 // and return it to the caller
42 //
43 std::map<G4String,G4AttDef>* definitions;
44 std::map<G4String,std::map<G4String,G4AttDef>*>::iterator iDefinitions =
45 m_defsmaps.find(storeKey);
46
47 if (iDefinitions == m_defsmaps.end())
48 {
49 isNew = true;
50 definitions = new std::map<G4String,G4AttDef>;
51 m_defsmaps[storeKey] = definitions;
52 }
53 else
54 {
55 isNew = false;
56 definitions = iDefinitions->second;
57 }
58 return definitions;
59}
std::map< G4String, std::map< G4String, G4AttDef > * > m_defsmaps

Referenced by G4RichTrajectory::GetAttDefs(), G4RichTrajectoryPoint::GetAttDefs(), G4SmoothTrajectory::GetAttDefs(), G4SmoothTrajectoryPoint::GetAttDefs(), G4Trajectory::GetAttDefs(), G4TrajectoryPoint::GetAttDefs(), G4PhysicalVolumeModel::GetAttDefs(), and G4TrajectoriesModel::GetAttDefs().

◆ GetStoreKey()

G4bool G4AttDefStore::GetStoreKey ( const std::map< G4String, G4AttDef > *  definitions,
G4String key 
)

Definition at line 61 of file G4AttDefStore.cc.

63{
64 std::map<G4String,std::map<G4String,G4AttDef>*>::const_iterator i;
65 for (i = m_defsmaps.begin(); i != m_defsmaps.end(); ++i)
66 {
67 if (i->second == definitions)
68 {
69 key = i->first;
70 return true;
71 }
72 }
73
74 return false;
75}
G4int first(char) const

Referenced by operator<<().

Variable Documentation

◆ m_defsmaps

std::map< G4String, std::map< G4String, G4AttDef > * > G4AttDefStore::m_defsmaps

Definition at line 35 of file G4AttDefStore.cc.

Referenced by GetInstance(), and GetStoreKey().