Control Surface  1.1.1
MIDI Control Surface library for Arduino
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Static Private Attributes | List of all members
Updatable< T > Class Template Referenceabstract

A super class for object that have to be updated regularly. More...

#include <AH/Containers/Updatable.hpp>

Inheritance diagram for Updatable< T >:
Collaboration diagram for Updatable< T >:

Public Member Functions

virtual ~Updatable ()
 Destructor: remove the updatable from the linked list of instances. More...
 
virtual void update ()=0
 Update this updatable. More...
 
virtual void begin ()=0
 Initialize this updatable. More...
 
void enable ()
 Enable this updatable: insert it into the linked list of instances, so it gets updated automatically. More...
 
void disable ()
 Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically. More...
 
bool isEnabled ()
 Check if this updatable is enabled. More...
 

Static Public Member Functions

static void beginAll ()
 Begin all enabled instances of this class. More...
 
static void updateAll ()
 Update all enabled instances of this class. More...
 
static void enable (Updatable *element)
 
static void enable (Updatable &element)
 
template<class U , size_t N>
static void enable (U(&array)[N])
 
static void disable (Updatable< T > *element)
 
static void disable (Updatable< T > &element)
 
template<class U , size_t N>
static void disable (U(&array)[N])
 

Protected Member Functions

 Updatable ()
 Create an Updatabe and add it to the linked list of instances. More...
 

Protected Attributes

Updatable< T > * next
 
Updatable< T > * previous
 

Static Private Attributes

static DoublyLinkedList< Updatable< T > > updatables
 

Detailed Description

template<class T = NormalUpdatable>
class AH::Updatable< T >

A super class for object that have to be updated regularly.

All instances of this class are kept in a linked list, so it's easy to iterate over all of them to update them.

Definition at line 25 of file Updatable.hpp.

Constructor & Destructor Documentation

◆ Updatable()

Updatable ( )
inlineprotected

Create an Updatabe and add it to the linked list of instances.

Definition at line 28 of file Updatable.hpp.

◆ ~Updatable()

virtual ~Updatable ( )
inlinevirtual

Destructor: remove the updatable from the linked list of instances.

Definition at line 32 of file Updatable.hpp.

Member Function Documentation

◆ update()

virtual void update ( )
pure virtual

Update this updatable.

