Scanframe Modular Application 0.1.0
Loading...
Searching...
No Matches
sf::TSustain< T > Class Template Reference

Template to make the sustain system call a class method regularly. More...

#include <Sustain.h>

Inheritance diagram for sf::TSustain< T >:
Collaboration diagram for sf::TSustain< T >:

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.
 
TSustainoperator= (const TSustain &)=delete
 Prevent copying.
 
- Public Member Functions inherited from sf::SustainBase
 SustainBase (const SustainBase &)=delete
 Prevent copying.
 
SustainBaseoperator= (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.
 

Detailed Description

template<typename T>
class sf::TSustain< T >

Template to make the sustain system call a class method regularly.

Template Parameters
TClass containing the method.

Member Typedef Documentation

◆ Pmf

template<typename T >
typedef bool(T::* sf::TSustain< T >::Pmf) (const timespec &t)

Required type.

Constructor & Destructor Documentation

◆ TSustain() [1/2]

template<typename T >
sf::TSustain< T >::TSustain ( T *  self,
Pmf  pmf,
int  priority = spDefault,
PtrVector vector = nullptr 
)

One and only initializing constructor.

Parameters
selfThis pointer.
pmfPointer to member function.
priorityThe priority.
vectorOptional pointer to vector keeping the instance.

◆ TSustain() [2/2]

template<typename T >
sf::TSustain< T >::TSustain ( const TSustain< T > &  )
delete

Prevent copying.

Member Function Documentation

◆ operator=()

template<typename T >
TSustain & sf::TSustain< T >::operator= ( const TSustain< T > &  )
delete

Prevent copying.


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