Loading...
Searching...
No Matches
pcl::TimeTrigger Class Reference
Module common

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.
| TimeTrigger (double interval_seconds=1.0)
| Timer class that calls a callback method periodically.
| ~TimeTrigger ()
| Destructor.
boost::signals2::connection | registerCallback (const callback_type &callback)
| registers a callback
void | setInterval (double interval_seconds)
| Resets the timer interval.
void | start ()
| Start the Trigger.
void | stop ()
| Stop the Trigger.

## Detailed Description

Timer class that invokes registered callback methods periodically.

Definition at line 55 of file time_trigger.h.

## Member Typedef Documentation

## callback_type

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

Definition at line 58 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_seconds | interval in seconds
  [in] | callback | callback 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_seconds | interval 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] | callback | callback 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_seconds | interval 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:

- pcl/common/time_trigger.h