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
 

Protected Member Functions

void updateThreadName () const
 Set custom name of the current thread to this nodelet's name. More...
 

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 Sat Jun 17 2023 02:32:53