1 // Copyright 2014 Renato Tegon Forti, Antony Polukhin.
2 // Copyright 2015 Antony Polukhin.
4 // Distributed under the Boost Software License, Version 1.0.
5 // (See accompanying file LICENSE_1_0.txt
6 // or copy at http://www.boost.org/LICENSE_1_0.txt)
11 //[plugcpp_my_plugin_sum
12 #include <boost/config.hpp> // for BOOST_SYMBOL_EXPORT
13 #include "../tutorial_common/my_plugin_api.hpp"
15 namespace my_namespace
{
17 class my_plugin_sum
: public my_plugin_api
{
20 std::cout
<< "Constructing my_plugin_sum" << std::endl
;
23 std::string
name() const {
27 float calculate(float x
, float y
) {
32 std::cout
<< "Destructing my_plugin_sum ;o)" << std::endl
;
36 // Exporting `my_namespace::plugin` variable with alias name `plugin`
37 // (Has the same effect as `BOOST_DLL_ALIAS(my_namespace::plugin, plugin)`)
38 extern "C" BOOST_SYMBOL_EXPORT my_plugin_sum plugin
;
41 } // namespace my_namespace