#include <plugin.h>
Public Types | |
typedef boost::shared_ptr < const Plugin > | ConstPtr |
typedef boost::weak_ptr< const Plugin > | ConstWeakPtr |
typedef boost::shared_ptr< Plugin > | Ptr |
typedef boost::weak_ptr< Plugin > | WeakPtr |
Public Member Functions | |
const std::string & | getBaseClass () const |
const std::string & | getBaseClassPackage () const |
const msgs::PluginDescription & | getDescription () const |
const std::string & | getName () const |
const std::string & | getTypeClass () const |
const std::string & | getTypeClassPackage () const |
virtual bool | initialize (const vigir_generic_params::ParameterSet &global_params=vigir_generic_params::ParameterSet()) |
Initialization of plugin specific features. | |
virtual bool | isUnique () const |
virtual bool | loadParams (const vigir_generic_params::ParameterSet &) |
Loads parameters from parameter set and rosparam server (!= plugin's dedicated parameters). This method will be automatically called by Plugin::initialize(...). | |
Plugin (const std::string &name, const std::string &type_class_package=std::string(), const std::string &base_class_package=std::string(), const std::string &base_class=std::string()) | |
virtual bool | postInitialize (const vigir_generic_params::ParameterSet &global_params=vigir_generic_params::ParameterSet()) |
Called after initialization of this and other plugins has been completed. At this point other plugins can be used safely. | |
virtual | ~Plugin () |
Static Public Member Functions | |
template<typename T > | |
static std::string | getTypeClass () |
Protected Member Functions | |
template<typename T > | |
bool | getParam (const std::string &name, T &val, const T &def=T(), bool ignore_warnings=false) const |
Retrieves parameter from plugin's dedicated parameter set. | |
const vigir_generic_params::ParameterSet & | getParams () const |
Returns parameter set of plugin. | |
template<typename T > | |
T | param (const std::string &name, const T &def=T(), bool ignore_warnings=false) const |
Retrieves parameter from plugin's dedicated parameter set. | |
void | updateDescription (const msgs::PluginDescription &description) |
Updates plugin description. | |
Static Protected Member Functions | |
template<typename T > | |
static std::string | _typeClass (T *t=nullptr) |
Protected Attributes | |
ros::NodeHandle | nh_ |
Private Member Functions | |
void | setNodehandle (const ros::NodeHandle &nh) |
void | setParams (const vigir_generic_params::ParameterSet ¶ms) |
bool | setup (ros::NodeHandle &nh, const vigir_generic_params::ParameterSet &global_params=vigir_generic_params::ParameterSet()) |
Internal initialization of plugin itself, e.g. setting parameter namespaces. | |
Private Attributes | |
msgs::PluginDescription | description_ |
vigir_generic_params::ParameterSet | params_ |
Friends | |
class | PluginManager |
typedef boost::shared_ptr<const Plugin> vigir_pluginlib::Plugin::ConstPtr |
typedef boost::weak_ptr<const Plugin> vigir_pluginlib::Plugin::ConstWeakPtr |
typedef boost::shared_ptr<Plugin> vigir_pluginlib::Plugin::Ptr |
typedef boost::weak_ptr<Plugin> vigir_pluginlib::Plugin::WeakPtr |
vigir_pluginlib::Plugin::Plugin | ( | const std::string & | name, |
const std::string & | type_class_package = std::string() , |
||
const std::string & | base_class_package = std::string() , |
||
const std::string & | base_class = std::string() |
||
) |
Definition at line 36 of file plugin.cpp.
vigir_pluginlib::Plugin::~Plugin | ( | ) | [virtual] |
Definition at line 45 of file plugin.cpp.
static std::string vigir_pluginlib::Plugin::_typeClass | ( | T * | t = nullptr | ) | [inline, static, protected] |
const std::string & vigir_pluginlib::Plugin::getBaseClass | ( | ) | const |
Definition at line 104 of file plugin.cpp.
const std::string & vigir_pluginlib::Plugin::getBaseClassPackage | ( | ) | const |
Definition at line 99 of file plugin.cpp.
const msgs::PluginDescription & vigir_pluginlib::Plugin::getDescription | ( | ) | const |
Definition at line 69 of file plugin.cpp.
const std::string & vigir_pluginlib::Plugin::getName | ( | ) | const |
Definition at line 79 of file plugin.cpp.
bool vigir_pluginlib::Plugin::getParam | ( | const std::string & | name, |
T & | val, | ||
const T & | def = T() , |
||
bool | ignore_warnings = false |
||
) | const [inline, protected] |
Retrieves parameter from plugin's dedicated parameter set.
name | name of parameter |
val | [out] return variable for parameter |
def | default value |
ignore_warnings | if true no warnings will be printed out when param was not present |
const vigir_generic_params::ParameterSet& vigir_pluginlib::Plugin::getParams | ( | ) | const [inline, protected] |
static std::string vigir_pluginlib::Plugin::getTypeClass | ( | ) | [inline, static] |
Used for automatically generate type ids for data types. Override _typeClass() function to use custom type ids for derived data types! Usage: vigir_pluginlib::Plugin::getTypeClass<MyClass>() DO NOT OVERRIDE THIS METHOD! This wrapper prevents wrong usage, e.g. A::_typeClass<B>().
const std::string & vigir_pluginlib::Plugin::getTypeClass | ( | ) | const |
Definition at line 89 of file plugin.cpp.
const std::string & vigir_pluginlib::Plugin::getTypeClassPackage | ( | ) | const |
Definition at line 84 of file plugin.cpp.
virtual bool vigir_pluginlib::Plugin::initialize | ( | const vigir_generic_params::ParameterSet & | global_params = vigir_generic_params::ParameterSet() | ) | [inline, virtual] |
virtual bool vigir_pluginlib::Plugin::isUnique | ( | ) | const [inline, virtual] |
Unique plugins (default: true) can only exist once per type_class. The plugin manager will replace any plugin of same type_class with the new one. If a plugin can live in coexistence with others plugins with the the same type_class, override this method to return false.
virtual bool vigir_pluginlib::Plugin::loadParams | ( | const vigir_generic_params::ParameterSet & | ) | [inline, virtual] |
Loads parameters from parameter set and rosparam server (!= plugin's dedicated parameters). This method will be automatically called by Plugin::initialize(...).
global_params | global parameter set |
T vigir_pluginlib::Plugin::param | ( | const std::string & | name, |
const T & | def = T() , |
||
bool | ignore_warnings = false |
||
) | const [inline, protected] |
Retrieves parameter from plugin's dedicated parameter set.
name | name of parameter |
def | default value |
ignore_warnings | When true no warnings will be printed out when param was not present |
virtual bool vigir_pluginlib::Plugin::postInitialize | ( | const vigir_generic_params::ParameterSet & | global_params = vigir_generic_params::ParameterSet() | ) | [inline, virtual] |
void vigir_pluginlib::Plugin::setNodehandle | ( | const ros::NodeHandle & | nh | ) | [private] |
Definition at line 114 of file plugin.cpp.
void vigir_pluginlib::Plugin::setParams | ( | const vigir_generic_params::ParameterSet & | params | ) | [private] |
Definition at line 119 of file plugin.cpp.
bool vigir_pluginlib::Plugin::setup | ( | ros::NodeHandle & | nh, |
const vigir_generic_params::ParameterSet & | global_params = vigir_generic_params::ParameterSet() |
||
) | [private] |
Internal initialization of plugin itself, e.g. setting parameter namespaces.
nh | Nodehandle the plugin |
global_params | global parameter set |
Definition at line 49 of file plugin.cpp.
void vigir_pluginlib::Plugin::updateDescription | ( | const msgs::PluginDescription & | description | ) | [protected] |
Updates plugin description.
description | new description |
Definition at line 109 of file plugin.cpp.
friend class PluginManager [friend] |
msgs::PluginDescription vigir_pluginlib::Plugin::description_ [private] |
ros::NodeHandle vigir_pluginlib::Plugin::nh_ [protected] |
vigir_generic_params::ParameterSet vigir_pluginlib::Plugin::params_ [private] |