HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
NET_Scheduler< ClockT, DurationT > Class Template Reference

#include <NET_WebScheduler.h>

Classes

class  Event
 

Public Types

using Callback = UT_Functor< void >
 
using TimePoint = std::chrono::time_point< ClockT, DurationT >
 
using Comparator = std::greater< Event >
 
using EventId = int
 

Public Member Functions

 NET_Scheduler ()
 
 ~NET_Scheduler ()
 
void start ()
 
void stop ()
 
void pause ()
 
void resume ()
 
EventId run (Callback func, bool run_on_main_thread=true)
 
template<class T >
EventId runIn (const T &t, Callback func, bool run_on_main_thread=true)
 
template<class T >
EventId runEvery (const T &t, Callback func, bool run_on_main_thread=true)
 
EventId runAt (const TimePoint &tp, Callback func, bool run_on_main_thread=true)
 
bool remove (EventId id)
 
DurationT elapsedTimeToNextEvent () const
 Get the amount of time until next event is ready. More...
 
void checkEvents ()
 
bool isQueueEmpty () const
 
bool isRunning () const
 
bool isPaused () const
 

Detailed Description

template<class ClockT, class DurationT>
class NET_Scheduler< ClockT, DurationT >

Definition at line 30 of file NET_WebScheduler.h.

Member Typedef Documentation

template<class ClockT, class DurationT>
using NET_Scheduler< ClockT, DurationT >::Callback = UT_Functor<void>

Definition at line 35 of file NET_WebScheduler.h.

template<class ClockT, class DurationT>
using NET_Scheduler< ClockT, DurationT >::Comparator = std::greater<Event>

Definition at line 37 of file NET_WebScheduler.h.

template<class ClockT, class DurationT>
using NET_Scheduler< ClockT, DurationT >::EventId = int

Definition at line 39 of file NET_WebScheduler.h.

template<class ClockT, class DurationT>
using NET_Scheduler< ClockT, DurationT >::TimePoint = std::chrono::time_point<ClockT, DurationT>

Definition at line 36 of file NET_WebScheduler.h.

Constructor & Destructor Documentation

template<typename ClockT , typename DurationT >
NET_Scheduler< ClockT, DurationT >::NET_Scheduler ( )

Definition at line 200 of file NET_WebScheduler.h.

template<typename ClockT , typename DurationT >
NET_Scheduler< ClockT, DurationT >::~NET_Scheduler ( )

Definition at line 215 of file NET_WebScheduler.h.

Member Function Documentation

template<typename ClockT , typename DurationT >
void NET_Scheduler< ClockT, DurationT >::checkEvents ( )

Definition at line 234 of file NET_WebScheduler.h.

template<class ClockT, class DurationT>
DurationT NET_Scheduler< ClockT, DurationT >::elapsedTimeToNextEvent ( ) const
inline

Get the amount of time until next event is ready.

Returns
elapsed time until next event is scheduled to be fired.

Definition at line 139 of file NET_WebScheduler.h.

template<class ClockT, class DurationT>
bool NET_Scheduler< ClockT, DurationT >::isPaused ( ) const
inline

Definition at line 159 of file NET_WebScheduler.h.

template<class ClockT, class DurationT>
bool NET_Scheduler< ClockT, DurationT >::isQueueEmpty ( ) const
inline

Definition at line 153 of file NET_WebScheduler.h.

template<class ClockT, class DurationT>
bool NET_Scheduler< ClockT, DurationT >::isRunning ( ) const
inline

Definition at line 158 of file NET_WebScheduler.h.

template<typename ClockT , typename DurationT >
void NET_Scheduler< ClockT, DurationT >::pause ( )

Definition at line 436 of file NET_WebScheduler.h.

template<typename ClockT , typename DurationT >
bool NET_Scheduler< ClockT, DurationT >::remove ( EventId  id)

Definition at line 265 of file NET_WebScheduler.h.

template<typename ClockT , typename DurationT >
void NET_Scheduler< ClockT, DurationT >::resume ( )

Definition at line 461 of file NET_WebScheduler.h.

template<class ClockT, class DurationT>
EventId NET_Scheduler< ClockT, DurationT >::run ( Callback  func,
bool  run_on_main_thread = true 
)
inline

Definition at line 101 of file NET_WebScheduler.h.

template<class ClockT, class DurationT>
EventId NET_Scheduler< ClockT, DurationT >::runAt ( const TimePoint tp,
Callback  func,
bool  run_on_main_thread = true 
)
inline

Definition at line 126 of file NET_WebScheduler.h.

template<class ClockT, class DurationT>
template<class T >
EventId NET_Scheduler< ClockT, DurationT >::runEvery ( const T t,
Callback  func,
bool  run_on_main_thread = true 
)
inline

Definition at line 114 of file NET_WebScheduler.h.

template<class ClockT, class DurationT>
template<class T >
EventId NET_Scheduler< ClockT, DurationT >::runIn ( const T t,
Callback  func,
bool  run_on_main_thread = true 
)
inline

Definition at line 107 of file NET_WebScheduler.h.

template<typename ClockT , typename DurationT >
void NET_Scheduler< ClockT, DurationT >::start ( )

Definition at line 399 of file NET_WebScheduler.h.

template<typename ClockT , typename DurationT >
void NET_Scheduler< ClockT, DurationT >::stop ( )

Definition at line 411 of file NET_WebScheduler.h.


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