Lumiera
0.pre.03
»edit your freedom«
|
#include "steam/engine/worker/tick-service.hpp"
Tick generating service for a periodic callback, with adjustable frequency.
Quick'n dirty implementation!
Definition at line 62 of file tick-service.hpp.
Public Member Functions | |
TickService (Tick callback) | |
void | activate (uint fps) |
set the periodic timer to run with a given frequency, starting now. More... | |
Private Types | |
typedef function< void(void)> | Tick |
Private Member Functions | |
void | timerLoop (Tick periodicFun) |
Private Member Functions inherited from ThreadJoinable<> | |
lib::Result< void > | join () |
put the caller into a blocking wait until this thread has terminated More... | |
Private Member Functions inherited from ThreadLifecycle< thread::PolicyResultJoin, void > | |
ThreadLifecycle (Launch launcher) | |
Primary constructor: Launch the new thread with flexible configuration. More... | |
ThreadLifecycle (string const &threadID, FUN &&threadFunction, ARGS &&...args) | |
Create a new thread to execute the given operation. More... | |
ThreadLifecycle (void(SUB::*memFun)(ARGS...), ARGS ...args) | |
Special variant to bind a subclass member function as thread operation. More... | |
operator bool () const | |
Is this thread »active« and thus tied to OS resources? More... | |
ThreadLifecycle () | |
derived classes may create a disabled thread | |
Private Attributes | |
volatile uint | timespan_ |
Static Private Attributes | |
static const uint | POLL_TIMEOUT = 1000 |
poll interval for new settings in wait state | |
Additional Inherited Members | |
Static Private Member Functions inherited from ThreadLifecycle< thread::PolicyResultJoin, void > | |
static auto | buildInvocation (W &wrapper, tuple< INVO... > &&invocation) |
Build the invocation tuple, using #invokeThreadFunction to delegate to the user-provided functor and arguments. | |
static auto | buildLauncher (INVO &&...args) |
Build a λ actually to launch the given thread operation later, after the thread-wrapper-object is fully initialised. More... | |
|
inline |
set the periodic timer to run with a given frequency, starting now.
Well, not actually now, but at the next opportunity. It should be now, but this implementation is sloppy! setting fps==0 halts (pauses) the timer.
Definition at line 95 of file tick-service.hpp.