Lumiera  0.pre.03
»edityourfreedom«
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
MultiFact< SIG, ID, Wrapper > Class Template Reference

#include "lib/multifact.hpp"

Description

template<typename SIG, typename ID, template< class > class Wrapper = PassAsIs>
class lib::factory::MultiFact< SIG, ID, Wrapper >

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 264 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 More...
 
bool empty () const
 
template<typename... ARGS>
Product invokeFactory (ID const &id, ARGS &&...args)
 more legible alias for the function operator More...
 
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

CreatorselectProducer (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_
 

Member Typedef Documentation

using _Conf = FabConfig<SIG,Wrapper>
private

Definition at line 267 of file multifact.hpp.

using SIG_Fab = typename _Conf::SIG_Fab
private

Definition at line 268 of file multifact.hpp.

using _Fab = Fab<SIG_Fab,ID>
private

Definition at line 269 of file multifact.hpp.

using Creator = typename _Fab::FactoryFunc
protected

Definition at line 275 of file multifact.hpp.

using Product = typename _Conf::WrappedProduct

Definition at line 285 of file multifact.hpp.

Member Function Documentation

Creator& selectProducer ( ID const &  id)
inlineprotected

Definition at line 278 of file multifact.hpp.

References Fab< SIG, ID >::select().

+ Here is the call graph for this function:

Product operator() ( ID const &  id,
ARGS &&...  args 
)
inline

Core operation of the factory: Select a production line and invoke the fabrication function.

Parameters
idselect the actual pre installed fabrication function to use
argsadditional arguments to pass to the fabrication.
Note
the template parameter #SIG defines the raw or nominal signature of the fabrication, and especially the number of arguments
Returns
the created product, after passing through the #Wrapper functor

Definition at line 298 of file multifact.hpp.

Product invokeFactory ( ID const &  id,
ARGS &&...  args 
)
inline

more legible alias for the function operator

Definition at line 311 of file multifact.hpp.

Referenced by QueryDispatcher::handle().

+ Here is the caller graph for this function:

void defineProduction ( ID  id,
FUNC &&  fun 
)
inline

to set up a production line, associated with a specific ID

Definition at line 322 of file multifact.hpp.

References Fab< SIG, ID >::defineProduction().

Referenced by MultiFact_test::fed_a_custom_finishing_functor(), MultiFact_test::pass_additional_arguments(), MultiFact_test::produce_simple_values(), and MultiFact< SIG, ID, Wrapper >::Singleton< IMP >::Singleton().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

bool empty ( ) const
inline

Definition at line 356 of file multifact.hpp.

References Fab< SIG, ID >::empty().

+ Here is the call graph for this function:

bool contains ( ID  id) const
inline

Definition at line 357 of file multifact.hpp.

References Fab< SIG, ID >::contains().

Referenced by QueryDispatcher::handle().

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Member Data Documentation

_Fab funcTable_
private

Definition at line 271 of file multifact.hpp.

+ Inheritance diagram for MultiFact< SIG, ID, Wrapper >:
+ Collaboration diagram for MultiFact< SIG, ID, Wrapper >:

The documentation for this class was generated from the following file: