#include <Client.hpp>
Public Types | |
typedef unsigned int | uint |
Public Member Functions | |
double | getPeriod () |
getPeriod get period in seconds | |
PeriodicTimer (const std::function< void()> funct, const double period_seconds) | |
PeriodicTimer define a periodic timer. | |
void | setPeriod (const double period_seconds) |
setPeriod change the update period of timer thread This will stop and restart the thread. | |
void | start () |
start define and start background thread | |
void | stop () |
stop tell thread to stop and wait for end | |
Private Attributes | |
std::function< void()> | funct |
std::chrono::duration< uint, std::micro > | period_us |
bool | running |
std::shared_ptr< std::thread > | thread_ptr |
Definition at line 14 of file Client.hpp.
typedef unsigned int msp::PeriodicTimer::uint |
Definition at line 16 of file Client.hpp.
msp::PeriodicTimer::PeriodicTimer | ( | const std::function< void()> | funct, |
const double | period_seconds | ||
) |
PeriodicTimer define a periodic timer.
funct | function that is called periodically |
period_seconds | period in seconds |
Definition at line 7 of file Client.cpp.
double msp::PeriodicTimer::getPeriod | ( | ) | [inline] |
void msp::PeriodicTimer::setPeriod | ( | const double | period_seconds | ) |
setPeriod change the update period of timer thread This will stop and restart the thread.
period_seconds | period in seconds |
Definition at line 38 of file Client.cpp.
void msp::PeriodicTimer::start | ( | ) |
start define and start background thread
Definition at line 13 of file Client.cpp.
void msp::PeriodicTimer::stop | ( | ) |
stop tell thread to stop and wait for end
Definition at line 31 of file Client.cpp.
std::function<void()> msp::PeriodicTimer::funct [private] |
Definition at line 52 of file Client.hpp.
std::chrono::duration<uint, std::micro> msp::PeriodicTimer::period_us [private] |
Definition at line 53 of file Client.hpp.
bool msp::PeriodicTimer::running [private] |
Definition at line 54 of file Client.hpp.
std::shared_ptr<std::thread> msp::PeriodicTimer::thread_ptr [private] |
Definition at line 51 of file Client.hpp.