41 G4AutoLock l(G4TypeMutex<G4CrossSectionFactoryRegistry>());
54 G4Exception(
"G4CrossSectionFactoryRegistry::G4CrossSectionFactoryRegistry",
55 "CrossSection004",
FatalException,
"Use of copy constructor not allowed");
59 G4Exception(
"G4CrossSectionFactoryRegistry::G4CrossSectionFactoryRegistry",
60 "CrossSection004",
FatalException,
"Use of assignement operator not allowed");
66 G4AutoLock l(G4TypeMutex<G4CrossSectionFactoryRegistry>());
70 msg <<
"Cross section factory with name: "<<name
71 <<
" already existing, old factory has been replaced";
72 G4Exception(
"G4CrossSectionFactoryRegistry::Register(...)",
80 G4AutoLock l(G4TypeMutex<G4CrossSectionFactoryRegistry>());
81 std::map<G4String,G4VBaseXSFactory*>::const_iterator it =
factories.find(name);
82 if ( it !=
factories.end() )
return it->second;
85 if ( abortIfNotFound )
88 msg <<
"Cross section factory with name: "<<name
90 G4Exception(
"G4CrossSectionFactoryRegistry::Register(...)",
99 msg<<
"Factory Registry "<<&rhs<<
" has factories: [";
100 for ( std::map<G4String,G4VBaseXSFactory*>::const_iterator it =rhs.factories.begin() ;
101 it != rhs.factories.end() ; ++it )
103 msg<<(*it).first<<
":"<<(*it).second<<
",";
std::ostringstream G4ExceptionDescription
std::ostream & operator<<(std::ostream &, const BasicVector3D< float > &)
static G4CrossSectionFactoryRegistry * instance
std::map< G4String, G4VBaseXSFactory * > factories
G4VBaseXSFactory * GetFactory(const G4String &name, G4bool abortIfNotFound=true) const
void Register(const G4String &name, G4VBaseXSFactory *factory)
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
G4CrossSectionFactoryRegistry & operator=(const G4CrossSectionFactoryRegistry &)
G4CrossSectionFactoryRegistry()
static G4CrossSectionFactoryRegistry * Instance()