• Home
  • Raw
  • Download

Lines Matching full:plugin

16 [section Plugin basics]
18 The first thing to do when creating your own plugins is define the plugin interface. There is an ex…
19 of an abstract class that will be our plugin API:
24 Now let's make a DLL/DSO library that will holds implementation of plugin interface and exports it …
30 Simple application that loads plugin using the [funcref boost::dll::import]
39 Loading the plugin
41 plugin->calculate(1.5, 1.5) call: 3
57 [section Factory method in plugin]
59 In previous example we were importing from a plugin a single variable. Let's make a class
60 that uses our plugin API plugin and holds some state:
76 dereference the `plugin` variable will lead to *undefined behavior*. ]
81 plugin->calculate(1.5, 1.5) call: 3
82 plugin->calculate(1.5, 1.5) second call: 6
83 Plugin Name: aggregator
106 Loading plugin: "/test/libmy_plugin_aggregator.so"
107 Matching plugin name: aggregator
108 Loading plugin: "/test/libmy_plugin_sum.so"
124 [section Linking plugin into the executable]
126 Linking plugin into the executable has the advantages of
130 * faster plugin load
132 Let's start from creating a linkable in plugin. Such plugin will have a header,
133 common for plugin library itself and for the executable:
138 Main trick here is the alias definition. When linking plugin into the executable, the alias *must*
140 away our plugin.
142 Here's how the implementation of the plugin looks like:
148 we'll be able to import symbols from plugin:
153 [note Flag '-rdynamic' must be used when linking the plugin into the executable on Linux OS.
165 [note If we want to make a traditional plugin that is located in a separate shared library, all we …
166 remove the `#include "static_plugin.hpp"` line and replace `dll::program_location()` with plugin lo…
179 Let's make an executable, link a plugin into it and attempt to load all the existing plugins:
201 the `create_plugin` function from other plugin. Dynamic linker thought that `create_plugin`
267 Situation when we do not know names of functions in plugin could occur. In that case querying libra…
273 Solution would be pretty simple. Let's agree with plugin developers, that they can name functions a…
274 but all the plugin functions aliases must be located in section named 'Anna':
321 In this example we'll be importing function that constructs an instance of plugin and binding that
324 First of all we need to define a new plugin api:
331 Now let's define the plugin:
340 This plugin does not differ much from our previous examples except the additional method that calls
347 In `bind` method we call `plugin->location()`. This call results in a call to
348 [funcref boost::dll::this_line_location] and returns the plugin location. Then a `shared_ptr` that …
353 …instead of `my_refcounting_api*` in production code to avoid memory leaks when `plugin->location()`
356 That's it, now we can get instance of a plugin:
365 [[][Runtime plugin load][Plugin was linked in]]
368 [[pre Plugin name: refcounting,
370 [[pre Plugin name: refcounting,