Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Static Protected Attributes
vigir_pluginlib::PluginManager Class Reference

#include <plugin_manager.h>

List of all members.

Public Types

typedef boost::shared_ptr
< const PluginManager
ConstPtr
typedef std::vector
< PluginLoaderBase * > 
PluginLoaderVector
typedef boost::shared_ptr
< PluginManager
Ptr

Public Member Functions

 ~PluginManager ()

Static Public Member Functions

static bool addPlugin (const msgs::PluginDescription &plugin_description, bool initialize=true)
template<typename PluginDerivedClass >
static void addPlugin (bool initialize=true)
static void addPlugin (Plugin *plugin, bool initialize=true)
static void addPlugin (Plugin::Ptr plugin, bool initialize=true)
static bool addPluginByName (const std::string &name, bool initialize=true)
template<class PluginBaseClass >
static bool addPluginClassLoader (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 >())
 Adds ClassLoader for a specific type of plugins.
static bool addPlugins (const std::vector< msgs::PluginDescription > &plugin_descriptions, bool initialize=true)
 Instantiation of plugin using ClassLoader.
static bool autocompletePluginDescriptionByName (const std::string &name, msgs::PluginDescription &plugin_description)
 Tries to extract plugin description from param server using the given name.
template<typename T >
static boost::shared_ptr< T > getPlugin (const std::string &name=std::string())
template<typename T >
static bool getPlugin (boost::shared_ptr< T > &plugin, const std::string &name=std::string())
template<typename T >
static bool getPluginByName (const std::string &name, boost::shared_ptr< T > &plugin)
static Plugin::Ptr getPluginByName (const std::string &name)
static bool getPluginByName (const std::string &name, Plugin::Ptr &plugin)
static void getPluginDescriptions (std::vector< msgs::PluginDescription > &descriptions, msgs::PluginDescription filter=msgs::PluginDescription())
template<typename T >
static bool getPluginsByType (std::vector< boost::shared_ptr< T > > &plugins)
 returns all plugins derived by class T in alphabetical order (name)
template<typename T >
static bool getPluginsByType (std::map< std::string, boost::shared_ptr< T > > &plugins)
 returns all plugins derived by class T as map
static bool getPluginsByTypeClass (const std::string &type_class, std::vector< Plugin::Ptr > &plugins)
static void getPluginStates (std::vector< msgs::PluginState > &plugin_states, msgs::PluginDescription filter=msgs::PluginDescription())
static bool getUniquePluginByTypeClass (const std::string &type_class, Plugin::Ptr &plugin)
 returns a plugin marked as unique of specific type id
static bool hasPlugin (Plugin::Ptr &plugin)
static bool hasPluginByName (const std::string &name)
template<typename T >
static bool hasPluginsByType ()
static bool hasPluginsByTypeClass (const std::string &type_class)
static void initialize (ros::NodeHandle &nh)
 Initialize all rostopic/-services within the namespace of the given nodehandle.
static void loadParams (const vigir_generic_params::ParameterSet &params)
static bool loadPluginSet (const std::vector< msgs::PluginDescription > &plugin_descriptions)
static bool loadPluginSet (const std::string &name)
static bool removePlugin (const msgs::PluginDescription &plugin_description)
static void removePlugin (Plugin::Ptr &plugin)
static bool removePluginByName (const std::string &name)
static bool removePlugins (const std::vector< msgs::PluginDescription > &plugin_descriptions)
template<typename T >
static void removePluginsByType ()
static void removePluginsByTypeClass (const std::string &type_class)

Protected Types

typedef
actionlib::SimpleActionServer
< msgs::GetPluginDescriptionsAction > 
GetPluginDescriptionsActionServer
typedef
actionlib::SimpleActionServer
< msgs::GetPluginStatesAction > 
GetPluginStatesActionServer
typedef
actionlib::SimpleActionServer
< msgs::PluginManagementAction > 
PluginManagementActionServer

Protected Member Functions

void addPlugin (const msgs::PluginDescriptionConstPtr plugin_description)
 ROS API.
void addPluginAction (const msgs::PluginManagementGoalConstPtr goal)
bool addPluginService (msgs::PluginManagementService::Request &req, msgs::PluginManagementService::Response &resp)
bool getPluginDescription (const std::string &key, msgs::PluginDescription &description)
void getPluginDescriptionsAction (const msgs::GetPluginDescriptionsGoalConstPtr goal)
bool getPluginDescriptionsService (msgs::GetPluginDescriptionsService::Request &req, msgs::GetPluginDescriptionsService::Response &resp)
void getPluginStatesAction (const msgs::GetPluginStatesGoalConstPtr goal)
bool getPluginStatesService (msgs::GetPluginStatesService::Request &req, msgs::GetPluginStatesService::Response &resp)
void loadPluginSetAction (const msgs::PluginManagementGoalConstPtr goal)
bool loadPluginSetService (msgs::PluginManagementService::Request &req, msgs::PluginManagementService::Response &resp)
 PluginManager ()
