QwAnalysis
|
Pure virtual factory. More...
#include <QwFactory.h>
Public Member Functions | |
virtual | ~VQwFactory () |
Default virtual destructor. More... | |
virtual base_t * | Create (const std::string &name) const =0 |
Creation of objects by type (pure virtual) More... | |
virtual base_t * | Cast (base_t *base) const =0 |
Dynamic cast to type (pure virtual) More... | |
Static Public Member Functions | |
static base_t * | Create (const std::string &type, const std::string &name) |
Create an object of type with name. More... | |
static base_t * | Cast (base_t *base, const std::string &type) |
Dynamic cast of object into type. More... | |
static bool | InheritsFrom (base_t *base, const std::string &type) |
Test whether object inherits from type. More... | |
Static Protected Member Functions | |
static std::map< std::string, VQwFactory * > & | GetRegisteredTypes () |
Map from string to concrete type factories. More... | |
static void | ListRegisteredTypes () |
List available type factories. More... | |
static VQwFactory * | GetFactory (const std::string &type) |
Get a concrete type factory by string. More... | |
Pure virtual factory.
In order to enable the instantiation of types based on run-time information, we generate a map of type factories by type name. This map is filled automatically when the executable is loaded, and contains concrete factories derived from this pure virtual base class.
Definition at line 33 of file QwFactory.h.
|
inlinevirtual |
|
inlinestatic |
Dynamic cast of object into type.
Definition at line 46 of file QwFactory.h.
Referenced by VQwFactory< VQwDataElement >::Cast(), and VQwFactory< VQwDataElement >::InheritsFrom().
|
pure virtual |
Dynamic cast to type (pure virtual)
Implemented in QwFactory< base_t, type_t >, QwFactory< VQwDataElement, dataelement_t >, and QwFactory< VQwSubsystem, subsystem_t >.
|
inlinestatic |
Create an object of type with name.
Definition at line 41 of file QwFactory.h.
Referenced by VQwFactory< VQwDataElement >::Create().
|
pure virtual |
Creation of objects by type (pure virtual)
Implemented in QwFactory< base_t, type_t >, QwFactory< VQwDataElement, dataelement_t >, and QwFactory< VQwSubsystem, subsystem_t >.
|
inlinestaticprotected |
Get a concrete type factory by string.
Definition at line 76 of file QwFactory.h.
Referenced by VQwFactory< VQwDataElement >::Cast(), and VQwFactory< VQwDataElement >::Create().
|
inlinestaticprotected |
Map from string to concrete type factories.
Definition at line 63 of file QwFactory.h.
Referenced by VQwFactory< VQwDataElement >::GetFactory(), VQwFactory< VQwDataElement >::ListRegisteredTypes(), and QwFactory< VQwSubsystem, subsystem_t >::QwFactory().
|
inlinestatic |
Test whether object inherits from type.
Definition at line 51 of file QwFactory.h.
|
inlinestaticprotected |
List available type factories.
Definition at line 68 of file QwFactory.h.
Referenced by VQwFactory< VQwDataElement >::GetFactory().