Point Cloud Library (PCL)  1.9.1-dev
List of all members | Public Types | Public Member Functions
pcl::TimeTrigger Class Reference

Timer class that invokes registered callback methods periodically. More...

#include <pcl/common/time_trigger.h>

Public Types

using callback_type = std::function< void()>
 

Public Member Functions

 TimeTrigger (double interval_seconds, const callback_type &callback)
 Timer class that calls a callback method periodically. More...
 
 TimeTrigger (double interval_seconds=1.0)
 Timer class that calls a callback method periodically. More...
 
 ~TimeTrigger ()
 Destructor. More...
 
boost::signals2::connection registerCallback (const callback_type &callback)
 registers a callback More...
 
void setInterval (double interval_seconds)
 Resets the timer interval. More...
 
void start ()
 Start the Trigger. More...
 
void stop ()
 Stop the Trigger. More...
 

Detailed Description

Timer class that invokes registered callback methods periodically.

Definition at line 56 of file time_trigger.h.

Member Typedef Documentation

◆ callback_type

using pcl::TimeTrigger::callback_type = std::function<void ()>

Definition at line 59 of file time_trigger.h.

Constructor & Destructor Documentation

◆ TimeTrigger() [1/2]

pcl::TimeTrigger::TimeTrigger ( double  interval_seconds,
const callback_type callback 
)

Timer class that calls a callback method periodically.

Due to possible blocking calls, only one callback method can be registered per instance.

Parameters
[in]interval_secondsinterval in seconds
[in]callbackcallback to be invoked periodically

◆ TimeTrigger() [2/2]

pcl::TimeTrigger::TimeTrigger ( double  interval_seconds = 1.0)

Timer class that calls a callback method periodically.

Due to possible blocking calls, only one callback method can be registered per instance.

Parameters
[in]interval_secondsinterval in seconds

◆ ~TimeTrigger()

pcl::TimeTrigger::~TimeTrigger ( )

Destructor.

Member Function Documentation

◆ registerCallback()

boost::signals2::connection pcl::TimeTrigger::registerCallback ( const callback_type callback)

registers a callback

Parameters
[in]callbackcallback function to the list of callbacks. signature has to be std::function<void()>
Returns
connection the connection, which can be used to disable/enable and remove callback from list

◆ setInterval()

void pcl::TimeTrigger::setInterval ( double  interval_seconds)

Resets the timer interval.

Parameters
[in]interval_secondsinterval in seconds

◆ start()

void pcl::TimeTrigger::start ( )

Start the Trigger.

◆ stop()

void pcl::TimeTrigger::stop ( )

Stop the Trigger.


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