Public Types | Public Member Functions | Private Member Functions | Private Attributes
pcl::TimeTrigger Class Reference

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

#include <time_trigger.h>

List of all members.

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_

Detailed Description

Timer class that invokes registered callback methods periodically.

Definition at line 52 of file time_trigger.h.


Member Typedef Documentation

typedef boost::function<void() > pcl::TimeTrigger::callback_type

Definition at line 55 of file time_trigger.h.


Constructor & Destructor Documentation

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

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.

Parameters:
[in]interval_secondsinterval in seconds

Definition at line 57 of file time_trigger.cpp.

Destructor.

Definition at line 70 of file time_trigger.cpp.


Member Function Documentation

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

registeres a callback

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

Definition at line 82 of file time_trigger.cpp.

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

Resets the timer interval.

Parameters:
[in]interval_secondsinterval in seconds

Definition at line 90 of file time_trigger.cpp.

Start the Trigger.

Definition at line 100 of file time_trigger.cpp.

Stop the Trigger.

Definition at line 112 of file time_trigger.cpp.

Definition at line 124 of file time_trigger.cpp.


Member Data Documentation

boost::signals2::signal<void() > pcl::TimeTrigger::callbacks_ [private]

Definition at line 93 of file time_trigger.h.

boost::condition_variable pcl::TimeTrigger::condition_ [private]

Definition at line 101 of file time_trigger.h.

boost::mutex pcl::TimeTrigger::condition_mutex_ [private]

Definition at line 102 of file time_trigger.h.

double pcl::TimeTrigger::interval_ [private]

Definition at line 95 of file time_trigger.h.

bool pcl::TimeTrigger::quit_ [private]

Definition at line 97 of file time_trigger.h.

Definition at line 98 of file time_trigger.h.

boost::thread pcl::TimeTrigger::timer_thread_ [private]

Definition at line 100 of file time_trigger.h.


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


pcl
Author(s): Open Perception
autogenerated on Wed Aug 26 2015 15:43:37