Public Member Functions
vigir_pluginlib::PluginLoader< T > Class Template Reference

#include <plugin_loader.h>

Inheritance diagram for vigir_pluginlib::PluginLoader< T >:
Inheritance graph
[legend]

List of all members.

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

Exceptions:
pluginlib::LibraryLoadExceptionThrown if package manifest cannot be found.

int unloadLibraryForClass (const std::string &lookup_name) override
 Attempts to unload a class with a given name.

Detailed Description

template<class T>
class vigir_pluginlib::PluginLoader< T >

Definition at line 45 of file plugin_loader.h.


Constructor & Destructor Documentation

template<class T>
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.

Parameters:
packageThe package containing the base class
base_classThe type of the base class for classes to be loaded
attrib_nameThe attribute to search for in manifext.xml files, defaults to "plugin"
plugin_xml_pathsThe list of paths of plugin.xml files, defaults to be crawled via ros::package::getPlugins()
Exceptions:
pluginlib::LibraryLoadExceptionThrown if package manifest cannot be found

Definition at line 58 of file plugin_loader.h.


Member Function Documentation

template<class T>
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.

Parameters:
lookup_nameThe name of the class to load
Exceptions:
pluginlib::LibraryLoadExceptionThrown when the library associated with the class cannot be loaded
pluginlib::CreateClassExceptionThrown when the class cannot be instantiated
Returns:
An instance of the class

Implements vigir_pluginlib::PluginLoaderBase.

Definition at line 217 of file plugin_loader.h.

template<class T>
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.

Returns:
The type of the associated base class

Reimplemented from pluginlib::ClassLoader< T >.

Definition at line 135 of file plugin_loader.h.

template<class T>
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.

Parameters:
lookup_nameThe lookup name of the class
Returns:
The description of the class

Reimplemented from pluginlib::ClassLoader< T >.

Definition at line 126 of file plugin_loader.h.

template<class T>
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.

Parameters:
lookup_nameThe name of the class
Returns:
The path to the associated library

Reimplemented from pluginlib::ClassLoader< T >.

Definition at line 205 of file plugin_loader.h.

template<class T>
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.

Parameters:
lookup_nameThe name of the class
Returns:
The name of the containing package

Reimplemented from pluginlib::ClassLoader< T >.

Definition at line 145 of file plugin_loader.h.

template<class T>
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.

Parameters:
lookup_nameThe name of the class
Returns:
The name of the associated derived class

Reimplemented from pluginlib::ClassLoader< T >.

Definition at line 116 of file plugin_loader.h.

template<class T>
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.

Returns:
A vector of strings corresponding to the names of all available classes

Reimplemented from pluginlib::ClassLoader< T >.

Definition at line 77 of file plugin_loader.h.

template<class T>
std::string vigir_pluginlib::PluginLoader< T >::getName ( const std::string &  lookup_name) [inline, override, virtual]

Strips the package name off of a lookup name.

Parameters:
lookup_nameThe name of the plugin
Returns:
The name of the plugin stripped of the package name

Reimplemented from pluginlib::ClassLoader< T >.

Definition at line 96 of file plugin_loader.h.

template<class T>
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.

Parameters:
lookup_nameThe name of the class
Returns:
The path of the associated plugin manifest

Reimplemented from pluginlib::ClassLoader< T >.

Definition at line 155 of file plugin_loader.h.

template<class T>
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.

Returns:
A vector of strings corresponding to the paths of all available plugin manifests

Reimplemented from pluginlib::ClassLoader< T >.

Definition at line 68 of file plugin_loader.h.

template<class T>
std::vector<std::string> vigir_pluginlib::PluginLoader< T >::getRegisteredLibraries ( ) [inline, override, virtual]

Returns the libraries that are registered and can be loaded.

Returns:
A vector of strings corresponding to the names of registered libraries

Reimplemented from pluginlib::ClassLoader< T >.

Definition at line 195 of file plugin_loader.h.

template<class T>
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.

Parameters:
lookup_nameThe name of the plugin
Returns:
True if the plugin is available, false otherwise

Reimplemented from pluginlib::ClassLoader< T >.

Definition at line 106 of file plugin_loader.h.

template<class T>
bool vigir_pluginlib::PluginLoader< T >::isClassLoaded ( const std::string &  lookup_name) [inline, override, virtual]

Checks if a given class is currently loaded.

Parameters:
lookup_nameThe lookup name of the class to query
Returns:
True if the class is loaded, false otherwise

Reimplemented from pluginlib::ClassLoader< T >.

Definition at line 165 of file plugin_loader.h.

template<class T>
void vigir_pluginlib::PluginLoader< T >::loadLibraryForClass ( const std::string &  lookup_name) [inline, override, virtual]

Attempts to load a class with a given name.

Parameters:
lookup_nameThe lookup name of the class to load
Exceptions:
pluginlib::LibraryLoadExceptionThrown if the library for the class cannot be loaded

Reimplemented from pluginlib::ClassLoader< T >.

Definition at line 175 of file plugin_loader.h.

template<class T>
void vigir_pluginlib::PluginLoader< T >::refreshDeclaredClasses ( ) [inline, override, virtual]

Refreshs the list of all available classes for this ClassLoader's base class type

Exceptions:
pluginlib::LibraryLoadExceptionThrown if package manifest cannot be found.

Reimplemented from pluginlib::ClassLoader< T >.

Definition at line 86 of file plugin_loader.h.

template<class T>
int vigir_pluginlib::PluginLoader< T >::unloadLibraryForClass ( const std::string &  lookup_name) [inline, override, virtual]

Attempts to unload a class with a given name.

Parameters:
lookup_nameThe lookup name of the class to unload
Exceptions:
pluginlib::LibraryUnloadExceptionThrown if the library for the class cannot be unloaded
Returns:
The number of pending unloads until the library is removed from memory

Reimplemented from pluginlib::ClassLoader< T >.

Definition at line 186 of file plugin_loader.h.


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


vigir_pluginlib
Author(s): Alexander Stumpf
autogenerated on Tue Sep 13 2016 03:47:30