#include <plugin_loader.h>
Public Member Functions | |||
Plugin::Ptr | createPluginInstance (const std::string &lookup_name) override | ||
Creates an instance of a plugin which is derived from vigir_pluginlib::Plugin base class (which implicitly calls loadLibraryForClass() to increment the library counter). Deleting the instance and calling unloadLibraryForClass() is automatically handled by the shared pointer. | |||
std::string | getBaseClassType () const override | ||
Given the lookup name of a class, returns the type of the associated base class. | |||
std::string | getClassDescription (const std::string &lookup_name) override | ||
Given the lookup name of a class, returns its description. | |||
std::string | getClassLibraryPath (const std::string &lookup_name) override | ||
Given the name of a class, returns the path to its associated library. | |||
std::string | getClassPackage (const std::string &lookup_name) override | ||
Given the name of a class, returns name of the containing package. | |||
std::string | getClassType (const std::string &lookup_name) override | ||
Given the lookup name of a class, returns the type of the derived class associated with it. | |||
std::vector< std::string > | getDeclaredClasses () override | ||
Returns a list of all available classes for this ClassLoader's base class type. | |||
std::string | getName (const std::string &lookup_name) override | ||
Strips the package name off of a lookup name. | |||
std::string | getPluginManifestPath (const std::string &lookup_name) override | ||
Given the name of a class, returns the path of the associated plugin manifest. | |||
std::vector< std::string > | getPluginXmlPaths () override | ||
Returns a list of all available plugin manifest paths for this ClassLoader's base class type. | |||
std::vector< std::string > | getRegisteredLibraries () override | ||
Returns the libraries that are registered and can be loaded. | |||
bool | isClassAvailable (const std::string &lookup_name) override | ||
Checks if the class associated with a plugin name is available to be loaded. | |||
bool | isClassLoaded (const std::string &lookup_name) override | ||
Checks if a given class is currently loaded. | |||
void | loadLibraryForClass (const std::string &lookup_name) override | ||
Attempts to load a class with a given name. | |||
PluginLoader (const std::string &package, const std::string &base_class, const std::string &attrib_name=std::string("plugin"), const std::vector< std::string > &plugin_xml_paths=std::vector< std::string >()) | |||
Constructor for a ClassLoader. | |||
void | refreshDeclaredClasses () override | ||
Refreshs the list of all available classes for this ClassLoader's base class type
| |||
int | unloadLibraryForClass (const std::string &lookup_name) override | ||
Attempts to unload a class with a given name. |
Definition at line 45 of file plugin_loader.h.
vigir_pluginlib::PluginLoader< T >::PluginLoader | ( | const std::string & | package, |
const std::string & | base_class, | ||
const std::string & | attrib_name = std::string("plugin") , |
||
const std::vector< std::string > & | plugin_xml_paths = std::vector<std::string>() |
||
) | [inline] |
Constructor for a ClassLoader.
package | The package containing the base class |
base_class | The type of the base class for classes to be loaded |
attrib_name | The attribute to search for in manifext.xml files, defaults to "plugin" |
plugin_xml_paths | The list of paths of plugin.xml files, defaults to be crawled via ros::package::getPlugins() |
pluginlib::LibraryLoadException | Thrown if package manifest cannot be found |
Definition at line 58 of file plugin_loader.h.
Plugin::Ptr vigir_pluginlib::PluginLoader< T >::createPluginInstance | ( | const std::string & | lookup_name | ) | [inline, override, virtual] |
Creates an instance of a plugin which is derived from vigir_pluginlib::Plugin base class (which implicitly calls loadLibraryForClass() to increment the library counter). Deleting the instance and calling unloadLibraryForClass() is automatically handled by the shared pointer.
lookup_name | The name of the class to load |
pluginlib::LibraryLoadException | Thrown when the library associated with the class cannot be loaded |
pluginlib::CreateClassException | Thrown when the class cannot be instantiated |
Implements vigir_pluginlib::PluginLoaderBase.
Definition at line 217 of file plugin_loader.h.
std::string vigir_pluginlib::PluginLoader< T >::getBaseClassType | ( | ) | const [inline, override, virtual] |
Given the lookup name of a class, returns the type of the associated base class.
Reimplemented from pluginlib::ClassLoader< T >.
Definition at line 135 of file plugin_loader.h.
std::string vigir_pluginlib::PluginLoader< T >::getClassDescription | ( | const std::string & | lookup_name | ) | [inline, override, virtual] |
Given the lookup name of a class, returns its description.
lookup_name | The lookup name of the class |
Reimplemented from pluginlib::ClassLoader< T >.
Definition at line 126 of file plugin_loader.h.
std::string vigir_pluginlib::PluginLoader< T >::getClassLibraryPath | ( | const std::string & | lookup_name | ) | [inline, override, virtual] |
Given the name of a class, returns the path to its associated library.
lookup_name | The name of the class |
Reimplemented from pluginlib::ClassLoader< T >.
Definition at line 205 of file plugin_loader.h.
std::string vigir_pluginlib::PluginLoader< T >::getClassPackage | ( | const std::string & | lookup_name | ) | [inline, override, virtual] |
Given the name of a class, returns name of the containing package.
lookup_name | The name of the class |
Reimplemented from pluginlib::ClassLoader< T >.
Definition at line 145 of file plugin_loader.h.
std::string vigir_pluginlib::PluginLoader< T >::getClassType | ( | const std::string & | lookup_name | ) | [inline, override, virtual] |
Given the lookup name of a class, returns the type of the derived class associated with it.
lookup_name | The name of the class |
Reimplemented from pluginlib::ClassLoader< T >.
Definition at line 116 of file plugin_loader.h.
std::vector<std::string> vigir_pluginlib::PluginLoader< T >::getDeclaredClasses | ( | ) | [inline, override, virtual] |
Returns a list of all available classes for this ClassLoader's base class type.
Reimplemented from pluginlib::ClassLoader< T >.
Definition at line 77 of file plugin_loader.h.
std::string vigir_pluginlib::PluginLoader< T >::getName | ( | const std::string & | lookup_name | ) | [inline, override, virtual] |
Strips the package name off of a lookup name.
lookup_name | The name of the plugin |
Reimplemented from pluginlib::ClassLoader< T >.
Definition at line 96 of file plugin_loader.h.
std::string vigir_pluginlib::PluginLoader< T >::getPluginManifestPath | ( | const std::string & | lookup_name | ) | [inline, override, virtual] |
Given the name of a class, returns the path of the associated plugin manifest.
lookup_name | The name of the class |
Reimplemented from pluginlib::ClassLoader< T >.
Definition at line 155 of file plugin_loader.h.
std::vector<std::string> vigir_pluginlib::PluginLoader< T >::getPluginXmlPaths | ( | ) | [inline, override, virtual] |
Returns a list of all available plugin manifest paths for this ClassLoader's base class type.
Reimplemented from pluginlib::ClassLoader< T >.
Definition at line 68 of file plugin_loader.h.
std::vector<std::string> vigir_pluginlib::PluginLoader< T >::getRegisteredLibraries | ( | ) | [inline, override, virtual] |
Returns the libraries that are registered and can be loaded.
Reimplemented from pluginlib::ClassLoader< T >.
Definition at line 195 of file plugin_loader.h.
bool vigir_pluginlib::PluginLoader< T >::isClassAvailable | ( | const std::string & | lookup_name | ) | [inline, override, virtual] |
Checks if the class associated with a plugin name is available to be loaded.
lookup_name | The name of the plugin |
Reimplemented from pluginlib::ClassLoader< T >.
Definition at line 106 of file plugin_loader.h.
bool vigir_pluginlib::PluginLoader< T >::isClassLoaded | ( | const std::string & | lookup_name | ) | [inline, override, virtual] |
Checks if a given class is currently loaded.
lookup_name | The lookup name of the class to query |
Reimplemented from pluginlib::ClassLoader< T >.
Definition at line 165 of file plugin_loader.h.
void vigir_pluginlib::PluginLoader< T >::loadLibraryForClass | ( | const std::string & | lookup_name | ) | [inline, override, virtual] |
Attempts to load a class with a given name.
lookup_name | The lookup name of the class to load |
pluginlib::LibraryLoadException | Thrown if the library for the class cannot be loaded |
Reimplemented from pluginlib::ClassLoader< T >.
Definition at line 175 of file plugin_loader.h.
void vigir_pluginlib::PluginLoader< T >::refreshDeclaredClasses | ( | ) | [inline, override, virtual] |
Refreshs the list of all available classes for this ClassLoader's base class type
pluginlib::LibraryLoadException | Thrown if package manifest cannot be found. |
Reimplemented from pluginlib::ClassLoader< T >.
Definition at line 86 of file plugin_loader.h.
int vigir_pluginlib::PluginLoader< T >::unloadLibraryForClass | ( | const std::string & | lookup_name | ) | [inline, override, virtual] |
Attempts to unload a class with a given name.
lookup_name | The lookup name of the class to unload |
pluginlib::LibraryUnloadException | Thrown if the library for the class cannot be unloaded |
Reimplemented from pluginlib::ClassLoader< T >.
Definition at line 186 of file plugin_loader.h.