dxd - dynax driver framework 3.0.0d222
cross platform open source driver development framework
Loading...
Searching...
No Matches
dx::clock< source_t > Class Template Referenceabstract

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>

Inheritance diagram for dx::clock< source_t >:
Collaboration diagram for dx::clock< source_t >:

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)
 dx_catchall_rethrow () virtual ~source()=default
virtual void halt () noexcept
 stop and remove clock thread
virtual void info (std::ostream &os) noexcept
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 sourcewait (bool reset=false) try
virtual ~clock ()

Protected Member Functions

realtimeinitialize (const std::chrono::high_resolution_clock::duration &resolution)
virtual void notify () noexcept
 notify change from device requiring streaming reset

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

Detailed Description

template<typename source_t = source<>>
class dx::clock< source_t >

realtime tick mechanism: one thread per clock - run/halt lifecycle and tick dispatch; the source_t base owns objective and wait

Member Typedef Documentation

◆ clock_t

template<typename source_t = source<>>
typedef source_t::clock_t dx::clock< source_t >::clock_t

◆ event_t

template<typename source_t = source<>>
typedef source_t::event_t dx::clock< source_t >::event_t

Constructor & Destructor Documentation

◆ clock() [1/2]

template<typename source_t = source<>>
dx::clock< source_t >::clock ( )
default

◆ clock() [2/2]

template<typename source_t = source<>>
template<typename... args_t>
dx::clock< source_t >::clock ( args_t &&... args)
inline

◆ ~clock()

template<typename source_t = source<>>
virtual dx::clock< source_t >::~clock ( )
inlinevirtual

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

◆ halt()

template<typename source_t = source<>>
virtual void dx::clock< source_t >::halt ( )
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

Here is the caller graph for this function:

◆ info()

template<typename source_t = source<>>
virtual void dx::clock< source_t >::info ( std::ostream & os)
inlinevirtualnoexcept

◆ initialize() [1/2]

template<typename source_t = source<>>
void dx::clock< source_t >::initialize ( const typename clock_t::duration & duration)
inline
Here is the caller graph for this function:

◆ initialize() [2/2]

realtime & dx::thread::prio::realtime::initialize ( const std::chrono::high_resolution_clock::duration & resolution)
inlineinherited
Todo
dx::thread::prio: replace experimental hardcoded preemption limit with real limit obtained from machine
Here is the call graph for this function:

◆ notify()

template<typename source_t = source<>>
virtual void dx::clock< source_t >::notify ( )
inlineprotectedvirtualnoexcept

notify change from device requiring streaming reset

◆ operator event_t &()

template<typename source_t = source<>>
dx::clock< source_t >::operator event_t & ( )
inlinenoexcept

◆ operator event_t *()

template<typename source_t = source<>>
dx::clock< source_t >::operator event_t * ( )
inlinenoexcept

◆ run()

template<typename source_t = source<>>
virtual void dx::clock< source_t >::run ( )
inlinevirtual

create and start clock thread

Here is the caller graph for this function:

◆ 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:

◆ tick()

template<typename source_t = source<>>
virtual void dx::clock< source_t >::tick ( )
pure virtual

◆ wait()

template<typename _event_t = event<user>, typename _clock_t = std::chrono::high_resolution_clock>
virtual source & dx::source< _event_t, _clock_t >::wait ( bool reset = false)
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 >.

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

◆ 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.