souffle
2.0.2-371-g6315b36
|
Abstract program factory class. More...
#include <SouffleInterface.h>
Public Member Functions | |
virtual | ~ProgramFactory ()=default |
Destructor. More... | |
Static Public Member Functions | |
static SouffleProgram * | newInstance (const std::string &name) |
Create an instance by finding the name of the program factory, return nullptr if the instance not found. More... | |
Protected Member Functions | |
virtual SouffleProgram * | newInstance ()=0 |
Create new instance (abstract). More... | |
ProgramFactory (std::string name) | |
Constructor. More... | |
Static Protected Member Functions | |
static ProgramFactory * | find (const std::string &factoryName) |
Find a factory by its name, return the fatory if found, return nullptr if the factory not found. More... | |
static void | registerFactory (ProgramFactory *factory) |
Create and insert a factory into the factoryReg map. More... | |
Protected Attributes | |
ProgramFactory * | link = nullptr |
Singly linked-list to store all program factories Note that STL data-structures are not possible due to "static initialization order fiasco (problem)". More... | |
std::string | name |
The name of factory. More... | |
Static Private Member Functions | |
static std::map< std::string, ProgramFactory * > & | getFactoryRegistry () |
Helper method for creating a factory map, which map key is the name of the program factory, map value is the pointer of the ProgramFactory. More... | |
Abstract program factory class.
Definition at line 1006 of file SouffleInterface.h.
|
inlineprotected |
Constructor.
Constructor adds factory to static singly-linked list for registration.
Definition at line 1032 of file SouffleInterface.h.
|
virtualdefault |
Destructor.
Destructor of ProgramFactory.
|
inlinestaticprotected |
Find a factory by its name, return the fatory if found, return nullptr if the factory not found.
factoryName | The factory name (const std::string) |
Definition at line 1071 of file SouffleInterface.h.
References name, and newInstance().
|
inlinestaticprivate |
Helper method for creating a factory map, which map key is the name of the program factory, map value is the pointer of the ProgramFactory.
TODO (NubKel) : Improve documentation of use and interaction between inline and static, here and for the whole class.
Definition at line 1046 of file SouffleInterface.h.
References name.
Referenced by registerFactory().
|
protectedpure virtual |
Create new instance (abstract).
Referenced by find(), and newInstance().
|
inlinestatic |
Create an instance by finding the name of the program factory, return nullptr if the instance not found.
name | Instance name (const std::string) |
Definition at line 1097 of file SouffleInterface.h.
|
inlinestaticprotected |
Create and insert a factory into the factoryReg map.
factory | Pointer of the program factory (ProgramFactory*) |
Definition at line 1057 of file SouffleInterface.h.
References getFactoryRegistry().
|
protected |
Singly linked-list to store all program factories Note that STL data-structures are not possible due to "static initialization order fiasco (problem)".
(The problem of the order static objects get initialized, causing effect such as program access static variables before they initialized.) The static container needs to be a primitive type such as pointer set to NULL. Link to next factory.
Definition at line 1018 of file SouffleInterface.h.
|
protected |
The name of factory.
Definition at line 1023 of file SouffleInterface.h.
Referenced by find(), and getFactoryRegistry().