AutoAPMS
Resilient Robot Mission Management
Loading...
Searching...
No Matches
PluginClassLoader< BaseT > Class Template Reference

Class for loading plugin resources registered according to the conventions defined by the pluginlib package. More...

#include <auto_apms_util/resource.hpp>

Public Member Functions

 PluginClassLoader (const std::string &base_package, const std::string &base_class, const std::set< std::string > &exclude_packages={})
 Standard PluginClassLoader constructor.
 

Static Public Member Functions

static PluginClassLoader makeUnambiguousPluginClassLoader (const std::string &base_package, const std::string &base_class, const std::set< std::string > &exclude_packages={}, const std::map< std::string, std::string > &reserved_names={})
 Parse all associated plugin manifest files registered with the ament resource index and instantiate a PluginClassLoader.
 

Detailed Description

template<typename BaseT>
class auto_apms_util::PluginClassLoader< BaseT >

Class for loading plugin resources registered according to the conventions defined by the pluginlib package.

Template Parameters
BaseTBase class of the plugin.

Definition at line 96 of file resource.hpp.

Constructor & Destructor Documentation

◆ PluginClassLoader()

template<typename BaseT>
PluginClassLoader ( const std::string & base_package,
const std::string & base_class,
const std::set< std::string > & exclude_packages = {} )
inline

Standard PluginClassLoader constructor.

Alternatively, if you want to verify that only unique class names are loaded, have a look at PluginClassLoader::makeUnambiguousPluginClassLoader.

Parameters
base_packageName of the package containing the base_class. Will throw an error if it is not installed.
base_classFully qualified name of the base class that the class loader will use for determining which classes listed in a plugins.xml file are associated with this instance.
exclude_packagesPackages to exclude when searching for plugins.
Exceptions
ament_index_cpp::PackageNotFoundErrorif base_package is not installed.
auto_apms_util::exceptions::ResourceErrorif no plugins of type base_class were found.

Definition at line 153 of file resource.hpp.

Member Function Documentation

◆ makeUnambiguousPluginClassLoader()

template<typename BaseT>
PluginClassLoader< BaseT > makeUnambiguousPluginClassLoader ( const std::string & base_package,
const std::string & base_class,
const std::set< std::string > & exclude_packages = {},
const std::map< std::string, std::string > & reserved_names = {} )
inlinestatic

Parse all associated plugin manifest files registered with the ament resource index and instantiate a PluginClassLoader.

This factory method additionally performs an ambiguity check. This means that it verifies that only unique class names are being registered by the searched packages. Using the standard constructor, previously registered classes are being overriden if the same class name is being parsed again. Therefore, this method offers the preferred way of instantiating a PluginClassLoader.

Template Parameters
LoaderTType of the plugin class loader.
Parameters
base_packageName of the package containing the base_class. Will throw an error if it is not installed.
base_classFully qualified name of the base class that the class loader will use for determining which classes listed in a plugins.xml file are associated with this instance.
exclude_packagesPackages to exclude when searching for plugins.
reserved_namesMap of reserved class names and the package name that makes the reservation. If any of these class names are found, an error is being raised (Used internally during build time when installed resources aren't availabel yet).
Exceptions
ament_index_cpp::PackageNotFoundErrorif base_package is not installed.
auto_apms_util::exceptions::ResourceErrorif no plugins of type base_class were found.
auto_apms_util::exceptions::ResourceErrorif multiple packages register a resource using the same class name (or a name in reserved_names is found).

Definition at line 160 of file resource.hpp.


The documentation for this class was generated from the following file: