Geant4  10.03.p01
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
G4AttDefStore Namespace Reference

Functions

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

Variables

G4ThreadLocal std::map
< G4String, std::map< G4String,
G4AttDef > * > * 
m_defsmaps = 0
 

Function Documentation

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

Definition at line 39 of file G4AttDefStore.cc.

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

Here is the caller graph for this function:

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

Definition at line 66 of file G4AttDefStore.cc.

67 {
68  if (!m_defsmaps)
69  m_defsmaps = new std::map<G4String,std::map<G4String,G4AttDef>*>;
70  std::map<G4String,std::map<G4String,G4AttDef>*>::const_iterator i;
71  for (i = m_defsmaps->begin(); i != m_defsmaps->end(); ++i)
72  {
73  if (i->second == definitions)
74  {
75  key = i->first;
76  return true;
77  }
78  }
79 
80  return false;
81 }
G4int first(char) const
G4ThreadLocal std::map< G4String, std::map< G4String, G4AttDef > * > * m_defsmaps

Here is the call graph for this function:

Here is the caller graph for this function:

Variable Documentation

G4ThreadLocal std::map< G4String, std::map< G4String, G4AttDef > * > * G4AttDefStore::m_defsmaps = 0

Definition at line 36 of file G4AttDefStore.cc.