pid-modules  0.3.0

pid-modules provides utility libraries for easier DLL management and plugins systems creation

Quick Examples

The two functional libraries are:

  • dll, a simple library for easy runtime modules management (loading, suing symbol) in a PID environment. Its main purpose is to avoid boring with operating system specific primitives and to automate DLL location resolution.
#include <pid/dll.h> //use the DLL API
pid::DLLLoader dll("my-package","my-module");//load a module
auto func = dll.symbol<void()>("register_pid_plugin_extensions");//use one of its symbols
  • plugins, used to ease the implementation of runtime plugin systems for your applications. Its main purpose is to automate the management of extension points definition and automate extensions binding into an application.
  • Declare an extension point:
    #include <pid/plugins.h>
    class Vehicle{//declare an interface
    virtual bool fly() const = 0;
    PID_EXTENSION_POINT(vehicle::Vehicle, 1, 0)
  • Define a plugin that provides an extension to this extension point:
    #include <pid/plugins.h>
    #include <vehicle.h>
    class Plane : public Vehicle{
    virtual bool fly() const override{
    return true;
    pid_plugins().add_extension<Vehicle,Plane>();//Plane is an extension for Vehicle
  • Use the plugin in an application to contribute to the extension point:
    pid_plugins().load("some_package", "a_plugin");
    auto all_ext = pid_plugins().extensions<Vehicle>();//search for extensions
    for (auto & ext: all_ext) {
    auto v = ext->create();
    v->fly();//polymorphic call from Vehicle static type

The license that applies to the whole package content is CeCILL-C. Please look at the license.txt file at the root of this repository for more details.

About authors

pid-modules has been developed by following authors:

  • Robin Passama (CNRS/LIRMM)

Please contact Robin Passama ( - CNRS/LIRMM for more information or questions.

accessing the list of dependencies of the currrent plugin beging defined
Definition: plugin_definition.h:61
bool add_extension()
define an extension for a given extension point of an application
Definition: manager.h:169
PID_MODULES_PLUGINS_EXPORT pid::plugins::PluginsManager & pid_plugins()
get access to the plugins management system
global header for the plugins library
defining the current plugin contributions
Definition: plugin_definition.h:80
#define PID_EXTENSION_POINT(extension_point_type, major, minor)
declaring an extension point with its current version
Definition: plugin_definition.h:45
bool load(std::string_view package, std::string_view plugin, std::string_view version="")
load a plugin in process memory
std::vector< std::shared_ptr< Extension > > extensions(std::string_view package, std::string_view plugin) const
get all extensions provided by a plugin
global header for the dll library