![]() |
Scanframe Modular Application 0.1.0
|
Implements a class to hook a static function to the global main thread sustain call. More...
#include <Sustain.h>
Public Types | |
typedef bool(* | Pf) (const timespec &) |
Required type for the callback function. | |
![]() | |
enum | ESustainPriority : int { spDefault = 100 , spTimer = std::numeric_limits<int>::max() } |
Do not use an iterator because the sustain function could affect the vector itself. More... | |
typedef TVector< SustainBase * > | PtrVector |
Public Member Functions | |
StaticSustain (Pf pf, int priority=spDefault, PtrVector *vector=_defaultVector) | |
One and only constructor. | |
StaticSustain (const StaticSustain &)=delete | |
Prevent copying. | |
StaticSustain & | operator= (const StaticSustain &)=delete |
Prevent copying. | |
![]() | |
SustainBase (const SustainBase &)=delete | |
Prevent copying. | |
SustainBase & | operator= (const SustainBase &)=delete |
Prevent copying. | |
int | getPriority () const |
Gets the priority value of this instance;. | |
void | setInterval (const timespec &interval) |
Sets the interval at which the hooked function is called. This is only valid when the priority for this entry is spTimer. | |
const timespec & | getInterval () const |
Gets the interval at which the hooked function is called. | |
void | enable () |
Enables this entry. | |
void | disable () |
Disables this entry. | |
bool | isEnabled () const |
Returns if the entry is enabled or not. | |
Additional Inherited Members | |
![]() | |
static void | flushVector (PtrVector *vector) |
Flushes the vector and clears all Vector member of all entries first. | |
static void | callSustain (PtrVector *vector=nullptr) |
Calls all sustain table entry functions in the vector passed. The default is the static default vector. | |
![]() | |
SustainBase (PtrVector *vector, int priority) | |
Default Constructor adding itself to the passed vector. If the passed vector is NULL the default vector is selected. | |
~SustainBase () | |
oes not have to be virtual because this base class is not used must always be derived. | |
![]() | |
int | _priority |
Data member holing priority. | |
PtrVector * | _list |
Vector where this entry is part of. | |
IntervalTimer | _timer |
Timer for when priority spTimer has been set. | |
![]() | |
static PtrVector * | _defaultVector |
Pointer to the default vector which is automatically created when. | |
Implements a class to hook a static function to the global main thread sustain call.
typedef bool(* sf::StaticSustain::Pf) (const timespec &) |
Required type for the callback function.
|
inlineexplicit |
One and only constructor.
pf | |
priority | |
vector |
|
delete |
Prevent copying.
|
delete |
Prevent copying.