|
dxd - dynax driver framework 3.0.2
cross platform open source driver development framework
|
realtime tick mechanism: one thread per clock - run/halt lifecycle and tick dispatch; the source_t base owns objective and wait More...
#include <dx_clock.h>
Public Types | |
| typedef source_t::clock_t | clock_t |
| typedef source_t::event_t | event_t |
Public Member Functions | |
| clock()= default | |
| template<typename... args_t> | |
| clock(args_t&&... args) | |
| virtual void | halt() noexcept |
| stop and remove clock thread | |
| void | initialize(const typename clock_t::duration& duration) |
| operator event_t&() noexcept | |
| operator event_t*() noexcept | |
| virtual void | run() |
| create and start clock thread | |
| virtual void | sync(const typename clock_t::time_point& now) |
| virtual void | tick()= 0 |
| virtual source& | wait(bool reset= false) |
| virtual | ~clock() |
Protected Member Functions | |
| virtual void | discharge() noexcept |
| the thread's last act: releases what its ticks charged - an OS may tie such a resource to the thread that created it | |
| realtime& | initialize(const std::chrono::high_resolution_clock::duration& resolution) |
| virtual void | notify() noexcept |
| bool | self() const |
| the caller is the clock's own thread: a halt from its tick ends the loop, nobody joins it | |
Protected Attributes | |
| std::condition_variable | condition_variable |
| _event_t | event |
| std::mutex | mutex |
| _clock_t::time_point | objective |
| std::atomic<bool> | running{false} |
| os_result | status{not_initialized} |
realtime tick mechanism: one thread per clock - run/halt lifecycle and tick dispatch; the source_t base owns objective and wait
| typedef source_t::clock_t dx::clock<source_t>::clock_t |
| typedef source_t::event_t dx::clock<source_t>::event_t |
|
default |
|
inline |
|
inlineprotectedvirtualnoexcept |
the thread's last act: releases what its ticks charged - an OS may tie such a resource to the thread that created it
Reimplemented in dx::stream::group< _device_t, source_t >, dx::stream::group< device_t, dx::source<> >, and dx::stream::group< device_t, source_t >.
|
inlinevirtualnoexcept |
stop and remove clock thread
<halting from its own tick: the loop ends once the tick returns, nobody can join here
<elect the single caller allowed to join() - concurrent halt() callers (e.g. async surprise vs. the main test thread) would otherwise both reach join() on the same thread, undefined behavior
|
inline |
|
inlineinherited |
|
inlineprotectedvirtualnoexcept |
notify change from device requiring streaming reset
|
inlinevirtual |
create and start clock thread
Reimplemented in dx::stream::group< _device_t, source_t >, dx::stream::group< device_t, dx::source<> >, and dx::stream::group< device_t, source_t >.
|
inlineprotected |
the caller is the clock's own thread: a halt from its tick ends the loop, nobody joins it
|
inlinevirtualinherited |
|
pure virtual |
|
inlinevirtualinherited |
Reimplemented in dx::free_run< event_t, clock_t >, dx::timer< event_t, clock_t >, dx::timer< dx::event< kernel >, frame >, and dx::usb::clock::source< device_t >.
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |
|
protectedinherited |