Implemented in GenericSelector< N, Callback >, GenericSelector< N >, GenericSelector< 2, Callback >, GenericSelector< N, SelectorLEDsCallback< N > >, GenericSelector< 2, EmptySelectorCallback >, GenericSelector< N, EmptySelectorCallback >, GenericSelector< 2, SelectorSingleLEDCallback >, MIDIButtonMatrix< BankAddress, Sender, nb_rows, nb_cols >, MIDIButtonMatrix< ManyMatrixAddresses< NumBanks, nb_rows, nb_cols >, DigitalCCSender, nb_rows, nb_cols >, MIDIButtonMatrix< ManyMatrixAddresses< NumBanks, nb_rows, nb_cols >, DigitalNoteSender, nb_rows, nb_cols >, MIDIButtonMatrix< MatrixAddress< nb_rows, nb_cols >, DigitalNoteSender, nb_rows, nb_cols >, MIDIButtonMatrix< MatrixAddress< nb_rows, nb_cols >, DigitalCCSender, nb_rows, nb_cols >, MIDIChordButton< Sender >, MIDIChordButton< DigitalNoteSender >, AudioVULEDs< N >, VolumeControl< N >, MIDIButtonLatched< BankAddress, Sender >, MIDIButtonLatched< SingleAddress, DigitalNoteSender >, MIDIButtonLatched< SingleAddress, DigitalCCSender >, MIDIFilteredAnalogAddressable< BankAddress, Sender >, MIDIFilteredAnalogAddressable< ManyAddresses< N >, ContinuousCCSender >, MIDIFilteredAnalogAddressable< SingleAddress, ContinuousCCSender >, MIDIButtonLatching< BankAddress, Sender >, MIDIButtonLatching< SingleAddress, DigitalNoteSender >, MIDIButtonLatching< SingleAddress, DigitalCCSender >, MIDIIncrementDecrementButtons< BankAddress, RelativeSender, ResetSender >, MIDIIncrementDecrementButtons< TwoManyAddresses< N >, RelativeCCSender, DigitalNoteSender >, MIDIIncrementDecrementButtons< TwoSingleAddresses, RelativeCCSender, DigitalNoteSender >, MIDIFilteredAnalogAddressable< Sender >, MIDIButton< BankAddress, Sender >, MIDIFilteredAnalogAddressable< ContinuousCCSender >, MIDIButton< ManyAddresses< N >, DigitalCCSender >, MIDIButton< SingleAddress, ProgramChangeSender >, MIDIButton< ManyAddresses< N >, ProgramChangeSender >, MIDIButton< ManyAddresses< N >, DigitalNoteSender >, MIDIButton< SingleAddress, DigitalNoteSender >, MIDIButton< SingleAddress, DigitalCCSender >, MIDIButtonLatching< Sender >, MIDIButtonLatching< DigitalNoteSender >, MIDIButtonLatching< DigitalCCSender >, MIDIButton< Sender >, MIDIIncrementDecrementButtons< RelativeSender, ResetSender >, MIDIButton< DigitalNoteSender >, MIDIButton< DigitalCCSender >, MIDIButton< ProgramChangeSender >, MIDIIncrementDecrementButtons< RelativeCCSender, DigitalNoteSender >, GenericEncoderSelector< N, Callback >, GenericEncoderSelector< N >, GenericEncoderSelector< N, SelectorLEDsCallback< N > >, MIDIAbsoluteEncoder< Sender >, MIDIAbsoluteEncoder< PitchBendSender< 14 > >, MIDIAbsoluteEncoder< ContinuousCCSender >, GenericManyButtonsSelector< N, Callback >, GenericManyButtonsSelector< N >, GenericManyButtonsSelector< N, SelectorLEDsCallback< N > >, GenericIncrementSelector< N, Callback >, GenericIncrementSelector< N >, GenericIncrementSelector< N, SelectorLEDsCallback< N > >, GenericIncrementDecrementSelector< N, Callback >, GenericIncrementDecrementSelector< N >, GenericIncrementDecrementSelector< N, SelectorLEDsCallback< N > >, GenericSwitchSelector< Callback >, GenericSwitchSelector< SelectorSingleLEDCallback >, GenericSwitchSelector<>, MIDIFilteredAnalog< BankAddress, Sender >, MIDIFilteredAnalog< SingleAddress, PitchBendSender< 10 > >, MIDIFilteredAnalog< ManyAddresses< N >, PitchBendSender< 10 > >, MIDIFilteredAnalog< Sender >, MIDIFilteredAnalog< PitchBendSender< 10 > >, MIDIRotaryEncoder< Sender >, MIDIRotaryEncoder< RelativeCCSender >, MIDIChordButton< Sender >, MIDIChordButton< DigitalNoteSender >, MIDIRotaryEncoder< Sender >, MIDIRotaryEncoder< RelativeCCSender >, MIDIButtons< Sender, NUMBER_OF_BUTTONS >, MIDIButtons< DigitalNoteSender, NUMBER_OF_BUTTONS >, MIDIButtons< DigitalCCSender, NUMBER_OF_BUTTONS >, MIDIButtonLatched< Sender >, MIDIButtonLatched< DigitalNoteSender >, MIDIButtonLatched< DigitalCCSender >, MIDIButtons< Sender, NUMBER_OF_BUTTONS >, MIDIButtons< DigitalNoteSender, NUMBER_OF_BUTTONS >, MIDIButtonMatrix< Sender, nb_rows, nb_cols >, MIDIButtonMatrix< DigitalCCSender, nb_rows, nb_cols >, and MIDIButtonMatrix< DigitalNoteSender, nb_rows, nb_cols >.

◆ begin()

virtual void begin ( )
pure virtual

