![]() |
Lumiera 0.pre.04~rc.1
»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 258 of file multifact.hpp.
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... | |
Public Types | |
| using | Product = _Conf::WrappedProduct |
Public Member Functions | |
| template<typename... ARGS> | |
| Product | operator() (ID const &id, ARGS &&...args) |
| Core operation of the factory: Select a production line and invoke the fabrication function. | |
| template<typename... ARGS> | |
| Product | invokeFactory (ID const &id, ARGS &&...args) |
| more legible alias for the function operator | |
| template<typename FUNC > | |
| void | defineProduction (ID id, FUNC &&fun) |
| to set up a production line, associated with a specific ID | |
| bool | empty () const |
| bool | contains (ID id) const |
Protected Types | |
| using | Creator = _Fab::FactoryFunc |
Protected Member Functions | |
| Creator & | selectProducer (ID const &id) |
Private Types | |
| using | _Conf = FabConfig< SIG, Wrapper > |
| using | SIG_Fab = _Conf::SIG_Fab |
| using | _Fab = Fab< SIG_Fab, ID > |
Private Attributes | |
| _Fab | funcTable_ |
|
private |
Definition at line 261 of file multifact.hpp.
|
private |
Definition at line 262 of file multifact.hpp.
|
private |
Definition at line 263 of file multifact.hpp.
|
protected |
Definition at line 269 of file multifact.hpp.
| using Product = _Conf::WrappedProduct |
Definition at line 279 of file multifact.hpp.
|
inlineprotected |
Definition at line 272 of file multifact.hpp.
References MultiFact< SIG, ID, Wrapper >::funcTable_, and Fab< SIG, ID >::select().
Referenced by MultiFact< SIG, ID, Wrapper >::operator()().
Here is the call graph for this function:
Here is the caller graph for this function:
|
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 292 of file multifact.hpp.
References MultiFact< SIG, ID, Wrapper >::selectProducer().
Referenced by MultiFact< SIG, ID, Wrapper >::invokeFactory().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
more legible alias for the function operator
Definition at line 305 of file multifact.hpp.
References MultiFact< SIG, ID, Wrapper >::operator()().
Referenced by QueryDispatcher::handle().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
to set up a production line, associated with a specific ID
Definition at line 316 of file multifact.hpp.
References Fab< SIG, ID >::defineProduction(), and MultiFact< SIG, ID, Wrapper >::funcTable_.
Referenced by MultiFact_test::fed_a_custom_finishing_functor(), MultiFact_test::pass_additional_arguments(), MultiFact_test::produce_simple_values(), MultiFact_test::produce_smart_pointers(), and MultiFactArgument_test::run().
Here is the call graph for this function:
Here is the caller graph for this function:
|
inline |
Definition at line 350 of file multifact.hpp.
References Fab< SIG, ID >::empty(), and MultiFact< SIG, ID, Wrapper >::funcTable_.
Here is the call graph for this function:
|
inline |
Definition at line 351 of file multifact.hpp.
References Fab< SIG, ID >::contains(), and MultiFact< SIG, ID, Wrapper >::funcTable_.
Referenced by steam::control::anonymous_namespace{handling-patterns.hpp}::getPatternInstance(), QueryDispatcher::handle(), and MultiFact_test::produce_simple_values().
Here is the call graph for this function:
Here is the caller graph for this function:
|
private |
Definition at line 265 of file multifact.hpp.
Referenced by MultiFact< SIG, ID, Wrapper >::contains(), MultiFact< SIG, ID, Wrapper >::defineProduction(), MultiFact< SIG, ID, Wrapper >::empty(), and MultiFact< SIG, ID, Wrapper >::selectProducer().
Inheritance diagram for MultiFact< SIG, ID, Wrapper >:
Collaboration diagram for MultiFact< SIG, ID, Wrapper >: