Go to the documentation of this file.
30 #ifndef PLUGINLIB__CLASS_LOADER_HPP_
31 #define PLUGINLIB__CLASS_LOADER_HPP_
37 #include "boost/algorithm/string.hpp"
55 #if __cplusplus >= 201103L
76 std::string package, std::string base_class,
77 std::string attrib_name = std::string(
"plugin"),
78 std::vector<std::string> plugin_xml_paths = std::vector<std::string>());
98 const std::string & lookup_name,
99 bool auto_load =
true);
115 #if __cplusplus >= 201103L
132 UniquePtr<T> createUniqueInstance(
const std::string & lookup_name);
168 virtual std::string
getName(
const std::string & lookup_name);
181 virtual std::string
getClassType(
const std::string & lookup_name);
265 const std::string & package,
266 const std::string & attrib_name,
267 bool force_recrawl =
false);
276 const std::vector<std::string> & plugin_xml_paths);
292 const std::string & library_name,
293 const std::string & exporting_package_name);
315 std::string
joinPaths(
const std::string & path1,
const std::string & path2);
323 const std::string & xml_file, std::map<std::string,
356 #endif // PLUGINLIB__CLASS_LOADER_HPP_
virtual std::string getBaseClassType() const
Given the lookup name of a class, return the type of the associated base class.
std::vector< std::string > getCatkinLibraryPaths()
Return the paths where libraries are installed according to the Catkin build system.
virtual int unloadLibraryForClass(const std::string &lookup_name)
Decrement the counter for the library containing a class with a given name.
virtual bool isClassAvailable(const std::string &lookup_name)
Check if the class associated with a plugin name is available to be loaded.
virtual std::string getClassType(const std::string &lookup_name)
Given the lookup name of a class, return the type of the derived class associated with it.
std::map< std::string, ClassDesc >::iterator ClassMapIterator
std::string stripAllButFileFromPath(const std::string &path)
Strip all but the filename from an explicit file path.
Pure virtual base class of pluginlib::ClassLoader which is not templated.
int unloadClassLibraryInternal(const std::string &library_path)
Helper function for unloading a shared library.
virtual std::string getPluginManifestPath(const std::string &lookup_name)
Given the name of a class, return the path of the associated plugin manifest.
std::vector< std::string > getPluginXmlPaths()
Return a list of all available plugin manifest paths for this ClassLoader's base class type.
std::map< std::string, ClassDesc > classes_available_
std::string getPathSeparator()
Get the standard path separator for the native OS (e.g. "/" on *nix, "\" on Windows).
virtual std::string getClassLibraryPath(const std::string &lookup_name)
Given the name of a class, return the path to its associated library.
std::map< std::string, ClassDesc > determineAvailableClasses(const std::vector< std::string > &plugin_xml_paths)
Return the available classes.
~ClassLoader() override
The destructor attempts to unload all libraries which are still loaded.
std::unique_ptr< Base, DeleterType< Base > > UniquePtr
Storage for information about a given class.
A class to help manage and load classes.
virtual std::string getClassDescription(const std::string &lookup_name)
Given the lookup name of a class, return its description.
virtual std::string getClassPackage(const std::string &lookup_name)
Given the name of a class, return name of the containing package.
ClassLoader(std::string package, std::string base_class, std::string attrib_name=std::string("plugin"), std::vector< std::string > plugin_xml_paths=std::vector< std::string >())
boost::shared_ptr< T > createInstance(const std::string &lookup_name)
Create an instance of a desired class.
virtual void loadLibraryForClass(const std::string &lookup_name)
Attempt to load the library containing a class with a given name.
virtual std::string getName(const std::string &lookup_name)
Strip the package name off of a lookup name.
std::vector< std::string > plugin_xml_paths_
std::string getErrorStringForUnknownClass(const std::string &lookup_name)
Return an error message for an unknown class.
T * createUnmanagedInstance(const std::string &lookup_name)
Create an instance of a desired class.
void processSingleXMLPluginFile(const std::string &xml_file, std::map< std::string, ClassDesc > &class_available)
Parse a plugin XML file.
class_loader::MultiLibraryClassLoader lowlevel_class_loader_
virtual std::vector< std::string > getRegisteredLibraries()
Return the libraries that are registered and can be loaded.
bool isClassLoaded(const std::string &lookup_name)
Check if the library for a given class is currently loaded.
virtual void refreshDeclaredClasses()
Refresh the list of all available classes for this ClassLoader's base class type.
std::string joinPaths(const std::string &path1, const std::string &path2)
Join two filesystem paths together utilzing appropriate path separator.
std::string getPackageFromPluginXMLFilePath(const std::string &path)
Get the package name from a path to a plugin XML file.
std::string getROSBuildLibraryPath(const std::string &exporting_package_name)
Given a package name, return the path where rosbuild thinks plugins are installed.
std::string extractPackageNameFromPackageXML(const std::string &package_xml_path)
Open a package.xml file and extract the package name (i.e. contents of <name> tag).
T * createClassInstance(const std::string &lookup_name, bool auto_load=true)
Create an instance of a desired class, optionally loading the associated library too.
std::vector< std::string > getAllLibraryPathsToTry(const std::string &library_name, const std::string &exporting_package_name)
Get a list of paths to try to find a library.
std::vector< std::string > getDeclaredClasses()
Return a list of all available classes for this ClassLoader's base class type.
pluginlib
Author(s): Eitan Marder-Eppstein, Tully Foote, Dirk Thomas, Mirza Shah
autogenerated on Tue Jul 9 2024 02:50:20