boost_plugin_loader package from boost_plugin_loader repo


Package Summary

Tags No category tags.
Version 0.2.1
License Apache 2.0
Build type CMAKE

Repository Summary

Checkout URI
VCS Type git
VCS Version main
Last Updated 2022-12-12
CI status No Continuous Integration
Tags No category tags.
Contributing Help Wanted (0)
Good First Issues (0)
Pull Requests to Review (0)

Package Description

Boost plugin loader implementation

Additional Links

No additional links.


  • Levi Armstrong
  • Michael Ripperger


  • Levi Armstrong
  • Michael Ripperger

Boost Plugin Loader

Plugin loading library based on Boost DLL


Platform CI Status
Linux (Focal) Build Status
Windows Build Status
Lint (Clang-Format) Build Status
Lint (CMake-Format) Build Status
Lint (Clang-Tidy) Build Status

Github Issues

license - apache 2.0


The plugin loader must know the names of the libraries in which to search for plugins. These library names should not contain a prefix (i.e., lib/) or suffix (i.e., .so). The library names can be set in two ways: 1. Set the search_libraries member directly in code 1. Add a list of library names to an arbitrary environment variable (separated by colon), and set the search_libraries_env member to the name of that environment variable.

The plugin loader must also know the paths in which to look for the specified libraries that contain plugins. These paths can also be set in three ways: 1. Set the search_system_folders member true. This will allow the plugin loader to look for plugins in directories specified by system environment variables (e.g., LD_LIBRARY_PATH). Generally this is the easiest approach. 1. Set the search_paths member directly in code 1. Add a list of library names to an arbitrary environment variable (separated by colon), and set the search_paths_env member to the name of that environment variable

Defining a plugin base class

At a minimum, there are no requirements on the definition of a base class that can be used with this plugin loader. However, there is one optional requirement for enabling the plugin loader to discover the names of all plugins inheriting a specific base class type. Namely, the plugin base class must have a member function static std::string getSection() which defines a section name for the plugin and is accessible to the PluginLoader and has_getSection classes. The section name is a unique 8-byte string that associates implementations to the base class. The plugin loader method getAvailablePlugins can identify all symbols in a library with this section name and thereby return all implementations of a particular base class. It is also generally useful to define a new export macro for the base class that invokes the EXPORT_CLASS_SECTIONED macro with the section name directly. See the test plugin base class definition for an example.

Declaring plugin implementations

Creating an implementation of a plugin is as simple as inheriting from the plugin base class, and calling the EXPORT_CLASS_SECTIONED macro with the correct section (or calling a custom export macro defined for the plugin base class, described above). See the test plugin implementations for an example.


Changelog for package boost_plugin_loader

0.2.1 (2022-12-09)

  • Improved error messaging (#14)
  • Only catch plugin loader exception
  • Fix issue not using library names returned from getAllLibraryNames
  • Contributors: Levi Armstrong, Michael Ripperger

0.2.0 (2022-06-23)

  • Update package CI
  • Add cassert include to example
  • Update package.xml
  • Updates (#3)
    • Updated example and README
    • Replace pragma once with header guard
    • Remove include of implementation in header
    • Simplify test plugin getSection
  • Contributors: Levi Armstrong, Michael Ripperger

0.1.1 (2022-06-21)

  • Add cpack
  • update windows ci
  • update ubuntu focal CI build
  • add std::enable_if to PluginLoader::getAvailablePlugins()
  • update package.xml
  • Update unit test to have full coverage
  • Add PluginLoaderException class
  • Update parseEnvironmentVariableList documentation
  • Fixed search in system directories for plugins
  • Switch got getSection method
  • Rename getAllAvailablePlugins
  • Port over \@marip8 example
  • Switch SECTION_NAME to section as member variable
  • Add code coverage to ubunut CI build
  • Rename to align with \@marip8 refactor
  • Remove ClassLoader class
  • port macros.h
  • Initial port from tesseract_common
  • Initial commit
  • Contributors: Levi Armstrong

Wiki Tutorials

See ROS Wiki Tutorials for more details.

Source Tutorials

Not currently indexed.

Package Dependencies

System Dependencies

Dependant Packages

No known dependants.

Launch files

No launch files found


No message files found.


No service files found


No plugins found.

Recent questions tagged boost_plugin_loader at