Mirror reflection library 0.5.13

mirror::invoker_maker< Manufacturer, Suppliers, Enumerator, SourceTraits > Struct Template Reference

Helper class for more convenient instantiation of the invoker template. More...

#include <mirror/invoker.hpp>

Classes

struct  invoker
 This meta-function creates an invoker creating the Product. More...

Detailed Description

template<template< class, class > class Manufacturer, template< class, class > class Suppliers, template< class, class > class Enumerator, class SourceTraits>
struct mirror::invoker_maker< Manufacturer, Suppliers, Enumerator, SourceTraits >

Helper class for more convenient instantiation of the invoker template.

This template class can be used for a convenient creation of invokers of the same kind but calling different functions. If one wants to use the same kind of invoker (i.e. using the same Manufacturer, Suppliers and Enumerator templates and the same SourceTraits parameter) to call different functions, this template can be used in the following way:

  // implement the class which will be passed as the SourceTraits parameter
  class my_factory_param
  { ... some implementation ... };

  // implement the parameter manufacturer template
  template <class Product, class Param>
  class my_manufacturer
  { ... some implementation ... };

  // implement the parameter supplier(s) template
  template <class Product, class Param>
  class my_suppliers
  { ... some implementation ... };

  // use the invoker_maker template to define a custom invoker maker
  typedef invoker_maker<
      my_manufacturer,
      my_suppliers,
      my_factory_param
  > my_maker;

  // use the maker to create some factories
  my_maker::invoker<my_function_1>::type my_fn_1_invoker;
  my_maker::invoker<my_function_2>::type my_fn_2_invoker;
  my_maker::invoker<my_function_3>::type my_fn_3_invoker;

  my_class x;
  my_fn_1_invoker.call_on(x);
  my_fn_2_invoker.call_on(x);
  my_fn_3_invoker.call_on(x);
Template Parameters:
Manufacturera class template which knows how to construct the parametes for the constructors. this template can for example use this factory template recursivelly for elaborated types and specify how to construct and initialize instances of the native C++ types.
Suppliersa class template which knows how to get existing instances to be supplied as parameters to the constructors.
Enumeratora class template which knows how to get enumerated values from external representations, like their names or values.
SourceTraitsa parameter for the Manufacturer and Suppliers templates, which can be used for further configuration and fine-tuning of the generated factory.
See also:
invoker

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

Copyright © 2006-2011 Matus Chochlik, University of Zilina, Zilina, Slovakia.
<matus.chochlik -at- fri.uniza.sk>
<chochlik -at -gmail.com>
Documentation generated on Fri Dec 16 2011 by Doxygen (version 1.7.3).
Important note: Although the 'boostified' version of Mirror uses the Boost C++ libraries Coding Guidelines and is implemented inside of the boost namespace, it IS NOT an officially reviewed and accepted Boost library. Mirror is being developed with the intention to be submitted for review for inclusion to the Boost C++ libraries.