Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | Friends
vigir_pluginlib::Plugin Class Reference

#include <plugin.h>

List of all members.

Public Types

typedef boost::shared_ptr
< const Plugin
ConstPtr
typedef boost::weak_ptr< const
Plugin
ConstWeakPtr
typedef boost::shared_ptr< PluginPtr
typedef boost::weak_ptr< PluginWeakPtr

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 >
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 &params)
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

Detailed Description

Definition at line 44 of file plugin.h.


Member Typedef Documentation

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

Definition at line 49 of file plugin.h.

typedef boost::weak_ptr<const Plugin> vigir_pluginlib::Plugin::ConstWeakPtr

Definition at line 51 of file plugin.h.

typedef boost::shared_ptr<Plugin> vigir_pluginlib::Plugin::Ptr

Definition at line 48 of file plugin.h.

typedef boost::weak_ptr<Plugin> vigir_pluginlib::Plugin::WeakPtr

Definition at line 50 of file plugin.h.


Constructor & Destructor Documentation

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.

Definition at line 45 of file plugin.cpp.


Member Function Documentation

template<typename T >
static std::string vigir_pluginlib::Plugin::_typeClass ( T *  t = nullptr) [inline, static, protected]

Used internally for automatically generate type ids for data types.

Definition at line 120 of file plugin.h.

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.

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

Parameters:
namename of parameter
val[out] return variable for parameter
defdefault value
ignore_warningsif true no warnings will be printed out when param was not present
Returns:
true when parameter was found at rosparam

Definition at line 143 of file plugin.h.

const vigir_generic_params::ParameterSet& vigir_pluginlib::Plugin::getParams ( ) const [inline, protected]

Returns parameter set of plugin.

Returns:
parameter set of pluign

Definition at line 132 of file plugin.h.

template<typename T >
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>().

Definition at line 96 of file plugin.h.

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]

Initialization of plugin specific features.

Parameters:
global_paramsglobal parameter set
Returns:
true when initialization was successful

Definition at line 71 of file plugin.h.

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.

Definition at line 111 of file plugin.h.

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(...).

Parameters:
global_paramsglobal parameter set
Returns:
true, if loading parameters was successful

Definition at line 87 of file plugin.h.

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

Parameters:
namename of parameter
defdefault value
ignore_warningsWhen true no warnings will be printed out when param was not present
Returns:
retrieved parameter if available, otherwise given default value

Definition at line 159 of file plugin.h.

virtual bool vigir_pluginlib::Plugin::postInitialize ( const vigir_generic_params::ParameterSet &  global_params = vigir_generic_params::ParameterSet()) [inline, virtual]

Called after initialization of this and other plugins has been completed. At this point other plugins can be used safely.

Parameters:
global_paramsglobal parameter set
Returns:
true, if post initialization was successful

Definition at line 79 of file plugin.h.

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.

Parameters:
nhNodehandle the plugin
global_paramsglobal parameter set
Returns:
true, if setup was successful

Definition at line 49 of file plugin.cpp.

void vigir_pluginlib::Plugin::updateDescription ( const msgs::PluginDescription &  description) [protected]

Updates plugin description.

Parameters:
descriptionnew description

Definition at line 109 of file plugin.cpp.


Friends And Related Function Documentation

friend class PluginManager [friend]

Definition at line 113 of file plugin.h.


Member Data Documentation

msgs::PluginDescription vigir_pluginlib::Plugin::description_ [private]

Definition at line 174 of file plugin.h.

Definition at line 166 of file plugin.h.

vigir_generic_params::ParameterSet vigir_pluginlib::Plugin::params_ [private]

Definition at line 172 of file plugin.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