Public Member Functions | Protected Member Functions | List of all members
cras::ThreadNameUpdatingNodelet< NodeletType > Class Template Reference

This mixin allows the nodelet to update the OS name of the thread in which it is currently executing. More...

#include <thread_name_updating_nodelet.hpp>

Inheritance diagram for cras::ThreadNameUpdatingNodelet< NodeletType >:
Inheritance graph
[legend]

Public Member Functions

 ~ThreadNameUpdatingNodelet () override
 
- Public Member Functions inherited from nodelet::Nodelet
void init (const std::string &name, const M_string &remapping_args, const V_string &my_argv, ros::CallbackQueueInterface *st_queue=NULL, ros::CallbackQueueInterface *mt_queue=NULL)
 
 Nodelet ()
 
virtual ~Nodelet ()
 

Protected Member Functions

void updateThreadName () const
 Set custom name of the current thread to this nodelet's name. More...
 
- Protected Member Functions inherited from nodelet::Nodelet
ros::CallbackQueueInterfacegetMTCallbackQueue () const
 
ros::NodeHandlegetMTNodeHandle () const
 
ros::NodeHandlegetMTPrivateNodeHandle () const
 
const V_stringgetMyArgv () const
 
const std::string & getName () const
 
ros::NodeHandlegetNodeHandle () const
 
ros::NodeHandlegetPrivateNodeHandle () const
 
const M_stringgetRemappingArgs () const
 
ros::CallbackQueueInterfacegetSTCallbackQueue () const
 
std::string getSuffixedName (const std::string &suffix) const
 

Detailed Description

template<typename NodeletType = ::nodelet::Nodelet>
class cras::ThreadNameUpdatingNodelet< NodeletType >

This mixin allows the nodelet to update the OS name of the thread in which it is currently executing.

Template Parameters
NodeletTypeType of the base nodelet.

Definition at line 21 of file thread_name_updating_nodelet.hpp.

Constructor & Destructor Documentation

◆ ~ThreadNameUpdatingNodelet()

template<typename NodeletType = ::nodelet::Nodelet>
cras::ThreadNameUpdatingNodelet< NodeletType >::~ThreadNameUpdatingNodelet ( )
override

Member Function Documentation

◆ updateThreadName()

template<typename NodeletType = ::nodelet::Nodelet>
void cras::ThreadNameUpdatingNodelet< NodeletType >::updateThreadName ( ) const
protected

Set custom name of the current thread to this nodelet's name.

Note
The name will be automatically shortened if longer than 15 chars.
You can see the custom names in htop when you enable display of custom thread names in options.
This function doesn't reset the name back to the original.
You should call this function at the beginning of all your callbacks.
This function is actually pretty fast. It can be called more than 1 million times per second.

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


cras_cpp_common
Author(s): Martin Pecka
autogenerated on Tue Nov 26 2024 03:49:04