|
EGSnrc C++ class library
Report PIRS-898 (2021)
Iwan Kawrakow, Ernesto Mainegra-Hing, Frederic Tessier, Reid Townson and Blake Walters
|
A typed object factory. More...
#include <egs_object_factory.h>
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_Object * | createSingleObject (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_Object * | createObjects (EGS_Input *inp, const string §ion_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_Object * | getObject (const string &Name) |
| Get the object named Name. More... | |
| EGS_Object * | takeObject (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. | |
| int | nObjects () const |
| Get the number of objects this factory has created so far. | |
| EGS_Object * | getObject (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. | |
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.
1.9.1