MIDI Control Surface library for Arduino
|
Go to the documentation of this file.
9 #include <AH/Containers/LinkedList.hpp>
24 template <
class T = NormalUpdatable>
34 updatables.remove(
this);
38 virtual void update() = 0;
41 virtual void begin() = 0;
47 ERROR(
F(
"Error: This element is already enabled."), 0x1212);
50 updatables.append(
this);
57 ERROR(
F(
"Error: This element is already disabled."), 0x1213);
60 updatables.remove(
this);
69 bool isEnabled() {
return updatables.couldContain(
this); }
89 template <
class U,
size_t N>
99 template <
class U,
size_t N>
static void disable(U(&array)[N])
A super class for object that have to be updated regularly.
static void enable(Updatable &element)
static void disable(Updatable< T > &element)
static DoublyLinkedList< Updatable< T > > updatables
static void updateAll()
Update all enabled instances of this class.
void enable()
Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.
#define AH_DIAGNOSTIC_POP()
static void disable(Updatable< T > *element)
#define ERROR(msg, errc)
Print the error message and error code, and stop the execution if FATAL_ERRORS are enabled.
static void beginAll()
Begin all enabled instances of this class.
static void enable(Updatable *element)
Updatable()
Create an Updatabe and add it to the linked list of instances.
static void enable(U(&array)[N])
virtual ~Updatable()
Destructor: remove the updatable from the linked list of instances.
bool isEnabled()
Check if this updatable is enabled.
A class for doubly linked lists.
A class that can be inherited from to allow inserting into a DoublyLinkedList.
#define AH_DIAGNOSTIC_WERROR()
#define BEGIN_AH_NAMESPACE
void disable()
Disable this updatable: remove it from the linked list of instances, so it no longer gets updated aut...