Repository Summary
| Checkout URI | https://github.com/ros/class_loader.git |
| VCS Type | git |
| VCS Version | humble |
| Last Updated | 2022-01-14 |
| Dev Status | MAINTAINED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| class_loader | 2.2.0 |
README
class_loader
The class_loader package is a ROS-independent package for loading plugins during runtime and the foundation of the higher level ROS pluginlib library. class_loader utilizes the host operating system’s runtime loader to open runtime libraries (e.g. .so/.dll/dylib files), introspect the library for exported plugin classes, and allows users to instantiate objects of said exported classes without the explicit declaration (i.e. header file) for those classes.
class_loader VS pluginlib
class_loader is used in the implementation of the higher-level ROS package pluginlib which is the encouraged method for loading plugins in the ROS ecosystem. You should use class_loader when creating plugins intended for non-ROS packages and pluginlib when exporting plugins to ROS packages.
Quality Declaration
This package claims to be in the Quality Level 1 category, see the Quality Declaration for more details.
Usage
The interface is provided through two classes, class_loader::ClassLoader and class_loader::MultiLibraryClassLoader. Both provide similar interfaces but the former only binds to a single runtime library whereas the latter can associate with multiple libraries. The typical workflow is as follows:
- Include
class_loader/class_loader.hin your source code - Instantiate a
class_loader::ClassLoaderobject passing the path and name of the library to open
class_loader::ClassLoader loader("libMyLibrary.so");
- Query the class for exported classes which have an interface defined by some base class (MyBase in the example)
std::vector<std::string> classes = loader.getAvailableClasses<MyBase>()
- Create/destroy objects of said exported classes
for(unsigned int c = 0; c < classes.size(); ++c)
{
boost::shared_ptr<MyBase> plugin = loader.createInstance<MyBase>(classes[c]);
plugin->someMethod();
//'plugin' will automatically be deleted when it goes out of scope
}
- Destroy the ClassLoader object to shutdown the library.
Example: Basic Workflow for ClassLoader
#include <class_loader/class_loader.h>
#include "MyBase.h" //Defines class MyBase
int main()
{
class_loader::ClassLoader loader("libMyLibrary.so");
std::vector<std::string> classes = loader.getAvailableClasses<MyBase>();
for(unsigned int c = 0; c < classes.size(); ++c)
{
boost::shared_ptr<MyBase> plugin = loader.createInstance<MyBase>(classes[c]);
plugin->someMethod();
}
}
Visit the class_loader API documentation for a complete list of its main components.
CONTRIBUTING
Any contribution that you make to this repository will be under the BSD-3-Clause.
Contributors must sign-off each commit by adding a Signed-off-by: ...
line to commit messages to certify that they have the right to submit
the code they are contributing to the project according to the
Developer Certificate of Origin (DCO).
Repository Summary
| Checkout URI | https://github.com/ros/class_loader.git |
| VCS Type | git |
| VCS Version | jazzy |
| Last Updated | 2026-06-02 |
| Dev Status | MAINTAINED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| class_loader | 2.7.1 |
README
class_loader
The class_loader package is a ROS-independent package for loading plugins during runtime and the foundation of the higher level ROS pluginlib library. class_loader utilizes the host operating system’s runtime loader to open runtime libraries (e.g. .so/.dll/dylib files), introspect the library for exported plugin classes, and allows users to instantiate objects of said exported classes without the explicit declaration (i.e. header file) for those classes.
class_loader VS pluginlib
class_loader is used in the implementation of the higher-level ROS package pluginlib which is the encouraged method for loading plugins in the ROS ecosystem. You should use class_loader when creating plugins intended for non-ROS packages and pluginlib when exporting plugins to ROS packages.
Quality Declaration
This package claims to be in the Quality Level 1 category, see the Quality Declaration for more details.
Usage
The interface is provided through two classes, class_loader::ClassLoader and class_loader::MultiLibraryClassLoader. Both provide similar interfaces but the former only binds to a single runtime library whereas the latter can associate with multiple libraries. The typical workflow is as follows:
- Include
class_loader/class_loader.hin your source code - Instantiate a
class_loader::ClassLoaderobject passing the path and name of the library to open
class_loader::ClassLoader loader("libMyLibrary.so");
- Query the class for exported classes which have an interface defined by some base class (MyBase in the example)
std::vector<std::string> classes = loader.getAvailableClasses<MyBase>()
- Create/destroy objects of said exported classes
for(unsigned int c = 0; c < classes.size(); ++c)
{
boost::shared_ptr<MyBase> plugin = loader.createInstance<MyBase>(classes[c]);
plugin->someMethod();
//'plugin' will automatically be deleted when it goes out of scope
}
- Destroy the ClassLoader object to shutdown the library.
Example: Basic Workflow for ClassLoader
#include <class_loader/class_loader.h>
#include "MyBase.h" //Defines class MyBase
int main()
{
class_loader::ClassLoader loader("libMyLibrary.so");
std::vector<std::string> classes = loader.getAvailableClasses<MyBase>();
for(unsigned int c = 0; c < classes.size(); ++c)
{
boost::shared_ptr<MyBase> plugin = loader.createInstance<MyBase>(classes[c]);
plugin->someMethod();
}
}
Visit the class_loader API documentation for a complete list of its main components.
CONTRIBUTING
Any contribution that you make to this repository will be under the BSD-3-Clause.
Contributors must sign-off each commit by adding a Signed-off-by: ...
line to commit messages to certify that they have the right to submit
the code they are contributing to the project according to the
Developer Certificate of Origin (DCO).
Repository Summary
| Checkout URI | https://github.com/ros/class_loader.git |
| VCS Type | git |
| VCS Version | kilted |
| Last Updated | 2025-10-17 |
| Dev Status | MAINTAINED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| class_loader | 2.8.1 |
README
class_loader
The class_loader package is a ROS-independent package for loading plugins during runtime and the foundation of the higher level ROS pluginlib library. class_loader utilizes the host operating system’s runtime loader to open runtime libraries (e.g. .so/.dll/dylib files), introspect the library for exported plugin classes, and allows users to instantiate objects of said exported classes without the explicit declaration (i.e. header file) for those classes.
class_loader VS pluginlib
class_loader is used in the implementation of the higher-level ROS package pluginlib which is the encouraged method for loading plugins in the ROS ecosystem. You should use class_loader when creating plugins intended for non-ROS packages and pluginlib when exporting plugins to ROS packages.
Quality Declaration
This package claims to be in the Quality Level 1 category, see the Quality Declaration for more details.
Usage
The interface is provided through two classes, class_loader::ClassLoader and class_loader::MultiLibraryClassLoader. Both provide similar interfaces but the former only binds to a single runtime library whereas the latter can associate with multiple libraries. The typical workflow is as follows:
- Include
class_loader/class_loader.hin your source code - Instantiate a
class_loader::ClassLoaderobject passing the path and name of the library to open
class_loader::ClassLoader loader("libMyLibrary.so");
- Query the class for exported classes which have an interface defined by some base class (MyBase in the example)
std::vector<std::string> classes = loader.getAvailableClasses<MyBase>()
- Create/destroy objects of said exported classes
for(unsigned int c = 0; c < classes.size(); ++c)
{
boost::shared_ptr<MyBase> plugin = loader.createInstance<MyBase>(classes[c]);
plugin->someMethod();
//'plugin' will automatically be deleted when it goes out of scope
}
- Destroy the ClassLoader object to shutdown the library.
Example: Basic Workflow for ClassLoader
#include <class_loader/class_loader.h>
#include "MyBase.h" //Defines class MyBase
int main()
{
class_loader::ClassLoader loader("libMyLibrary.so");
std::vector<std::string> classes = loader.getAvailableClasses<MyBase>();
for(unsigned int c = 0; c < classes.size(); ++c)
{
boost::shared_ptr<MyBase> plugin = loader.createInstance<MyBase>(classes[c]);
plugin->someMethod();
}
}
Visit the class_loader API documentation for a complete list of its main components.
CONTRIBUTING
Any contribution that you make to this repository will be under the BSD-3-Clause.
Contributors must sign-off each commit by adding a Signed-off-by: ...
line to commit messages to certify that they have the right to submit
the code they are contributing to the project according to the
Developer Certificate of Origin (DCO).
Repository Summary
| Checkout URI | https://github.com/ros/class_loader.git |
| VCS Type | git |
| VCS Version | lyrical |
| Last Updated | 2026-11-03 |
| Dev Status | MAINTAINED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| class_loader | 2.9.4 |
README
class_loader
The class_loader package is a ROS-independent package for loading plugins during runtime and the foundation of the higher level ROS pluginlib library. class_loader utilizes the host operating system’s runtime loader to open runtime libraries (e.g. .so/.dll/dylib files), introspect the library for exported plugin classes, and allows users to instantiate objects of said exported classes without the explicit declaration (i.e. header file) for those classes.
class_loader VS pluginlib
class_loader is used in the implementation of the higher-level ROS package pluginlib which is the encouraged method for loading plugins in the ROS ecosystem. You should use class_loader when creating plugins intended for non-ROS packages and pluginlib when exporting plugins to ROS packages.
Quality Declaration
This package claims to be in the Quality Level 1 category, see the Quality Declaration for more details.
Usage
The interface is provided through two classes, class_loader::ClassLoader and class_loader::MultiLibraryClassLoader. Both provide similar interfaces but the former only binds to a single runtime library whereas the latter can associate with multiple libraries. The typical workflow is as follows:
- Include
class_loader/class_loader.hin your source code - Instantiate a
class_loader::ClassLoaderobject passing the path and name of the library to open
class_loader::ClassLoader loader("libMyLibrary.so");
- Query the class for exported classes which have an interface defined by some base class (MyBase in the example)
std::vector<std::string> classes = loader.getAvailableClasses<MyBase>()
- Create/destroy objects of said exported classes
for(unsigned int c = 0; c < classes.size(); ++c)
{
boost::shared_ptr<MyBase> plugin = loader.createInstance<MyBase>(classes[c]);
plugin->someMethod();
//'plugin' will automatically be deleted when it goes out of scope
}
- Destroy the ClassLoader object to shutdown the library.
Example: Basic Workflow for ClassLoader
#include <class_loader/class_loader.h>
#include "MyBase.h" //Defines class MyBase
int main()
{
class_loader::ClassLoader loader("libMyLibrary.so");
std::vector<std::string> classes = loader.getAvailableClasses<MyBase>();
for(unsigned int c = 0; c < classes.size(); ++c)
{
boost::shared_ptr<MyBase> plugin = loader.createInstance<MyBase>(classes[c]);
plugin->someMethod();
}
}
Visit the class_loader API documentation for a complete list of its main components.
CONTRIBUTING
Any contribution that you make to this repository will be under the BSD-3-Clause.
Contributors must sign-off each commit by adding a Signed-off-by: ...
line to commit messages to certify that they have the right to submit
the code they are contributing to the project according to the
Developer Certificate of Origin (DCO).
Repository Summary
| Checkout URI | https://github.com/ros/class_loader.git |
| VCS Type | git |
| VCS Version | rolling |
| Last Updated | 2026-11-28 |
| Dev Status | MAINTAINED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| class_loader | 3.0.3 |
README
class_loader
The class_loader package is a ROS-independent package for loading plugins during runtime and the foundation of the higher level ROS pluginlib library. class_loader utilizes the host operating system’s runtime loader to open runtime libraries (e.g. .so/.dll/dylib files), introspect the library for exported plugin classes, and allows users to instantiate objects of said exported classes without the explicit declaration (i.e. header file) for those classes.
class_loader VS pluginlib
class_loader is used in the implementation of the higher-level ROS package pluginlib which is the encouraged method for loading plugins in the ROS ecosystem. You should use class_loader when creating plugins intended for non-ROS packages and pluginlib when exporting plugins to ROS packages.
Quality Declaration
This package claims to be in the Quality Level 1 category, see the Quality Declaration for more details.
Usage
The interface is provided through two classes, class_loader::ClassLoader and class_loader::MultiLibraryClassLoader. Both provide similar interfaces but the former only binds to a single runtime library whereas the latter can associate with multiple libraries. The typical workflow is as follows:
- Include
class_loader/class_loader.hppin your source code - Instantiate a
class_loader::ClassLoaderobject passing the path and name of the library to open
class_loader::ClassLoader loader("libMyLibrary.so");
- Query the class for exported classes which have an interface defined by some base class (MyBase in the example)
std::vector<std::string> classes = loader.getAvailableClasses<MyBase>()
- Create/destroy objects of said exported classes
for(unsigned int c = 0; c < classes.size(); ++c)
{
std::shared_ptr<MyBase> plugin = loader.createInstance<MyBase>(classes[c]);
plugin->someMethod();
//'plugin' will automatically be deleted when it goes out of scope
}
- Destroy the ClassLoader object to shutdown the library.
Example: Basic Workflow for ClassLoader
#include <class_loader/class_loader.hpp>
#include "MyBase.h" //Defines class MyBase
int main()
{
class_loader::ClassLoader loader("libMyLibrary.so");
std::vector<std::string> classes = loader.getAvailableClasses<MyBase>();
for(unsigned int c = 0; c < classes.size(); ++c)
{
std::shared_ptr<MyBase> plugin = loader.createInstance<MyBase>(classes[c]);
plugin->someMethod();
}
}
Visit the class_loader API documentation for a complete list of its main components.
Building without ROS
class_loader can also be built and used without ament and other ROS packages; only console_bridge is required (and GoogleTest for the tests). For example, with plain CMake:
cmake -S . -B build -DCLASS_LOADER_IGNORE_AMENT=ON
cmake --build build
cmake --install build
The following CMake options control this:
-
CLASS_LOADER_IGNORE_AMENT(default:OFF): Build without ament. Instead of the ament package, a CMake package configuration (find_package(class_loader), providing the targetclass_loader::class_loader) and a pkg-config file (class_loader.pc) are installed. WithBUILD_TESTING=ON, the tests use GoogleTest from the system. -
CLASS_LOADER_USE_RCPPUTILS(default:ON, orOFFifCLASS_LOADER_IGNORE_AMENTisON): Load libraries withrcpputils::SharedLibrary. IfOFF, a minimal built-in replacement is used, and rcpputils (and rcutils) are not required.
With CLASS_LOADER_USE_RCPPUTILS=OFF, the preprocessor symbol CLASS_LOADER_NO_RCPPUTILS is defined publicly, i.e., for class_loader and for all its users (via the CMake target and the pkg-config file), because it changes types used in the public headers. All code using class_loader must be compiled with the same setting as class_loader itself; anything else violates the one definition rule (ODR).
The public headers require C++20. The CMake target provides this requirement, users of the pkg-config file need to enable C++20 themselves. The pkg-config file does not provide the flags for rcpputils, so with CLASS_LOADER_USE_RCPPUTILS=ON (and without ament), use the CMake package configuration.
CONTRIBUTING
Any contribution that you make to this repository will be under the BSD-3-Clause.
Contributors must sign-off each commit by adding a Signed-off-by: ...
line to commit messages to certify that they have the right to submit
the code they are contributing to the project according to the
Developer Certificate of Origin (DCO).
Repository Summary
| Checkout URI | https://github.com/ros/class_loader.git |
| VCS Type | git |
| VCS Version | ardent |
| Last Updated | 2018-10-19 |
| Dev Status | MAINTAINED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| class_loader | 1.0.0 |
README
CONTRIBUTING
Repository Summary
| Checkout URI | https://github.com/ros/class_loader.git |
| VCS Type | git |
| VCS Version | bouncy |
| Last Updated | 2018-10-19 |
| Dev Status | MAINTAINED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| class_loader | 1.1.0 |
README
CONTRIBUTING
Repository Summary
| Checkout URI | https://github.com/ros/class_loader.git |
| VCS Type | git |
| VCS Version | crystal |
| Last Updated | 2018-11-16 |
| Dev Status | MAINTAINED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| class_loader | 1.2.0 |
README
CONTRIBUTING
Repository Summary
| Checkout URI | https://github.com/ros/class_loader.git |
| VCS Type | git |
| VCS Version | eloquent |
| Last Updated | 2020-01-17 |
| Dev Status | MAINTAINED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| class_loader | 1.4.1 |
README
CONTRIBUTING
Repository Summary
| Checkout URI | https://github.com/ros/class_loader.git |
| VCS Type | git |
| VCS Version | dashing |
| Last Updated | 2020-03-13 |
| Dev Status | MAINTAINED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| class_loader | 1.3.3 |
README
CONTRIBUTING
Repository Summary
| Checkout URI | https://github.com/ros/class_loader.git |
| VCS Type | git |
| VCS Version | galactic |
| Last Updated | 2021-04-12 |
| Dev Status | MAINTAINED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| class_loader | 2.1.2 |
README
class_loader
The class_loader package is a ROS-independent package for loading plugins during runtime and the foundation of the higher level ROS pluginlib library. class_loader utilizes the host operating system’s runtime loader to open runtime libraries (e.g. .so/.dll/dylib files), introspect the library for exported plugin classes, and allows users to instantiate objects of said exported classes without the explicit declaration (i.e. header file) for those classes.
class_loader VS pluginlib
class_loader is used in the implementation of the higher-level ROS package pluginlib which is the encouraged method for loading plugins in the ROS ecosystem. You should use class_loader when creating plugins intended for non-ROS packages and pluginlib when exporting plugins to ROS packages.
Quality Declaration
This package claims to be in the Quality Level 1 category, see the Quality Declaration for more details.
Usage
The interface is provided through two classes, class_loader::ClassLoader and class_loader::MultiLibraryClassLoader. Both provide similar interfaces but the former only binds to a single runtime library whereas the latter can associate with multiple libraries. The typical workflow is as follows:
- Include
class_loader/class_loader.hin your source code - Instantiate a
class_loader::ClassLoaderobject passing the path and name of the library to open
class_loader::ClassLoader loader("libMyLibrary.so");
- Query the class for exported classes which have an interface defined by some base class (MyBase in the example)
std::vector<std::string> classes = loader.getAvailableClasses<MyBase>()
- Create/destroy objects of said exported classes
for(unsigned int c = 0; c < classes.size(); ++c)
{
boost::shared_ptr<MyBase> plugin = loader.createInstance<MyBase>(classes[c]);
plugin->someMethod();
//'plugin' will automatically be deleted when it goes out of scope
}
- Destroy the ClassLoader object to shutdown the library.
Example: Basic Workflow for ClassLoader
#include <class_loader/class_loader.h>
#include "MyBase.h" //Defines class MyBase
int main()
{
class_loader::ClassLoader loader("libMyLibrary.so");
std::vector<std::string> classes = loader.getAvailableClasses<MyBase>();
for(unsigned int c = 0; c < classes.size(); ++c)
{
boost::shared_ptr<MyBase> plugin = loader.createInstance<MyBase>(classes[c]);
plugin->someMethod();
}
}
Visit the class_loader API documentation for a complete list of its main components.
CONTRIBUTING
Any contribution that you make to this repository will be under the BSD-3-Clause.
Contributors must sign-off each commit by adding a Signed-off-by: ...
line to commit messages to certify that they have the right to submit
the code they are contributing to the project according to the
Developer Certificate of Origin (DCO).
Repository Summary
| Checkout URI | https://github.com/ros/class_loader.git |
| VCS Type | git |
| VCS Version | foxy |
| Last Updated | 2022-07-22 |
| Dev Status | MAINTAINED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| class_loader | 2.0.3 |
README
class_loader
The class_loader package is a ROS-independent package for loading plugins during runtime and the foundation of the higher level ROS pluginlib library. class_loader utilizes the host operating system’s runtime loader to open runtime libraries (e.g. .so/.dll/dylib files), introspect the library for exported plugin classes, and allows users to instantiate objects of said exported classes without the explicit declaration (i.e. header file) for those classes.
class_loader VS pluginlib
class_loader is used in the implementation of the higher-level ROS package pluginlib which is the encouraged method for loading plugins in the ROS ecosystem. You should use class_loader when creating plugins intended for non-ROS packages and pluginlib when exporting plugins to ROS packages.
Quality Declaration
This package claims to be in the Quality Level 1 category, see the Quality Declaration for more details.
Usage
The interface is provided through two classes, class_loader::ClassLoader and class_loader::MultiLibraryClassLoader. Both provide similar interfaces but the former only binds to a single runtime library whereas the latter can associate with multiple libraries. The typical workflow is as follows:
- Include
class_loader/class_loader.hin your source code - Instantiate a
class_loader::ClassLoaderobject passing the path and name of the library to open
class_loader::ClassLoader loader("libMyLibrary.so");
- Query the class for exported classes which have an interface defined by some base class (MyBase in the example)
std::vector<std::string> classes = loader.getAvailableClasses<MyBase>()
- Create/destroy objects of said exported classes
for(unsigned int c = 0; c < classes.size(); ++c)
{
boost::shared_ptr<MyBase> plugin = loader.createInstance<MyBase>(classes[c]);
plugin->someMethod();
//'plugin' will automatically be deleted when it goes out of scope
}
- Destroy the ClassLoader object to shutdown the library.
Example: Basic Workflow for ClassLoader
#include <class_loader/class_loader.h>
#include "MyBase.h" //Defines class MyBase
int main()
{
class_loader::ClassLoader loader("libMyLibrary.so");
std::vector<std::string> classes = loader.getAvailableClasses<MyBase>();
for(unsigned int c = 0; c < classes.size(); ++c)
{
boost::shared_ptr<MyBase> plugin = loader.createInstance<MyBase>(classes[c]);
plugin->someMethod();
}
}
Visit the class_loader API documentation for a complete list of its main components.
CONTRIBUTING
Any contribution that you make to this repository will be under the BSD-3-Clause.
Contributors must sign-off each commit by adding a Signed-off-by: ...
line to commit messages to certify that they have the right to submit
the code they are contributing to the project according to the
Developer Certificate of Origin (DCO).
Repository Summary
| Checkout URI | https://github.com/ros/class_loader.git |
| VCS Type | git |
| VCS Version | iron |
| Last Updated | 2023-02-13 |
| Dev Status | MAINTAINED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| class_loader | 2.5.0 |
README
class_loader
The class_loader package is a ROS-independent package for loading plugins during runtime and the foundation of the higher level ROS pluginlib library. class_loader utilizes the host operating system’s runtime loader to open runtime libraries (e.g. .so/.dll/dylib files), introspect the library for exported plugin classes, and allows users to instantiate objects of said exported classes without the explicit declaration (i.e. header file) for those classes.
class_loader VS pluginlib
class_loader is used in the implementation of the higher-level ROS package pluginlib which is the encouraged method for loading plugins in the ROS ecosystem. You should use class_loader when creating plugins intended for non-ROS packages and pluginlib when exporting plugins to ROS packages.
Quality Declaration
This package claims to be in the Quality Level 1 category, see the Quality Declaration for more details.
Usage
The interface is provided through two classes, class_loader::ClassLoader and class_loader::MultiLibraryClassLoader. Both provide similar interfaces but the former only binds to a single runtime library whereas the latter can associate with multiple libraries. The typical workflow is as follows:
- Include
class_loader/class_loader.hin your source code - Instantiate a
class_loader::ClassLoaderobject passing the path and name of the library to open
class_loader::ClassLoader loader("libMyLibrary.so");
- Query the class for exported classes which have an interface defined by some base class (MyBase in the example)
std::vector<std::string> classes = loader.getAvailableClasses<MyBase>()
- Create/destroy objects of said exported classes
for(unsigned int c = 0; c < classes.size(); ++c)
{
boost::shared_ptr<MyBase> plugin = loader.createInstance<MyBase>(classes[c]);
plugin->someMethod();
//'plugin' will automatically be deleted when it goes out of scope
}
- Destroy the ClassLoader object to shutdown the library.
Example: Basic Workflow for ClassLoader
#include <class_loader/class_loader.h>
#include "MyBase.h" //Defines class MyBase
int main()
{
class_loader::ClassLoader loader("libMyLibrary.so");
std::vector<std::string> classes = loader.getAvailableClasses<MyBase>();
for(unsigned int c = 0; c < classes.size(); ++c)
{
boost::shared_ptr<MyBase> plugin = loader.createInstance<MyBase>(classes[c]);
plugin->someMethod();
}
}
Visit the class_loader API documentation for a complete list of its main components.
CONTRIBUTING
Any contribution that you make to this repository will be under the BSD-3-Clause.
Contributors must sign-off each commit by adding a Signed-off-by: ...
line to commit messages to certify that they have the right to submit
the code they are contributing to the project according to the
Developer Certificate of Origin (DCO).
Repository Summary
| Checkout URI | https://github.com/ros/class_loader.git |
| VCS Type | git |
| VCS Version | indigo-devel |
| Last Updated | 2018-10-19 |
| Dev Status | MAINTAINED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| class_loader | 0.3.9 |
README
CONTRIBUTING
Repository Summary
| Checkout URI | https://github.com/ros/class_loader.git |
| VCS Type | git |
| VCS Version | indigo-devel |
| Last Updated | 2018-10-19 |
| Dev Status | MAINTAINED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| class_loader | 0.3.9 |
README
CONTRIBUTING
Repository Summary
| Checkout URI | https://github.com/ros/class_loader.git |
| VCS Type | git |
| VCS Version | indigo-devel |
| Last Updated | 2018-10-19 |
| Dev Status | MAINTAINED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| class_loader | 0.3.9 |
README
CONTRIBUTING
Repository Summary
| Checkout URI | https://github.com/ros/class_loader.git |
| VCS Type | git |
| VCS Version | hydro-devel |
| Last Updated | 2014-12-22 |
| Dev Status | MAINTAINED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| class_loader | 0.2.5 |
README
CONTRIBUTING
Repository Summary
| Checkout URI | https://github.com/ros/class_loader.git |
| VCS Type | git |
| VCS Version | indigo-devel |
| Last Updated | 2018-10-19 |
| Dev Status | MAINTAINED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| class_loader | 0.3.9 |
README
CONTRIBUTING
Repository Summary
| Checkout URI | https://github.com/ros/class_loader.git |
| VCS Type | git |
| VCS Version | melodic-devel |
| Last Updated | 2021-12-07 |
| Dev Status | MAINTAINED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| class_loader | 0.4.2 |
README
CONTRIBUTING
Repository Summary
| Checkout URI | https://github.com/ros/class_loader.git |
| VCS Type | git |
| VCS Version | noetic-devel |
| Last Updated | 2025-04-25 |
| Dev Status | MAINTAINED |
| Released | RELEASED |
| Contributing |
Help Wanted (-)
Good First Issues (-) Pull Requests to Review (-) |
Packages
| Name | Version |
|---|---|
| class_loader | 0.5.2 |