dxd - dynax driver framework 3.0.2
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::usb::clock::source< device_t > Class Template Reference

USB bus frame clock source: one tick per bus frame - a high resolution OS timer wait toward the frame objective, optionally handing over to yield/spin polling covering user mode jitter for low latency sessions. More...

#include <dx_usb_clock.h>

Inheritance diagram for dx::usb::clock::source< device_t >:
Collaboration diagram for dx::usb::clock::source< device_t >:

Public Types

typedef _clock_t clock_t
typedef _event_t event_t

Public Member Functions

os_result readout(uint64_t& frame, int64_t& timestamp) noexcept
 the correlation's source: the bus frame counter with its timestamp, the timestamp clock
 source(device_t& device, typename dx::stream::settings<device_t>::transport& transport)
virtual void sync(const typename frame::time_point& now)
void sync(const clock_t::time_point &) override
 aligns the next tick and the frame↔timestamp correlation to the bus frame counter: one tick per frame - a tick behind by less than a round (the slot array's depth) gets every missed frame ticked in turn, one behind by a round or ahead is resynced
super& wait(bool= false) override

Static Public Member Functions

static int64_t now()

Public Attributes

std::atomic<dx::stream::clock::strategy> strategy
 switchable at runtime: the poll modes run only what the timer left
listener<dx::listen<std::function<void(const uint32_t &)>>> strategy_listener

Protected Member Functions

bool sleep(int64_t remaining)
void wait(int64_t remaining)
 waits the remaining ns by the strategy

Static Protected Member Functions

static void relax(dx::stream::clock::strategy strategy)

Protected Attributes

std::condition_variable condition_variable
frame::duration duration
_event_t event
std::mutex mutex
_clock_t::time_point objective
std::atomic<bool> running
os_result status

Detailed Description

template<typename device_t>
class dx::usb::clock::source< device_t >

USB bus frame clock source: one tick per bus frame - a high resolution OS timer wait toward the frame objective, optionally handing over to yield/spin polling covering user mode jitter for low latency sessions.

Member Typedef Documentation

◆ clock_t

typedef _clock_t dx::source<_event_t, _clock_t>::frame
inherited

◆ event_t

typedef _event_t dx::source<_event_t, _clock_t>::dx::event<kernel>
inherited

Constructor & Destructor Documentation

◆ source()

template<typename device_t>
dx::usb::clock::source<device_t>::source(device_t& device, typename dx::stream::settings<device_t>::transport& transport)
inline
Here is the call graph for this function:
Here is the caller graph for this function:

Member Function Documentation

◆ now()

template<typename device_t>
int64_t dx::usb::clock::source<device_t>::now()
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ readout()

template<typename device_t>
os_result dx::usb::clock::source<device_t>::readout(uint64_t& frame, int64_t& timestamp)
inlinenoexcept

the correlation's source: the bus frame counter with its timestamp, the timestamp clock

Here is the call graph for this function:

◆ relax()

void dx::timer<dx::event<kernel>, frame>::relax(dx::stream::clock::strategy strategy)
inlinestaticprotectedinherited

◆ sleep()

bool dx::timer<dx::event<kernel>, frame>::sleep(int64_t remaining)
inlineprotectedinherited
Here is the call graph for this function:

◆ sync() [1/2]

virtual void dx::source<_event_t, _clock_t>::sync(const typename frame::time_point& now)
inlinevirtualinherited

◆ sync() [2/2]

template<typename device_t>
void dx::usb::clock::source<device_t>::sync(const clock_t::time_point&)
inlineoverride

aligns the next tick and the frame↔timestamp correlation to the bus frame counter: one tick per frame - a tick behind by less than a round (the slot array's depth) gets every missed frame ticked in turn, one behind by a round or ahead is resynced

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wait() [1/2]

void dx::timer<dx::event<kernel>, frame>::wait(int64_t remaining)
inlineprotectedinherited

waits the remaining ns by the strategy

Here is the call graph for this function:
Here is the caller graph for this function:

◆ wait() [2/2]

template<typename device_t>
super& dx::usb::clock::source<device_t>::wait(bool= false)
inlineoverridevirtual

Reimplemented from dx::timer< dx::event< kernel >, frame >.

Here is the call graph for this function:

Member Data Documentation

◆ condition_variable

std::condition_variable dx::source<_event_t, _clock_t>::condition_variable
protectedinherited

◆ duration

frame::duration dx::timer<dx::event<kernel>, frame>::duration
protectedinherited

◆ event

_event_t dx::source<_event_t, _clock_t>::event
protectedinherited
Todo
evaluate clock::status replacement (exception?)

◆ mutex

std::mutex dx::source<_event_t, _clock_t>::mutex
protectedinherited

◆ objective

_clock_t::time_point dx::source<_event_t, _clock_t>::objective
protectedinherited

◆ running

std::atomic<bool> dx::source<_event_t, _clock_t>::running
protectedinherited

◆ status

os_result dx::source<_event_t, _clock_t>::status
protectedinherited

◆ strategy

std::atomic<dx::stream::clock::strategy> dx::timer<dx::event<kernel>, frame>::strategy
inherited

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

◆ strategy_listener

template<typename device_t>
listener<dx::listen<std::function<void(const uint32_t&)>>> dx::usb::clock::source<device_t>::strategy_listener
Initial value:
{
transport.sync_strategy.listen, {[this](const uint32_t& value){this->strategy= static_cast<dx::stream::clock::strategy>(value);}}}
std::atomic< dx::stream::clock::strategy > strategy
Definition dx_clock.h:178
strategy
Definition dx_stream.h:217
unsigned int uint32_t
Definition wdm/dxd_platform.h:117

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