Public Types | Public Member Functions | Private Attributes
msp::PeriodicTimer Class Reference

#include <Client.hpp>

List of all members.

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

Detailed Description

Definition at line 14 of file Client.hpp.


Member Typedef Documentation

typedef unsigned int msp::PeriodicTimer::uint

Definition at line 16 of file Client.hpp.


Constructor & Destructor Documentation

msp::PeriodicTimer::PeriodicTimer ( const std::function< void()>  funct,
const double  period_seconds 
)

PeriodicTimer define a periodic timer.

Parameters:
functfunction that is called periodically
period_secondsperiod in seconds

Definition at line 7 of file Client.cpp.


Member Function Documentation

double msp::PeriodicTimer::getPeriod ( ) [inline]

getPeriod get period in seconds

Returns:
period in seconds

Definition at line 39 of file Client.hpp.

void msp::PeriodicTimer::setPeriod ( const double  period_seconds)

setPeriod change the update period of timer thread This will stop and restart the thread.

Parameters:
period_secondsperiod in seconds

Definition at line 38 of file Client.cpp.

start define and start background thread

Definition at line 13 of file Client.cpp.

stop tell thread to stop and wait for end

Definition at line 31 of file Client.cpp.


Member Data Documentation

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.

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.


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


msp
Author(s): Christian Rauch
autogenerated on Mon Oct 9 2017 03:02:14