]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/dll/example/tutorial2/my_plugin_aggregator.cpp
4247f89b7bbd367dd453cc99e602d442d35d8e0a
1 // Copyright 2014 Renato Tegon Forti, Antony Polukhin.
2 // Copyright 2015-2019 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)
9 #include <boost/make_shared.hpp>
11 // MinGW related workaround
12 #define BOOST_DLL_FORCE_ALIAS_INSTANTIATION
14 //[plugcpp_my_plugin_aggregator
15 #include <boost/dll/alias.hpp> // for BOOST_DLL_ALIAS
16 #include "../tutorial_common/my_plugin_api.hpp"
18 namespace my_namespace
{
20 class my_plugin_aggregator
: public my_plugin_api
{
22 my_plugin_aggregator() : aggr_(0) {}
25 std::string
name() const {
29 float calculate(float x
, float y
) {
35 static boost::shared_ptr
<my_plugin_aggregator
> create() {
36 return boost::shared_ptr
<my_plugin_aggregator
>(
37 new my_plugin_aggregator()
44 my_namespace::my_plugin_aggregator::create
, // <-- this function is exported with...
45 create_plugin
// <-- ...this alias name
48 } // namespace my_namespace