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

#include <timer.h>

Public Member Functions

template<typename callable , class... arguments>
void AsyncWait (int after, callable &&f, arguments &&...args)
 
void Expire ()
 
void StartTimer (int interval, std::function< void()> task)
 
template<typename callable , class... arguments>
void SyncWait (int after, callable &&f, arguments &&...args)
 
 Timer ()
 
 Timer (const Timer &t)
 
 ~Timer ()
 

Private Attributes

std::atomic< bool > expired_
 
std::condition_variable expired_cond_
 
std::mutex mutex_
 
std::atomic< bool > try_to_expire_
 

Detailed Description

Definition at line 23 of file timer.h.

Constructor & Destructor Documentation

Timer::Timer ( )
inline

Definition at line 25 of file timer.h.

Timer::Timer ( const Timer t)
inline

Definition at line 28 of file timer.h.

Timer::~Timer ( )
inline

Definition at line 32 of file timer.h.

Member Function Documentation

template<typename callable , class... arguments>
void Timer::AsyncWait ( int  after,
callable &&  f,
arguments &&...  args 
)
inline

Definition at line 86 of file timer.h.

void Timer::Expire ( )
inline

Definition at line 57 of file timer.h.

void Timer::StartTimer ( int  interval,
std::function< void()>  task 
)
inline

Definition at line 37 of file timer.h.

template<typename callable , class... arguments>
void Timer::SyncWait ( int  after,
callable &&  f,
arguments &&...  args 
)
inline

Definition at line 78 of file timer.h.

Member Data Documentation

std::atomic<bool> Timer::expired_
private

Definition at line 97 of file timer.h.

std::condition_variable Timer::expired_cond_
private

Definition at line 100 of file timer.h.

std::mutex Timer::mutex_
private

Definition at line 99 of file timer.h.

std::atomic<bool> Timer::try_to_expire_
private

Definition at line 98 of file timer.h.


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


xarm_api
Author(s):
autogenerated on Sat May 8 2021 02:51:23