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

#include <G4CrossSectionDataSetRegistry.hh>

Public Member Functions

 ~G4CrossSectionDataSetRegistry ()
 
void Register (G4VCrossSectionDataSet *)
 
void DeRegister (G4VCrossSectionDataSet *)
 
void Clean ()
 
G4VCrossSectionDataSetGetCrossSectionDataSet (const G4String &name, G4bool warning=true)
 

Static Public Member Functions

static
G4CrossSectionDataSetRegistry
Instance ()
 

Friends

class G4ThreadLocalSingleton< G4CrossSectionDataSetRegistry >
 

Detailed Description

Definition at line 56 of file G4CrossSectionDataSetRegistry.hh.

Constructor & Destructor Documentation

G4CrossSectionDataSetRegistry::~G4CrossSectionDataSetRegistry ( )

Definition at line 91 of file G4CrossSectionDataSetRegistry.cc.

Here is the call graph for this function:

Member Function Documentation

void G4CrossSectionDataSetRegistry::Clean ( )

Definition at line 96 of file G4CrossSectionDataSetRegistry.cc.

97 {
98  size_t n = xSections.size();
99  for (size_t i=0; i<n; ++i) {
100  if(xSections[i]) {
101  //const char* xxx = (xSections[i]->GetName()).c_str();
102  //G4int len = (xSections[i]->GetName()).length();
103  //len = std::min(len, 9);
104  //const G4String xname = G4String(xxx, len);
107  //if( (xname != "NeutronHP") && (xname != "ParticleH") ) {
108  delete xSections[i];
109  //}
110  //std::cout << " done" << " " << this << std::endl;
111  }
112  }
113  xSections.clear();
114 }

Here is the caller graph for this function:

void G4CrossSectionDataSetRegistry::DeRegister ( G4VCrossSectionDataSet p)

Definition at line 128 of file G4CrossSectionDataSetRegistry.cc.

129 {
130  if(!p) return;
131  size_t n = xSections.size();
132  for (size_t i=0; i<n; ++i) {
133  if(xSections[i] == p) {
134  xSections[i] = 0;
135  return;
136  }
137  }
138 }

Here is the caller graph for this function:

G4VCrossSectionDataSet * G4CrossSectionDataSetRegistry::GetCrossSectionDataSet ( const G4String name,
G4bool  warning = true 
)

Definition at line 145 of file G4CrossSectionDataSetRegistry.cc.

146 {
147  size_t n = xSections.size();
148 
149  for (size_t i=0; i<n; ++i)
150  {
151  if(xSections[i])
152  {
153  G4VCrossSectionDataSet* p = xSections[i];
154  if (p->GetName() == name) return p;
155  }
156  }
157  // check if factory exists...
158  //
160  //This thorws if factory is not found, add second parameter to false to avoid this
161  G4VBaseXSFactory* factory = factories->GetFactory(name, warning );
162  if ( factory )
163  return factory->Instantiate();
164  else
165  return static_cast<G4VCrossSectionDataSet*>(0);
166 }
const XML_Char * name
Definition: expat.h:151
const char * p
Definition: xmltok.h:285
const G4String & GetName() const
virtual G4VCrossSectionDataSet * Instantiate()=0
G4VBaseXSFactory * GetFactory(const G4String &name, G4bool abortIfNotFound=true) const
static G4CrossSectionFactoryRegistry * Instance()

Here is the call graph for this function:

Here is the caller graph for this function:

G4CrossSectionDataSetRegistry * G4CrossSectionDataSetRegistry::Instance ( void  )
static

Definition at line 79 of file G4CrossSectionDataSetRegistry.cc.

80 {
81  if(0 == instance) {
83  instance = inst.Instance();
84  }
85  return instance;
86 }

Here is the call graph for this function:

void G4CrossSectionDataSetRegistry::Register ( G4VCrossSectionDataSet p)

Definition at line 116 of file G4CrossSectionDataSetRegistry.cc.

117 {
118  if(!p) return;
119  size_t n = xSections.size();
120  for (size_t i=0; i<n; ++i) {
121  if(xSections[i] == p) { return; }
122  }
123  //G4cout << "Register x-section: " << p->GetName() << " " << p
124  // << " " << this << G4endl;
125  xSections.push_back(p);
126 }

Here is the caller graph for this function:

Friends And Related Function Documentation


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