Util--  1.1
abstract_factory.hh
Go to the documentation of this file.
1 // Copyright Vladimir Prus 2004.
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE_1_0.txt
4 // or copy at http://www.boost.org/LICENSE_1_0.txt)
5 
6 #ifndef BOOST_ABSTRACT_FACTORY_VP_2004_08_25
7 #define BOOST_ABSTRACT_FACTORY_VP_2004_08_25
8 
9 #include <boost/mpl/inherit_linearly.hpp>
10 #include <boost/mpl/list.hpp>
11 #include <boost/shared_ptr.hpp>
12 
14 
15 namespace utilmm { namespace plugin {
16 
18  void create(int*******);
19  };
20 
25  template<class BasePlugin, class Parameters>
27  };
28 
29  template<class BasePlugin>
30  struct abstract_factory_item_N<BasePlugin, boost::mpl::list<> > {
31  virtual BasePlugin* create(dll_handle dll) = 0;
32  };
33 
34  template<class BasePlugin, class A1>
35  struct abstract_factory_item_N<BasePlugin, boost::mpl::list<A1> > {
36  virtual BasePlugin* create(dll_handle dll, A1 a1) = 0;
37  };
38 
39  template<class BasePlugin, class A1, class A2>
40  struct abstract_factory_item_N<BasePlugin, boost::mpl::list<A1, A2> > {
41  virtual BasePlugin* create(dll_handle dll, A1 a1, A2 a2) = 0;
42  };
43 
44 
45  template<class BasePlugin, class Base, class Parameters>
47  public Base,
48  public abstract_factory_item_N<BasePlugin, Parameters>
49  {
50  using Base::create;
52  };
53 
54  using namespace boost::mpl::placeholders;
55 
56  template<class BasePlugin>
58  public boost::mpl::inherit_linearly<
59  typename virtual_constructors<BasePlugin>::type,
60  abstract_factory_item<BasePlugin, _, _>,
61  empty_abstract_factory_item>::type
62  {
63  };
64 
65 }}
66 
67 #endif
Definition: undirected_graph.hh:345
boost::shared_ptr< std::map< std::string, boost::any > &()> dll_handle
Definition: virtual_constructors.hh:19
Definition: abstract_factory.hh:46
Definition: abstract_factory.hh:26
Definition: dll.hh:34
Definition: auto_flag.hh:6
Definition: abstract_factory.hh:17
Definition: abstract_factory.hh:57

Generated on Mon Oct 8 2018 08:38:45 for Util-- by doxygen 1.8.11
SourceForge.net Project Page