void publishPluginStateUpdate ()
void removePlugin (const msgs::PluginDescriptionConstPtr plugin_description)
void removePluginAction (const msgs::PluginManagementGoalConstPtr goal)
bool removePluginService (msgs::PluginManagementService::Request &req, msgs::PluginManagementService::Response &resp)

Static Protected Member Functions

static PluginManager::Ptr Instance ()

Protected Attributes

boost::shared_ptr
< PluginManagementActionServer
add_plugin_as_
ros::ServiceServer add_plugin_srv_
ros::Subscriber add_plugin_sub_
PluginLoaderVector class_loader_
boost::shared_ptr
< GetPluginDescriptionsActionServer
get_plugin_descriptions_as_
ros::ServiceServer get_plugin_descriptions_srv_
boost::shared_ptr
< GetPluginStatesActionServer
get_plugin_states_as_
ros::ServiceServer get_plugin_states_srv_
boost::shared_ptr
< PluginManagementActionServer
load_plugin_set_as_
ros::ServiceServer load_plugin_set_srv_
std::string loaded_plugin_set_
ros::NodeHandle nh_
ros::Publisher plugin_states_pub_
std::map< std::string,
Plugin::Ptr
plugins_by_name_
boost::shared_mutex plugins_mutex_
boost::shared_ptr
< PluginManagementActionServer
remove_plugin_as_
ros::ServiceServer remove_plugin_srv_
ros::Subscriber remove_plugin_sub_

Static Protected Attributes

static PluginManager::Ptr singelton_ = PluginManager::Ptr()

Detailed Description

Definition at line 49 of file plugin_manager.h.


Member Typedef Documentation

typedef boost::shared_ptr<const PluginManager> vigir_pluginlib::PluginManager::ConstPtr

Definition at line 55 of file plugin_manager.h.

Definition at line 60 of file plugin_manager.h.

Definition at line 61 of file plugin_manager.h.

Definition at line 57 of file plugin_manager.h.

Definition at line 62 of file plugin_manager.h.

Definition at line 54 of file plugin_manager.h.


Constructor & Destructor Documentation

Definition at line 13 of file plugin_manager.cpp.

Definition at line 24 of file plugin_manager.cpp.


Member Function Documentation

bool vigir_pluginlib::PluginManager::addPlugin ( const msgs::PluginDescription &  plugin_description,
bool  initialize = true 
) [static]

Definition at line 134 of file plugin_manager.cpp.

template<typename PluginDerivedClass >
static void vigir_pluginlib::PluginManager::addPlugin ( bool  initialize = true) [inline, static]

Definition at line 145 of file plugin_manager.h.

void vigir_pluginlib::PluginManager::addPlugin ( Plugin plugin,
bool  initialize = true 
) [static]

Definition at line 210 of file plugin_manager.cpp.

void vigir_pluginlib::PluginManager::addPlugin ( Plugin::Ptr  plugin,
bool  initialize = true 
) [static]

Definition at line 216 of file plugin_manager.cpp.

void vigir_pluginlib::PluginManager::addPlugin ( const msgs::PluginDescriptionConstPtr  plugin_description) [protected]

ROS API.

Definition at line 610 of file plugin_manager.cpp.

void vigir_pluginlib::PluginManager::addPluginAction ( const msgs::PluginManagementGoalConstPtr  goal) [protected]

Definition at line 684 of file plugin_manager.cpp.

bool vigir_pluginlib::PluginManager::addPluginByName ( const std::string &  name,
bool  initialize = true 
) [static]

Definition at line 203 of file plugin_manager.cpp.

template<class PluginBaseClass >
static bool vigir_pluginlib::PluginManager::addPluginClassLoader ( 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, static]

Adds ClassLoader for a specific type of plugins.

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 96 of file plugin_manager.h.

bool vigir_pluginlib::PluginManager::addPlugins ( const std::vector< msgs::PluginDescription > &  plugin_descriptions,
bool  initialize = true 
) [static]

Instantiation of plugin using ClassLoader.

