45#define G4PhysicsConstructorRegistry_cc 1
55 if(0 == theInstance) {
57 theInstance = &manager;
62G4PhysicsConstructorRegistry::G4PhysicsConstructorRegistry()
72 size_t n = physConstr.size();
74 for (
size_t i=0; i<n; ++i) {
88 size_t n = physConstr.size();
90 for (
size_t i=0; i<n; ++i) {
91 if(physConstr[i] == p) {
return; }
94 physConstr.push_back(p);
100 size_t n = physConstr.size();
102 for (
size_t i=0; i<n; ++i) {
103 if ( physConstr[i] == p ) {
113 factories[name] = factory;
120 if (factories.find(name)!=factories.end())
126 return factories[name]->Instantiate();
131 ED <<
"The factory for the physics constructor ["<< name <<
"] does not exist!" <<
G4endl;
139 return ( factories.find(name) != factories.end() );
145 std::vector<G4String> avail;
146 std::map<G4String,G4VBasePhysConstrFactory*>::const_iterator itr;
147 for ( itr = factories.begin(); itr != factories.end(); ++itr ) {
148 avail.push_back(itr->first);
157 G4cout <<
"G4VPhysicsConstructors in G4PhysicsConstructorRegistry are:"
159 if ( avail.empty() )
G4cout <<
"... no registered processes" <<
G4endl;
161 size_t n = avail.size();
162 for (
size_t i=0; i<n; ++i ) {
163 G4cout <<
" [" << std::setw(3) << i <<
"] "
164 <<
" \"" << avail[i] <<
"\"" <<
G4endl;
void G4Exception(const char *originOfException, const char *exceptionCode, G4ExceptionSeverity severity, const char *description)
std::ostringstream G4ExceptionDescription
G4GLOB_DLL std::ostream G4cout
~G4PhysicsConstructorRegistry()
void DeRegister(G4VPhysicsConstructor *)
void AddFactory(G4String, G4VBasePhysConstrFactory *)
G4VPhysicsConstructor * GetPhysicsConstructor(const G4String &name)
void PrintAvailablePhysicsConstructors() const
void Register(G4VPhysicsConstructor *)
static G4PhysicsConstructorRegistry * Instance()
std::vector< G4String > AvailablePhysicsConstructors() const
G4bool IsKnownPhysicsConstructor(const G4String &name)