#include <G4CrossSectionFactoryRegistry.hh>
◆ ~G4CrossSectionFactoryRegistry()
| G4CrossSectionFactoryRegistry::~G4CrossSectionFactoryRegistry |
( |
| ) |
|
|
default |
◆ G4CrossSectionFactoryRegistry()
◆ DeRegister()
Definition at line 60 of file G4CrossSectionFactoryRegistry.cc.
61{
62 if ( nullptr == factory || factories.empty() ) { return; }
64 for ( auto const & f : factories ) {
65 if ( factory == f.second ) {
66 factories[f.first] = nullptr;
67 }
68 }
69 l.unlock();
70}
G4TemplateAutoLock< G4Mutex > G4AutoLock
◆ GetFactory()
Definition at line 73 of file G4CrossSectionFactoryRegistry.cc.
74{
75 G4VBaseXSFactory* ptr = nullptr;
76 auto it = factories.find(name);
77 if ( it != factories.end() ) {
78 ptr = it->second;
79 } else if ( abortIfNotFound ) {
81 msg <<
"Cross section factory with name: " <<
name <<
" not found.";
82 G4Exception(
"G4CrossSectionFactoryRegistry::GetFactory(...)",
84 }
85 return ptr;
86}
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
const char * name(G4int ptype)
Referenced by G4CrossSectionDataSetRegistry::GetCrossSectionDataSet().
◆ Instance()
◆ operator=()
◆ Register()
Definition at line 49 of file G4CrossSectionFactoryRegistry.cc.
50{
51 if ( factories.find(name) == factories.end() ) {
53 if ( factories.find(name) == factories.end() ) {
54 factories[
name] = factory;
55 }
56 l.unlock();
57 }
58}
◆ operator<<
Definition at line 88 of file G4CrossSectionFactoryRegistry.cc.
88 {
89 msg<<"Factory Registry "<<&rhs<<" has factories: [";
90 for ( std::map<G4String,G4VBaseXSFactory*>::const_iterator it =rhs.factories.begin();
91 it != rhs.factories.end() ; ++it )
92 {
93 msg<<(*it).first<<":"<<(*it).second<<",";
94 }
95 msg<<"]";
96 return msg;
97}
The documentation for this class was generated from the following files: