Timer class that invokes registered callback methods periodically. More...
#include <time_trigger.h>
Public Types | |
typedef boost::function< void() > | callback_type |
Public Member Functions | |
boost::signals2::connection | registerCallback (const callback_type &callback) |
registeres a callback | |
void | setInterval (double interval_seconds) |
Resets the timer interval. | |
void | start () |
Start the Trigger. | |
void | stop () |
Stop the Trigger. | |
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. | |
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. | |
~TimeTrigger () | |
Destructor. | |
Private Member Functions | |
void | thread_function () |
Private Attributes | |
boost::signals2::signal< void() > | callbacks_ |
boost::condition_variable | condition_ |
boost::mutex | condition_mutex_ |
double | interval_ |
bool | quit_ |
bool | running_ |
boost::thread | timer_thread_ |
Timer class that invokes registered callback methods periodically.
Definition at line 55 of file time_trigger.h.
typedef boost::function<void() > pcl::TimeTrigger::callback_type |
Definition at line 58 of file time_trigger.h.
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.
[in] | interval_seconds | interval in seconds |
[in] | callback | callback to be invoked periodically |
Definition at line 43 of file time_trigger.cpp.
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.
[in] | interval_seconds | interval in seconds |
Definition at line 57 of file time_trigger.cpp.
Destructor.
Definition at line 70 of file time_trigger.cpp.
boost::signals2::connection pcl::TimeTrigger::registerCallback | ( | const callback_type & | callback | ) |
registeres a callback
[in] | callback | callback function to the list of callbacks. signature has to be boost::function<void()> |
Definition at line 82 of file time_trigger.cpp.
void pcl::TimeTrigger::setInterval | ( | double | interval_seconds | ) |
Resets the timer interval.
[in] | interval_seconds | interval in seconds |
Definition at line 90 of file time_trigger.cpp.
void pcl::TimeTrigger::start | ( | ) |
Start the Trigger.
Definition at line 100 of file time_trigger.cpp.
void pcl::TimeTrigger::stop | ( | ) |
Stop the Trigger.
Definition at line 112 of file time_trigger.cpp.
void pcl::TimeTrigger::thread_function | ( | ) | [private] |
Definition at line 124 of file time_trigger.cpp.
boost::signals2::signal<void() > pcl::TimeTrigger::callbacks_ [private] |
Definition at line 96 of file time_trigger.h.
boost::condition_variable pcl::TimeTrigger::condition_ [private] |
Definition at line 104 of file time_trigger.h.
boost::mutex pcl::TimeTrigger::condition_mutex_ [private] |
Definition at line 105 of file time_trigger.h.
double pcl::TimeTrigger::interval_ [private] |
Definition at line 98 of file time_trigger.h.
bool pcl::TimeTrigger::quit_ [private] |
Definition at line 100 of file time_trigger.h.
bool pcl::TimeTrigger::running_ [private] |
Definition at line 101 of file time_trigger.h.
boost::thread pcl::TimeTrigger::timer_thread_ [private] |
Definition at line 103 of file time_trigger.h.