dxd - dynax driver framework 3.0.1d223
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::timer< event_t, clock_t > Class Template Reference

high resolution timer source: an OS timer wait toward the objective, optionally handing over to yield/spin polling covering the last lead; self pacing by duration like free_run, or paced by an override's sync() More...

#include <dx_clock.h>

Inheritance diagram for dx::timer< event_t, clock_t >:
Collaboration diagram for dx::timer< event_t, clock_t >:

Public Types

typedef _clock_t clock_t
typedef _event_t event_t

Public Member Functions

virtual void sync (const typename clock_t::time_point &now)
super & wait (bool reset=false) override

Public Attributes

std::atomic< dx::stream::clock::strategy > strategy {dx::stream::clock::plain}
 switchable at runtime: the poll modes run only what the timer left

Protected Member Functions

void wait (int64_t remaining)
 the timer covers the remaining ns up to the strategy's lead, the strategy polls the rest toward the objective

Protected Attributes

std::condition_variable condition_variable
clock_t::duration duration {clock_t::duration::zero()}
_event_t event
std::mutex mutex
_clock_t::time_point objective
std::atomic< bool > running {false}
os_result status {not_initialized}

Detailed Description

template<typename event_t = event<kernel>, typename clock_t = std::chrono::high_resolution_clock>
class dx::timer< event_t, clock_t >

high resolution timer source: an OS timer wait toward the objective, optionally handing over to yield/spin polling covering the last lead; self pacing by duration like free_run, or paced by an override's sync()

Member Typedef Documentation

◆ clock_t

template<typename _event_t = event<user>, typename _clock_t = std::chrono::high_resolution_clock>
typedef _clock_t dx::source< _event_t, _clock_t >::clock_t
inherited

◆ event_t

template<typename _event_t = event<user>, typename _clock_t = std::chrono::high_resolution_clock>
typedef _event_t dx::source< _event_t, _clock_t >::event_t
inherited

Member Function Documentation

◆ sync()

template<typename _event_t = event<user>, typename _clock_t = std::chrono::high_resolution_clock>
virtual void dx::source< _event_t, _clock_t >::sync ( const typename clock_t::time_point & now)
inlinevirtualinherited
Here is the caller graph for this function:

◆ wait() [1/2]

template<typename event_t = event<kernel>, typename clock_t = std::chrono::high_resolution_clock>
super & dx::timer< event_t, clock_t >::wait ( bool reset = false)
inlineoverridevirtual

◆ wait() [2/2]

template<typename event_t = event<kernel>, typename clock_t = std::chrono::high_resolution_clock>
void dx::timer< event_t, clock_t >::wait ( int64_t remaining)
inlineprotected

the timer covers the remaining ns up to the strategy's lead, the strategy polls the rest toward the objective

Here is the caller graph for this function:

Member Data Documentation

◆ condition_variable

template<typename _event_t = event<user>, typename _clock_t = std::chrono::high_resolution_clock>
std::condition_variable dx::source< _event_t, _clock_t >::condition_variable
protectedinherited

◆ duration

template<typename event_t = event<kernel>, typename clock_t = std::chrono::high_resolution_clock>
clock_t::duration dx::timer< event_t, clock_t >::duration {clock_t::duration::zero()}
protected

◆ event

template<typename _event_t = event<user>, typename _clock_t = std::chrono::high_resolution_clock>
_event_t dx::source< _event_t, _clock_t >::event
protectedinherited
Todo
evaluate clock::status replacement (exception?)

◆ mutex

template<typename _event_t = event<user>, typename _clock_t = std::chrono::high_resolution_clock>
std::mutex dx::source< _event_t, _clock_t >::mutex
protectedinherited

◆ objective

template<typename _event_t = event<user>, typename _clock_t = std::chrono::high_resolution_clock>
_clock_t::time_point dx::source< _event_t, _clock_t >::objective
protectedinherited

◆ running

template<typename _event_t = event<user>, typename _clock_t = std::chrono::high_resolution_clock>
std::atomic<bool> dx::source< _event_t, _clock_t >::running {false}
protectedinherited

◆ status

template<typename _event_t = event<user>, typename _clock_t = std::chrono::high_resolution_clock>
os_result dx::source< _event_t, _clock_t >::status {not_initialized}
protectedinherited

◆ strategy

template<typename event_t = event<kernel>, typename clock_t = std::chrono::high_resolution_clock>
std::atomic<dx::stream::clock::strategy> dx::timer< event_t, clock_t >::strategy {dx::stream::clock::plain}

switchable at runtime: the poll modes run only what the timer left


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

(c) copyright 2009 dynamic acoustics e.U. generated on

a closed source license may be obtained by requesting a written permission from dynamic acoustics e.U.
however - governmental use generally and military use especially is strictly prohibited though.