Util--  1.1
export_plugin.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_EXPORT_PLUGIN_VP_2004_08_25
7 #define BOOST_EXPORT_PLUGIN_VP_2004_08_25
8 
9 #include <boost/any.hpp>
10 #include <string>
11 #include <map>
12 
14 
15 #define BOOST_EXPORT_PLUGIN(BaseType, ActualType, name) \
16  extern "C" std::map<std::string, boost::any>& boost_exported_plugins_list(); \
17  namespace { \
18  struct boost_plugin_exporter1 { \
19  boost_plugin_exporter1() { \
20  static utilmm::plugin::concrete_factory<BaseType, ActualType> cf; \
21  utilmm::plugin::abstract_factory<BaseType>* w = &cf; \
22  boost_exported_plugins_list().insert(std::make_pair(name, w)); \
23  } \
24  } boost_plugin_exporter_instance1; \
25  }
26 
27 #define BOOST_EXPORT_PLUGIN_LIST() \
28 extern "C" std::map<std::string, boost::any>& boost_exported_plugins_list() \
29 { \
30  static std::map<std::string, boost::any> r; \
31  return r; \
32 }
33 
34 
35 
36 
37 
38 
39 
40 #endif

Generated on Mon Sep 24 2018 17:06:40 for Util-- by doxygen 1.8.13
SourceForge.net Project Page