Factory class to create ConnectorNode objects. More...
#include <ConnectorFactory.h>
Factory class to create ConnectorNode objects.
This class is mainly used via the newConnectorNode() function, for example:
where r0
and r1
are reactor objects.
Definition at line 27 of file ConnectorFactory.h.
Public Member Functions | |
void | deleteFactory () override |
Virtual abstract function that deletes the factory. | |
![]() | |
ConnectorNode * | create (const string &name, Args... args) |
Create an object using the object construction function corresponding to "name" and the provided constructor arguments. | |
void | reg (const string &name, function< ConnectorNode *(Args...)> f) |
Register a new object construction function. | |
void | addAlias (const string &original, const string &alias) |
Add an alias for an existing registered type. | |
string | canonicalize (const string &name) |
Get the canonical name registered for a type. | |
bool | exists (const string &name) const |
Returns true if name is registered with this factory. | |
![]() | |
virtual | ~FactoryBase () |
destructor | |
Static Public Member Functions | |
static ConnectorFactory * | factory () |
![]() | |
static void | deleteFactories () |
static function that deletes all factories in the internal registry maintained in a static variable | |
Static Private Attributes | |
static ConnectorFactory * | s_factory = 0 |
static std::mutex | connector_mutex |
Additional Inherited Members | |
![]() | |
void | addDeprecatedAlias (const string &original, const string &alias) |
Add a deprecated alias for an existing registered type. | |
![]() | |
FactoryBase () | |
Constructor. | |
virtual void | deleteFactory ()=0 |
Virtual abstract function that deletes the factory. | |
|
private |
Definition at line 17 of file ConnectorFactory.cpp.
|
static |
Definition at line 33 of file ConnectorFactory.cpp.
|
overridevirtual |
Virtual abstract function that deletes the factory.
This must be properly defined in child objects.
Implements FactoryBase.
Definition at line 41 of file ConnectorFactory.cpp.
|
staticprivate |
Definition at line 37 of file ConnectorFactory.h.
|
staticprivate |
Definition at line 38 of file ConnectorFactory.h.