dxd - dynax driver framework 3.0.0d222
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

 dx_catchall_rethrow () virtual ~source()=default
virtual void sync (const typename clock_t::time_point &now)

Protected Member Functions

dx_catchall_rethrow() public super & wait (bool reset=false) override try
 < switchable at runtime: the poll modes run only what the timer left
void wait (int64_t remaining) try
 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

◆ dx_catchall_rethrow()

template<typename _event_t = event<user>, typename _clock_t = std::chrono::high_resolution_clock>
dx::source< _event_t, _clock_t >::dx_catchall_rethrow ( )
defaultinherited

◆ 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>
dx_catchall_rethrow() public super & dx::timer< event_t, clock_t >::wait ( bool reset = false)
inlineoverrideprotectedvirtual

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

Reimplemented from dx::source< _event_t, _clock_t >.

Reimplemented in dx::usb::clock::source< device_t >.

◆ 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

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.