EGSnrc C++ class library  Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
Public Member Functions | List of all members
EGS_TypedObjectFactory< T > Class Template Reference

A typed object factory. More...

#include <egs_object_factory.h>

Inheritance diagram for EGS_TypedObjectFactory< T >:
EGS_ObjectFactory

Public Member Functions

 EGS_TypedObjectFactory (const string &dsoPath, const string &type, int where=0)
 
bool isKnownTypeId (EGS_Object *o) const
 
bool isMyObjectType (EGS_Object *o, const char *func)
 
void addKnownObject (EGS_Object *o)
 
EGS_ObjectcreateSingleObject (EGS_Input *i, const char *fname=0, bool u=true)
 
bool addObject (EGS_Object *o, bool unique=true)
 
- Public Member Functions inherited from EGS_ObjectFactory
 EGS_ObjectFactory (const string &dsoPath, int where=0)
 Create an object factory that will load shared libraries from the directory dsoPath. More...
 
virtual ~EGS_ObjectFactory ()
 Destructor. More...
 
EGS_ObjectcreateObjects (EGS_Input *inp, const string &section_delimeter, const string &object_delimeter, const string &select_key, const char *funcname=0, bool unique=true)
 Create all objects specified by the information inp. More...
 
bool haveObject (const EGS_Object *o) const
 Does the factory own the object pointed to by o? More...
 
EGS_ObjectgetObject (const string &Name)
 Get the object named Name. More...
 
EGS_ObjecttakeObject (const string &Name)
 Take the object named Name from the list of objects. More...
 
void removeObject (EGS_Object *o)
 Remove o from the list of objects.
 
void addKnownTypeId (const char *typeid_name)
 Add a known typeid to this factory. More...
 
int nObjects () const
 Get the number of objects this factory has created so far.
 
EGS_ObjectgetObject (int j)
 Get the j'th object.
 

Additional Inherited Members

- Protected Attributes inherited from EGS_ObjectFactory
vector< EGS_Library * > libs
 DSOs loaded so far.
 
vector< EGS_Object * > known_objects
 known Objects
 
vector< EGS_Object * > objects
 Created objects.
 
vector< string > known_typeids
 Known typeid's.
 
string dso_path
 The path to look for DSOs.
 

Detailed Description

template<class T>
class EGS_TypedObjectFactory< T >

A typed object factory.

Typed object factories can only create/add objects of a given type. This is useful for checking that e.g. the object created based on the user input actually is a particle source and not some other type of EGS_Object.

Definition at line 381 of file egs_object_factory.h.


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