Scanframe Modular Application 0.1.0
|
Template to make the sustain system call a class method regularly. More...
#include <Sustain.h>
Public Types | |
typedef bool(T::* | Pmf) (const timespec &t) |
Required type. | |
Public Types inherited from sf::SustainBase | |
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 | |
TSustain (T *self, Pmf pmf, int priority=spDefault, PtrVector *vector=nullptr) | |
One and only initializing constructor. | |
TSustain (const TSustain &)=delete | |
Prevent copying. | |
TSustain & | operator= (const TSustain &)=delete |
Prevent copying. | |
Public Member Functions inherited from sf::SustainBase | |
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. | |
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 Public Member Functions inherited from sf::SustainBase | |
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 passed vector. | |
Static Public Attributes inherited from sf::SustainBase | |
static PtrVector * | _defaultVector |
Pointer to the default vector which is automatically created when. | |
Protected Member Functions inherited from sf::SustainBase | |
SustainBase (PtrVector *vector, int priority) | |
Default Constructor adding itself to the passed vector. | |
~SustainBase () | |
oes not have to be virtual because this base class is not used must always be derived. | |
Protected Attributes inherited from sf::SustainBase | |
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. | |
Template to make the sustain system call a class method regularly.
T | Class containing the method. |
typedef bool(T::* sf::TSustain< T >::Pmf) (const timespec &t) |
Required type.
sf::TSustain< T >::TSustain | ( | T * | self, |
Pmf | pmf, | ||
int | priority = spDefault , |
||
PtrVector * | vector = nullptr |
||
) |
One and only initializing constructor.
self | This pointer. |
pmf | Pointer to member function. |
priority | The priority. |
vector | Optional pointer to vector keeping the instance. |
|
delete |
Prevent copying.
|
delete |
Prevent copying.