Public Member Functions | List of all members
cras::StatefulNodeletInterface Struct Referenceabstract

A non-templated interface of the mixin that can tell when a nodelet is being unloaded. More...

#include <stateful_nodelet.hpp>

Inheritance diagram for cras::StatefulNodeletInterface:
Inheritance graph
[legend]

Public Member Functions

virtual void requestStop ()=0
 Call this function to request stopping this nodelet. ok() should return false after calling this. It terminates all ongoing sleeps called by this->sleep(). More...
 
- Public Member Functions inherited from cras::InterruptibleSleepInterface
 InterruptibleSleepInterface ()
 
virtual bool ok () const
 Whether it is OK to continue sleeping. If false, a pending sleep() should stop as soon as possible. More...
 
virtual bool sleep (const ::ros::Duration &duration) const
 Sleep for the given duration or until ok() returns false. More...
 
virtual ~InterruptibleSleepInterface ()
 Destroy the object waiting for a pending sleep() call to finish. More...
 

Additional Inherited Members

- Protected Attributes inherited from cras::InterruptibleSleepInterface
::ros::WallDuration pollDuration {0, 1000000}
 How long to wait between querying the ok() status and other conditions. More...
 

Detailed Description

A non-templated interface of the mixin that can tell when a nodelet is being unloaded.

Note
InterruptibleSleepInterface also provides a sleep() method that should be used for sleeps inside the nodelet so that they are automatically interrupted on nodelet unload.

Definition at line 32 of file stateful_nodelet.hpp.

Member Function Documentation

◆ requestStop()

virtual void cras::StatefulNodeletInterface::requestStop ( )
pure virtual

Call this function to request stopping this nodelet. ok() should return false after calling this. It terminates all ongoing sleeps called by this->sleep().

Note
This method is automatically called from the destructor (but rather call it as soon as you know the nodelet should be stopped).

Implemented in cras::StatefulNodelet< NodeletType >, cras::StatefulNodelet< BaseNodelet >, and cras::StatefulNodelet< ::nodelet::Nodelet >.


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


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