|
BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
|
Factory for user specified accelerator components. More...
#include <BDSComponentFactoryUser.hh>

Public Member Functions | |
| void | RegisterComponent (const G4String &componentTypeName, BDSComponentConstructor *componentConstructor) |
| Register a constructor instance by a given name. | |
| G4bool | CanConstructComponentByName (const G4String &componentTypeName) const |
| Check whether a component can be constructed - ie if the name exists. | |
| BDSAcceleratorComponent * | ConstructComponent (const G4String &componentTypeName, GMAD::Element const *elementIn, GMAD::Element const *prevElementIn, GMAD::Element const *nextElementIn, const BDSBeamlineIntegral &integral) |
Private Attributes | |
| std::map< G4String, BDSComponentConstructor * > | userFunctions |
| Map of user component name with constructors to build a component. | |
Factory for user specified accelerator components.
Definition at line 61 of file BDSComponentFactoryUser.hh.
| BDSComponentFactoryUser::BDSComponentFactoryUser | ( | ) |
Definition at line 26 of file BDSComponentFactoryUser.cc.
| BDSComponentFactoryUser::~BDSComponentFactoryUser | ( | ) |
Definition at line 29 of file BDSComponentFactoryUser.cc.
| G4bool BDSComponentFactoryUser::CanConstructComponentByName | ( | const G4String & | componentTypeName | ) | const |
Check whether a component can be constructed - ie if the name exists.
Definition at line 41 of file BDSComponentFactoryUser.cc.
References userFunctions.
Referenced by BDSComponentFactory::CreateComponent().

| BDSAcceleratorComponent * BDSComponentFactoryUser::ConstructComponent | ( | const G4String & | componentTypeName, |
| GMAD::Element const * | elementIn, | ||
| GMAD::Element const * | prevElementIn, | ||
| GMAD::Element const * | nextElementIn, | ||
| const BDSBeamlineIntegral & | integral | ||
| ) |
Find and call the constructor. This assumes the name definitely exists otherwise an STL access exception will be thrown.
Definition at line 46 of file BDSComponentFactoryUser.cc.
References userFunctions.
Referenced by BDSComponentFactory::CreateComponent().

| void BDSComponentFactoryUser::RegisterComponent | ( | const G4String & | componentTypeName, |
| BDSComponentConstructor * | componentConstructor | ||
| ) |
Register a constructor instance by a given name.
Definition at line 35 of file BDSComponentFactoryUser.cc.
References userFunctions.
Referenced by BDSIM::RegisterUserComponent().

|
private |
Map of user component name with constructors to build a component.
Definition at line 84 of file BDSComponentFactoryUser.hh.
Referenced by CanConstructComponentByName(), ConstructComponent(), and RegisterComponent().