Mirror reflection library 0.5.13
|
Manager is reponsible for the selection of the constructor to be used. More...
#include <mirror/doc/concepts_fact_gen.hpp>
Public Member Functions | |
Suppliers (UnspecifiedType parent_data, ConstructionInfo construction_info) | |
Constructor. | |
void | finish (UnspecifiedType parent_data) |
Post construction finishing of the Manager. | |
UnspecifiedType | add_constructor (UnspecifiedType parent_data, ConstructorInfo constructor_info) |
This gets called once per every manager constructor of Product . | |
int | index (void) |
Returns the index of the constructor to be used. |
Manager is reponsible for the selection of the constructor to be used.
This overload of the Manufacturer template is also call the Manager
since its role is to keep track of the available constructors and to pick one of them based on the input data or on user preference. Manager
has therfore a different interface than a regular Manufacturer.
UnspecifiedType mirror::Manufacturer< void, SourceTraits >::add_constructor | ( | UnspecifiedType | parent_data, |
ConstructorInfo | constructor_info | ||
) |
This gets called once per every manager constructor of Product
.
The factory calls this member function once per every constructor of the Product
type. The manager is responsible for storing necessary meta-data about the constructor in order to be able to pick one later when the index()
member function is called.
The return value is data of factory-plugin-specific type that will be passed as an argument to nested Manufacturer or Suppliers.
The constructors can be enumerated either forward or backward the enum_info argument can provide hints about the direction of the traversal or enumeration.
void mirror::Manufacturer< void, SourceTraits >::finish | ( | UnspecifiedType | parent_data | ) |
Post construction finishing of the Manager.
Some factories may need additional post-construction finishing when the sources for all parameters and the Manager is created. Such post-construction finishing can be done here.