Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
canopen::Timer Class Reference

#include <timer.h>

Public Types

using TimerDelegate = can::DelegateHelper< TimerFunc >
 
using TimerFunc = std::function< bool(void)>
 

Public Member Functions

const boost::chrono::high_resolution_clock::duration & getPeriod ()
 
void restart ()
 
template<typename T >
void start (const TimerFunc &del, const T &dur, bool start_now=true)
 
void stop ()
 
 Timer ()
 
 ~Timer ()
 

Private Member Functions

void handler (const boost::system::error_code &ec)
 

Private Attributes

TimerFunc delegate
 
boost::asio::io_service io
 
boost::mutex mutex
 
boost::chrono::high_resolution_clock::duration period
 
boost::thread thread
 
boost::asio::basic_waitable_timer< boost::chrono::high_resolution_clock > timer
 
boost::asio::io_service::work work
 

Detailed Description

Definition at line 15 of file timer.h.

Member Typedef Documentation

◆ TimerDelegate

Definition at line 18 of file timer.h.

◆ TimerFunc

using canopen::Timer::TimerFunc = std::function<bool(void)>

Definition at line 17 of file timer.h.

Constructor & Destructor Documentation

◆ Timer()

canopen::Timer::Timer ( )
inline

Definition at line 20 of file timer.h.

◆ ~Timer()

canopen::Timer::~Timer ( )
inline

Definition at line 47 of file timer.h.

Member Function Documentation

◆ getPeriod()

const boost::chrono::high_resolution_clock::duration& canopen::Timer::getPeriod ( )
inline

Definition at line 43 of file timer.h.

◆ handler()

void canopen::Timer::handler ( const boost::system::error_code &  ec)
inlineprivate

Definition at line 61 of file timer.h.

◆ restart()

void canopen::Timer::restart ( )
inline

Definition at line 38 of file timer.h.

◆ start()

template<typename T >
void canopen::Timer::start ( const TimerFunc del,
const T &  dur,
bool  start_now = true 
)
inline

Definition at line 29 of file timer.h.

◆ stop()

void canopen::Timer::stop ( )
inline

Definition at line 25 of file timer.h.

Member Data Documentation

◆ delegate

TimerFunc canopen::Timer::delegate
private

Definition at line 60 of file timer.h.

◆ io

boost::asio::io_service canopen::Timer::io
private

Definition at line 53 of file timer.h.

◆ mutex

boost::mutex canopen::Timer::mutex
private

Definition at line 57 of file timer.h.

◆ period

boost::chrono::high_resolution_clock::duration canopen::Timer::period
private

Definition at line 56 of file timer.h.

◆ thread

boost::thread canopen::Timer::thread
private

Definition at line 58 of file timer.h.

◆ timer

boost::asio::basic_waitable_timer<boost::chrono::high_resolution_clock> canopen::Timer::timer
private

Definition at line 55 of file timer.h.

◆ work

boost::asio::io_service::work canopen::Timer::work
private

Definition at line 54 of file timer.h.


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


canopen_master
Author(s): Mathias Lüdtke
autogenerated on Wed Mar 2 2022 00:52:27