A mixin that can tell when a nodelet is being unloaded. More...
#include <stateful_nodelet.hpp>
Public Member Functions | |
bool | ok () const override |
Whether it is OK to continue sleeping. If false, a pending sleep() should stop as soon as possible. More... | |
void | requestStop () override |
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... | |
void | shutdown () |
virtual | ~StatefulNodelet () |
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 () |
Public Member Functions inherited from cras::InterruptibleSleepInterface | |
InterruptibleSleepInterface () | |
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... | |
Private Attributes | |
volatile bool | shouldStop = false |
Whether requestStop() has been called. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from nodelet::Nodelet | |
ros::CallbackQueueInterface & | getMTCallbackQueue () const |
ros::NodeHandle & | getMTNodeHandle () const |
ros::NodeHandle & | getMTPrivateNodeHandle () const |
const V_string & | getMyArgv () const |
const std::string & | getName () const |
ros::NodeHandle & | getNodeHandle () const |
ros::NodeHandle & | getPrivateNodeHandle () const |
const M_string & | getRemappingArgs () const |
ros::CallbackQueueInterface & | getSTCallbackQueue () const |
std::string | getSuffixedName (const std::string &suffix) const |
Protected Attributes inherited from cras::InterruptibleSleepInterface | |
::ros::WallDuration | pollDuration {0, 1000000} |
How long to wait between querying the ok() status and other conditions. More... | |
A mixin that can tell when a nodelet is being unloaded.
NodeletType | Type of the base nodelet. |
Definition at line 49 of file stateful_nodelet.hpp.
|
virtual |
|
overridevirtual |
Whether it is OK to continue sleeping. If false, a pending sleep()
should stop as soon as possible.
Reimplemented from cras::InterruptibleSleepInterface.
|
overridevirtual |
Call this function to request stopping this nodelet. ok()
should return false after calling this. It terminates all ongoing sleeps called by this->sleep()
.
Implements cras::StatefulNodeletInterface.
void cras::StatefulNodelet< NodeletType >::shutdown | ( | ) |
|
private |
Whether requestStop()
has been called.
Definition at line 63 of file stateful_nodelet.hpp.