Util--  1.1
plugin_wrapper.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_PLUGIN_WRAPPER_VP_2004_08_25
7 #define BOOST_PLUGIN_WRAPPER_VP_2004_08_25
8 
9 #include <boost/mpl/list.hpp>
10 #include <boost/shared_ptr.hpp>
11 
12 #include <iostream>
13 
14 namespace utilmm { namespace plugin {
15 
16  template<class Wrapped, class Parameters>
17  struct plugin_wrapper {};
18 
20  dll_handle_holder(dll_handle dll) : m_dll(dll) {}
22  {
23  std::cout << "DLL handle is dying\n";
24  }
25  private:
26  dll_handle m_dll;
27  };
28 
29  template<class Wrapped>
30  struct plugin_wrapper<Wrapped, boost::mpl::list<> >
31  : public dll_handle_holder, public Wrapped {
33 
34  };
35 
36  template<class Wrapped, class A1>
37  struct plugin_wrapper<Wrapped, boost::mpl::list<A1> >
38  : public dll_handle_holder, Wrapped {
40  : dll_handle_holder(dll), Wrapped(a1) {}
41 
42  };
43 
44  template<class Wrapped, class A1, class A2>
45  struct plugin_wrapper<Wrapped, boost::mpl::list<A1, A2> >
46  : public dll_handle_holder, Wrapped {
47  plugin_wrapper(dll_handle dll, A1 a1, A2 a2) :
48  dll_handle_holder(dll), Wrapped(a1, a2) {
49  std::cout << "plugin_wrapper: " << a1 << " : " << a2 << "\n";
50  }
51  };
52 
53 }}
54 
55 #endif
Definition: undirected_graph.hh:345
boost::shared_ptr< std::map< std::string, boost::any > &()> dll_handle
Definition: virtual_constructors.hh:19
Definition: dll.hh:34
Definition: plugin_wrapper.hh:19
plugin_wrapper(dll_handle dll, A1 a1, A2 a2)
Definition: plugin_wrapper.hh:47
Definition: auto_flag.hh:6
plugin_wrapper(dll_handle dll)
Definition: plugin_wrapper.hh:32
Definition: plugin_wrapper.hh:17
plugin_wrapper(dll_handle dll, A1 a1)
Definition: plugin_wrapper.hh:39
dll_handle_holder(dll_handle dll)
Definition: plugin_wrapper.hh:20
~dll_handle_holder()
Definition: plugin_wrapper.hh:21

Generated on Mon Oct 22 2018 18:39:28 for Util-- by doxygen 1.8.13
SourceForge.net Project Page