![]() |
Lumiera
0.pre.03
»edit your freedom«
|
#include "lib/multifact.hpp"
Factory for creating a family of objects by ID.
The actual factory functions are to be installed from the usage site through calls to defineProduction . Each generated object will be treated by the Wrapper template, allowing for the generation of smart-ptrs. The embedded class Singleton allows to build a family of singleton objects; it is to be instantiated at the call site and acts as singleton factory, accessible through a MultiFact instance as frontend.
Definition at line 253 of file multifact.hpp.
Public Types | |
using | Product = typename _Conf::WrappedProduct |
Public Member Functions | |
bool | contains (ID id) const |
template<typename FUNC > | |
void | defineProduction (ID id, FUNC &&fun) |
to set up a production line, associated with a specific ID | |
bool | empty () const |
template<typename... ARGS> | |
Product | invokeFactory (ID const &id, ARGS &&...args) |
more legible alias for the function operator | |
template<typename... ARGS> | |
Product | operator() (ID const &id, ARGS &&...args) |
Core operation of the factory: Select a production line and invoke the fabrication function. More... | |
Classes | |
class | Singleton |
Convenience shortcut for automatically setting up a production line, to fabricate a singleton instance of the given implementation target type (IMP) More... | |
Protected Types | |
using | Creator = typename _Fab::FactoryFunc |
Protected Member Functions | |
Creator & | selectProducer (ID const &id) |
Private Types | |
using | _Conf = FabConfig< SIG, Wrapper > |
using | _Fab = Fab< SIG_Fab, ID > |
using | SIG_Fab = typename _Conf::SIG_Fab |
Private Attributes | |
_Fab | funcTable_ |
|
inline |
Core operation of the factory: Select a production line and invoke the fabrication function.
id | select the actual pre installed fabrication function to use |
args | additional arguments to pass to the fabrication. |
Definition at line 287 of file multifact.hpp.