Initialize this updatable.

Implemented in GenericSelector< N, Callback >, GenericSelector< N >, GenericSelector< 2, Callback >, GenericSelector< N, SelectorLEDsCallback< N > >, GenericSelector< 2, EmptySelectorCallback >, GenericSelector< N, EmptySelectorCallback >, GenericSelector< 2, SelectorSingleLEDCallback >, MIDIButtonMatrix< BankAddress, Sender, nb_rows, nb_cols >, MIDIButtonMatrix< ManyMatrixAddresses< NumBanks, nb_rows, nb_cols >, DigitalCCSender, nb_rows, nb_cols >, MIDIButtonMatrix< ManyMatrixAddresses< NumBanks, nb_rows, nb_cols >, DigitalNoteSender, nb_rows, nb_cols >, MIDIButtonMatrix< MatrixAddress< nb_rows, nb_cols >, DigitalNoteSender, nb_rows, nb_cols >, MIDIButtonMatrix< MatrixAddress< nb_rows, nb_cols >, DigitalCCSender, nb_rows, nb_cols >, VolumeControl< N >, MIDIChordButton< Sender >, MIDIChordButton< DigitalNoteSender >, AudioVULEDs< N >, MIDIButtonLatched< BankAddress, Sender >, MIDIButtonLatched< SingleAddress, DigitalNoteSender >, MIDIButtonLatched< SingleAddress, DigitalCCSender >, MIDIFilteredAnalogAddressable< BankAddress, Sender >, MIDIFilteredAnalogAddressable< ManyAddresses< N >, ContinuousCCSender >, MIDIFilteredAnalogAddressable< SingleAddress, ContinuousCCSender >, MIDIButtonLatching< BankAddress, Sender >, MIDIButtonLatching< SingleAddress, DigitalNoteSender >, MIDIButtonLatching< SingleAddress, DigitalCCSender >, MIDIFilteredAnalogAddressable< Sender >, MIDIButton< BankAddress, Sender >, MIDIIncrementDecrementButtons< BankAddress, RelativeSender, ResetSender >, MIDIFilteredAnalogAddressable< ContinuousCCSender >, MIDIButton< ManyAddresses< N >, DigitalCCSender >, MIDIButton< SingleAddress, ProgramChangeSender >, MIDIButton< ManyAddresses< N >, ProgramChangeSender >, MIDIButton< ManyAddresses< N >, DigitalNoteSender >, MIDIButton< SingleAddress, DigitalNoteSender >, MIDIButton< SingleAddress, DigitalCCSender >, MIDIIncrementDecrementButtons< TwoManyAddresses< N >, RelativeCCSender, DigitalNoteSender >, MIDIIncrementDecrementButtons< TwoSingleAddresses, RelativeCCSender, DigitalNoteSender >, MIDIButtonLatching< Sender >, MIDIButtonLatching< DigitalNoteSender >, MIDIButtonLatching< DigitalCCSender >, MIDIButton< Sender >, MIDIButton< DigitalNoteSender >, MIDIButton< DigitalCCSender >, MIDIButton< ProgramChangeSender >, MIDIIncrementDecrementButtons< RelativeSender, ResetSender >, MIDIIncrementDecrementButtons< RelativeCCSender, DigitalNoteSender >, MIDIAbsoluteEncoder< Sender >, MIDIAbsoluteEncoder< PitchBendSender< 14 > >, MIDIAbsoluteEncoder< ContinuousCCSender >, GenericEncoderSelector< N, Callback >, GenericEncoderSelector< N >, GenericEncoderSelector< N, SelectorLEDsCallback< N > >, GenericIncrementSelector< N, Callback >, GenericManyButtonsSelector< N, Callback >, GenericIncrementSelector< N >, GenericIncrementSelector< N, SelectorLEDsCallback< N > >, GenericManyButtonsSelector< N >, GenericManyButtonsSelector< N, SelectorLEDsCallback< N > >, GenericIncrementDecrementSelector< N, Callback >, GenericIncrementDecrementSelector< N >, GenericIncrementDecrementSelector< N, SelectorLEDsCallback< N > >, GenericProgramChangeSelector< N, Callback >, GenericProgramChangeSelector< N >, GenericProgramChangeSelector< N, SelectorLEDsCallback< N > >, GenericSwitchSelector< Callback >, GenericSwitchSelector< SelectorSingleLEDCallback >, GenericSwitchSelector<>, MIDIFilteredAnalog< BankAddress, Sender >, MIDIFilteredAnalog< SingleAddress, PitchBendSender< 10 > >, MIDIFilteredAnalog< ManyAddresses< N >, PitchBendSender< 10 > >, MIDIFilteredAnalog< Sender >, MIDIFilteredAnalog< PitchBendSender< 10 > >, MIDIRotaryEncoder< Sender >, MIDIRotaryEncoder< RelativeCCSender >, MIDIChordButton< Sender >, MIDIChordButton< DigitalNoteSender >, MIDIRotaryEncoder< Sender >, MIDIRotaryEncoder< RelativeCCSender >, MIDIButtons< Sender, NUMBER_OF_BUTTONS >, MIDIButtons< DigitalNoteSender, NUMBER_OF_BUTTONS >, MIDIButtons< DigitalCCSender, NUMBER_OF_BUTTONS >, MIDIButtonLatched< Sender >, MIDIButtonLatched< DigitalNoteSender >, MIDIButtonLatched< DigitalCCSender >, MIDIButtons< Sender, NUMBER_OF_BUTTONS >, MIDIButtons< DigitalNoteSender, NUMBER_OF_BUTTONS >, MIDIButtonMatrix< Sender, nb_rows, nb_cols >, MIDIButtonMatrix< DigitalCCSender, nb_rows, nb_cols >, and MIDIButtonMatrix< DigitalNoteSender, nb_rows, nb_cols >.