Parameters:
plugin_descriptiondescription which plugin to load
namename of plugin to load
initializeif true then the plugin's initialize will be called after instantiation
Returns:
false, if instantiation has failed, otherwise true

Definition at line 107 of file plugin_manager.cpp.

bool vigir_pluginlib::PluginManager::addPluginService ( msgs::PluginManagementService::Request &  req,
msgs::PluginManagementService::Response &  resp 
) [protected]

Definition at line 634 of file plugin_manager.cpp.

bool vigir_pluginlib::PluginManager::autocompletePluginDescriptionByName ( const std::string &  name,
msgs::PluginDescription &  plugin_description 
) [static]

Tries to extract plugin description from param server using the given name.

Parameters:
nameName of the plugin
plugin_descriptionOutput of extracted plugin description
Returns:
True if extraction was successful

Definition at line 69 of file plugin_manager.cpp.

template<typename T >
static boost::shared_ptr<T> vigir_pluginlib::PluginManager::getPlugin ( const std::string &  name = std::string()) [inline, static]

Returns first found plugin matching typename T. If specific element should be returned, do set name.

Definition at line 156 of file plugin_manager.h.

template<typename T >
static bool vigir_pluginlib::PluginManager::getPlugin ( boost::shared_ptr< T > &  plugin,
const std::string &  name = std::string() 
) [inline, static]

Returns first found plugin matching typename T. If specific element should be returned, do set name.

Definition at line 189 of file plugin_manager.h.

template<typename T >
static bool vigir_pluginlib::PluginManager::getPluginByName ( const std::string &  name,
boost::shared_ptr< T > &  plugin 
) [inline, static]

Definition at line 196 of file plugin_manager.h.

Plugin::Ptr vigir_pluginlib::PluginManager::getPluginByName ( const std::string &  name) [static]

Definition at line 265 of file plugin_manager.cpp.

bool vigir_pluginlib::PluginManager::getPluginByName ( const std::string &  name,
Plugin::Ptr plugin 
) [static]

Definition at line 276 of file plugin_manager.cpp.

bool vigir_pluginlib::PluginManager::getPluginDescription ( const std::string &  key,
msgs::PluginDescription &  description 
) [protected]

Definition at line 582 of file plugin_manager.cpp.

void vigir_pluginlib::PluginManager::getPluginDescriptions ( std::vector< msgs::PluginDescription > &  descriptions,
msgs::PluginDescription  filter = msgs::PluginDescription() 
) [static]

Definition at line 315 of file plugin_manager.cpp.

void vigir_pluginlib::PluginManager::getPluginDescriptionsAction ( const msgs::GetPluginDescriptionsGoalConstPtr  goal) [protected]

Definition at line 654 of file plugin_manager.cpp.

bool vigir_pluginlib::PluginManager::getPluginDescriptionsService ( msgs::GetPluginDescriptionsService::Request &  req,
msgs::GetPluginDescriptionsService::Response &  resp 
) [protected]

Definition at line 622 of file plugin_manager.cpp.

template<typename T >
static bool vigir_pluginlib::PluginManager::getPluginsByType ( std::vector< boost::shared_ptr< T > > &  plugins) [inline, static]

returns all plugins derived by class T in alphabetical order (name)

Definition at line 205 of file plugin_manager.h.

template<typename T >
static bool vigir_pluginlib::PluginManager::getPluginsByType ( std::map< std::string, boost::shared_ptr< T > > &  plugins) [inline, static]

returns all plugins derived by class T as map

Definition at line 222 of file plugin_manager.h.

bool vigir_pluginlib::PluginManager::getPluginsByTypeClass ( const std::string &  type_class,
std::vector< Plugin::Ptr > &  plugins 
) [static]

Definition at line 282 of file plugin_manager.cpp.

void vigir_pluginlib::PluginManager::getPluginStates ( std::vector< msgs::PluginState > &  plugin_states,
msgs::PluginDescription  filter = msgs::PluginDescription() 
) [static]

Definition at line 347 of file plugin_manager.cpp.

void vigir_pluginlib::PluginManager::getPluginStatesAction ( const msgs::GetPluginStatesGoalConstPtr  goal) [protected]

Definition at line 669 of file plugin_manager.cpp.

bool vigir_pluginlib::PluginManager::getPluginStatesService ( msgs::GetPluginStatesService::Request &  req,
msgs::GetPluginStatesService::Response &  resp 
) [protected]

Definition at line 628 of file plugin_manager.cpp.

bool vigir_pluginlib::PluginManager::getUniquePluginByTypeClass ( const std::string &  type_class,
Plugin::Ptr plugin 
) [static]

