BDSIM
BDSIM is a Geant4 extension toolkit for simulation of particle transport in accelerator beamlines.
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes
BDSComponentFactoryUser Class Reference

Factory for user specified accelerator components. More...

#include <BDSComponentFactoryUser.hh>

Collaboration diagram for BDSComponentFactoryUser:
Collaboration graph

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.
 
BDSAcceleratorComponentConstructComponent (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.
 

Detailed Description

Factory for user specified accelerator components.

Author
Laurie Nevay

Definition at line 61 of file BDSComponentFactoryUser.hh.

Constructor & Destructor Documentation

◆ BDSComponentFactoryUser()

BDSComponentFactoryUser::BDSComponentFactoryUser ( )

Definition at line 26 of file BDSComponentFactoryUser.cc.

◆ ~BDSComponentFactoryUser()

BDSComponentFactoryUser::~BDSComponentFactoryUser ( )

Definition at line 29 of file BDSComponentFactoryUser.cc.

Member Function Documentation

◆ CanConstructComponentByName()

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().

Here is the caller graph for this function:

◆ ConstructComponent()

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().

Here is the caller graph for this function:

◆ RegisterComponent()

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().

Here is the caller graph for this function:

Field Documentation

◆ userFunctions

std::map<G4String, BDSComponentConstructor*> BDSComponentFactoryUser::userFunctions
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().


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