◆ enable() [1/4]

void enable ( )
inline

Enable this updatable: insert it into the linked list of instances, so it gets updated automatically.

Definition at line 45 of file Updatable.hpp.

◆ disable() [1/4]

void disable ( )
inline

Disable this updatable: remove it from the linked list of instances, so it no longer gets updated automatically.

Definition at line 55 of file Updatable.hpp.

◆ isEnabled()

bool isEnabled ( )
inline

Check if this updatable is enabled.

Note
Assumes that the updatable is not added to a different linked list by the user.

Definition at line 69 of file Updatable.hpp.

◆ beginAll()

static void beginAll ( )
inlinestatic

Begin all enabled instances of this class.

See also
begin()

Definition at line 73 of file Updatable.hpp.

◆ updateAll()

static void updateAll ( )
inlinestatic

Update all enabled instances of this class.

See also
update()

Definition at line 80 of file Updatable.hpp.

◆ enable() [2/4]

static void enable ( Updatable< T > *  element)
inlinestatic

Definition at line 85 of file Updatable.hpp.

◆ enable() [3/4]

static void enable ( Updatable< T > &  element)
inlinestatic

Definition at line 87 of file Updatable.hpp.

◆ enable() [4/4]

static void enable ( U(&)  array[N])
inlinestatic

Definition at line 90 of file Updatable.hpp.

◆ disable() [2/4]

static void disable ( Updatable< T > *  element)
inlinestatic

Definition at line 95 of file Updatable.hpp.

◆ disable() [3/4]

static void disable ( Updatable< T > &  element)
inlinestatic

Definition at line 97 of file Updatable.hpp.

◆ disable() [4/4]

static void disable ( U(&)  array[N])
inlinestatic

Definition at line 100 of file Updatable.hpp.

Member Data Documentation

◆ updatables

DoublyLinkedList< Updatable< T > > updatables
staticprivate

Definition at line 106 of file Updatable.hpp.

◆ next

Updatable< T > * next
protectedinherited

Definition at line 305 of file LinkedList.hpp.

◆ previous

Updatable< T > * previous
protectedinherited

Definition at line 306 of file LinkedList.hpp.


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