returns a plugin marked as unique of specific type id

Definition at line 297 of file plugin_manager.cpp.

Definition at line 552 of file plugin_manager.cpp.

bool vigir_pluginlib::PluginManager::hasPluginByName ( const std::string &  name) [static]

Definition at line 559 of file plugin_manager.cpp.

template<typename T >
static bool vigir_pluginlib::PluginManager::hasPluginsByType ( ) [inline, static]

Definition at line 279 of file plugin_manager.h.

bool vigir_pluginlib::PluginManager::hasPluginsByTypeClass ( const std::string &  type_class) [static]

Definition at line 565 of file plugin_manager.cpp.

Initialize all rostopic/-services within the namespace of the given nodehandle.

Parameters:
nhThe nodehandle which is used to setup all topics/services

Definition at line 36 of file plugin_manager.cpp.

Definition at line 17 of file plugin_manager.cpp.

void vigir_pluginlib::PluginManager::loadParams ( const vigir_generic_params::ParameterSet &  params) [static]

Definition at line 575 of file plugin_manager.cpp.

bool vigir_pluginlib::PluginManager::loadPluginSet ( const std::vector< msgs::PluginDescription > &  plugin_descriptions) [static]

Definition at line 436 of file plugin_manager.cpp.

bool vigir_pluginlib::PluginManager::loadPluginSet ( const std::string &  name) [static]

Definition at line 480 of file plugin_manager.cpp.

void vigir_pluginlib::PluginManager::loadPluginSetAction ( const msgs::PluginManagementGoalConstPtr  goal) [protected]

Definition at line 720 of file plugin_manager.cpp.

bool vigir_pluginlib::PluginManager::loadPluginSetService ( msgs::PluginManagementService::Request &  req,
msgs::PluginManagementService::Response &  resp 
) [protected]

Definition at line 644 of file plugin_manager.cpp.

Definition at line 601 of file plugin_manager.cpp.

bool vigir_pluginlib::PluginManager::removePlugin ( const msgs::PluginDescription &  plugin_description) [static]

Definition at line 380 of file plugin_manager.cpp.

Definition at line 414 of file plugin_manager.cpp.

void vigir_pluginlib::PluginManager::removePlugin ( const msgs::PluginDescriptionConstPtr  plugin_description) [protected]

Definition at line 615 of file plugin_manager.cpp.

void vigir_pluginlib::PluginManager::removePluginAction ( const msgs::PluginManagementGoalConstPtr  goal) [protected]

Definition at line 702 of file plugin_manager.cpp.

bool vigir_pluginlib::PluginManager::removePluginByName ( const std::string &  name) [static]

Definition at line 392 of file plugin_manager.cpp.

bool vigir_pluginlib::PluginManager::removePlugins ( const std::vector< msgs::PluginDescription > &  plugin_descriptions) [static]

Definition at line 369 of file plugin_manager.cpp.

template<typename T >
static void vigir_pluginlib::PluginManager::removePluginsByType ( ) [inline, static]

Definition at line 252 of file plugin_manager.h.

void vigir_pluginlib::PluginManager::removePluginsByTypeClass ( const std::string &  type_class) [static]

Definition at line 419 of file plugin_manager.cpp.

bool vigir_pluginlib::PluginManager::removePluginService ( msgs::PluginManagementService::Request &  req,
msgs::PluginManagementService::Response &  resp 
) [protected]

Definition at line 639 of file plugin_manager.cpp.


Member Data Documentation

Definition at line 351 of file plugin_manager.h.

Definition at line 344 of file plugin_manager.h.

Definition at line 335 of file plugin_manager.h.

Definition at line 308 of file plugin_manager.h.

Definition at line 349 of file plugin_manager.h.

Definition at line 342 of file plugin_manager.h.

Definition at line 350 of file plugin_manager.h.

Definition at line 343 of file plugin_manager.h.

Definition at line 353 of file plugin_manager.h.

Definition at line 346 of file plugin_manager.h.

Definition at line 311 of file plugin_manager.h.

Definition at line 305 of file plugin_manager.h.

Definition at line 339 of file plugin_manager.h.

Definition at line 312 of file plugin_manager.h.

boost::shared_mutex vigir_pluginlib::PluginManager::plugins_mutex_ [mutable, protected]

Definition at line 302 of file plugin_manager.h.

Definition at line 352 of file plugin_manager.h.

Definition at line 345 of file plugin_manager.h.

Definition at line 336 of file plugin_manager.h.

Definition at line 64 of file plugin_manager.h.


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


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