1 // Copyright 2014 Renato Tegon Forti, Antony Polukhin. 2 // Copyright 2015-2019 Antony Polukhin. 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 15 namespace my_namespace { 16 17 class my_plugin_refcounting : public my_refcounting_api { 18 public: 19 // Must be instantiated in plugin location() const20 boost::dll::fs::path location() const { 21 return boost::dll::this_line_location(); // location of this plugin 22 } 23 name() const24 std::string name() const { 25 return "refcounting"; 26 } 27 28 // ... 29 //<- 30 // This block is invisible for Quickbook documentation calculate(float,float)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*! create()40my_refcounting_api* create() { 41 return new my_namespace::my_plugin_refcounting(); 42 } 43 44 //] 45 46 47 48