Boost logo

Boost :

Subject: Re: [boost] Checking interest in DynamicLoad/DLL/DSO/Plugin library
From: Hartmut Kaiser (hartmut.kaiser_at_[hidden])
Date: 2014-08-15 19:39:19


> There is a basic implementation of a header only Plugin library:
> https://github.com/apolukhin/Boost.Plugin
>
> Documentation with examples could be found here:
> http://apolukhin.github.io/Boost.Plugin/index.html
>
> Is there an interest in such library in Boost community?
> What features are missing in the library?
>
> Looking forward to hearing from you. Any feedback is more than welcomed.

Caveat: I might have missed part or all of this in your docs and any/all of
those things might be already available.

>From our experience a plugin library should additionally to your design
support:

- arbitrary constructor arguments to the plugin object created:

    typedef boost::shared_ptr<my_plugin_api> (pluginapi_create_t)();
    boost::function<pluginapi_create_t> creator =
        boost::plugin::shared_function_alias<pluginapi_create_t>(
            shared_library_path, "create_plugin");

    boost::shared_ptr<my_plugin_api> plugin = creator(42, "foo", 3.14);

- the ability to extract the full file system path of a loaded shared
library (this is not always the same as the file name you specified to load
the library)
- the ability to extract a list of plugin object names from a given shared
library ( I assume that your library allows to have several plugin types in
the same shared library)
- support for binding/instantiating plugin objects even if the plugin is
linked as a static library (some HPC systems do not support dynamic/shared
libraries and this functionality allows to keep the code which using the
plugins unchanged)
- it is important that the pointer to the plugin object keeps the shared
library loaded

All of this is functionality we ended up implementing in HPX's plugin system
(see here:
https://github.com/STEllAR-GROUP/hpx/tree/master/hpx/util/plugin).

Regards Hartmut
---------------
http://boost-spirit.com
http://stellar.cct.lsu.edu


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk