]> git.proxmox.com Git - ceph.git/blame - ceph/src/boost/libs/dll/example/tutorial8/refcounting_plugin.cpp
update sources to v12.2.3
[ceph.git] / ceph / src / boost / libs / dll / example / tutorial8 / refcounting_plugin.cpp
CommitLineData
7c673cae 1// Copyright 2014 Renato Tegon Forti, Antony Polukhin.
b32b8144 2// Copyright 2015-2017 Antony Polukhin.
7c673cae
FG
3//
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)
7
8// MinGW related workaround
9#define BOOST_DLL_FORCE_ALIAS_INSTANTIATION
10
11//[plugcpp_my_plugin_refcounting
12#include "refcounting_plugin.hpp"
13#include <boost/dll/runtime_symbol_info.hpp> // for this_line_location()
14
15namespace my_namespace {
16
17class my_plugin_refcounting : public my_refcounting_api {
18public:
19 // Must be instantiated in plugin
20 boost::filesystem::path location() const {
21 return boost::dll::this_line_location(); // location of this plugin
22 }
23
24 std::string name() const {
25 return "refcounting";
26 }
27
28 // ...
29 //<-
30 // This block is invisible for Quickbook documentation
31 float calculate(float /*x*/, float /*y*/) {
32 return 0;
33 }
34 //->
35};
36
37} // namespace my_namespace
38
39// Factory method. Returns *simple pointer*!
40my_refcounting_api* create() {
41 return new my_namespace::my_plugin_refcounting();
42}
43
44//]
45
46
47