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 (pluginapi_create_t)();
boost::function creator =
boost::plugin::shared_function_alias(
shared_library_path, "create_plugin");
boost::shared_ptr 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