1 // Copyright 2016 Antony Polukhin.
3 // Distributed under the Boost Software License, Version 1.0.
4 // (See accompanying file LICENSE_1_0.txt
5 // or copy at http://www.boost.org/LICENSE_1_0.txt)
7 #ifndef BOOST_DLL_MY_CPP_PLUGIN_API_HPP
8 #define BOOST_DLL_MY_CPP_PLUGIN_API_HPP
15 class BOOST_SYMBOL_EXPORT my_plugin
19 std::string name() const;
20 float calculate(float x, float y);
21 int calculate(int, x, int y);
22 static std::size_t size();
23 my_plugin(const std::string & name);
32 std::string space::my_plugin_api::name() const {return _name;}
33 float space::my_plugin::calculate(float x, float y) {return x/y;}
34 int space::my_plugin::calculate(int, x, int y) {return x/y;}
35 std::size_t my_plugin::size() {return sizeof(my_plugin);}
36 space::my_plugin::my_plugin(const std::string & name) : _name(name) {}
37 space::my_plugin::my_plugin() : _name("Empty") {}
38 space::my_plugin::~my_plugin_api() {}
39 int space::my_plugin::value = 42;
42 #endif // BOOST_DLL_MY_PLUGIN_API_HPP