This is an old version of the documentation. View the latest version here.
Control Surface  1.0.0
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 <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 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 20 of file Updatable.hpp.

Constructor & Destructor Documentation

◆ Updatable()

template<class T = NormalUpdatable>
Updatable< T >::Updatable ( )
inlineprotected

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

Definition at line 23 of file Updatable.hpp.

◆ ~Updatable()

template<class T = NormalUpdatable>
virtual Updatable< T >::~Updatable ( )
inlinevirtual

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

Definition at line 27 of file Updatable.hpp.

Member Function Documentation

◆ update()

template<class T = NormalUpdatable>
virtual void Updatable< T >::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 >, Bankable::MIDIButtonMatrix< BankAddress, Sender, nb_rows, nb_cols >, Bankable::MIDIButtonMatrix< ManyMatrixAddresses< NumBanks, nb_rows, nb_cols >, DigitalCCSender, nb_rows, nb_cols >, Bankable::MIDIButtonMatrix< ManyMatrixAddresses< NumBanks, nb_rows, nb_cols >, DigitalNoteSender, nb_rows, nb_cols >, Bankable::MIDIButtonMatrix< MatrixAddress< nb_rows, nb_cols >, DigitalNoteSender, nb_rows, nb_cols >, Bankable::MIDIButtonMatrix< MatrixAddress< nb_rows, nb_cols >, DigitalCCSender, nb_rows, nb_cols >, Bankable::MIDIChordButton< Sender >, Bankable::MIDIChordButton< DigitalNoteSender >, AudioVULEDs< N >, VolumeControl< N >, Bankable::MIDIButtonLatched< BankAddress, Sender >, Bankable::MIDIButtonLatched< SingleAddress, DigitalNoteSender >, Bankable::MIDIButtonLatched< SingleAddress, DigitalCCSender >, Bankable::MIDIFilteredAnalogAddressable< BankAddress, Sender >, Bankable::MIDIFilteredAnalogAddressable< ManyAddresses< N >, ContinuousCCSender >, Bankable::MIDIFilteredAnalogAddressable< SingleAddress, ContinuousCCSender >, Bankable::MIDIButtonLatching< BankAddress, Sender >, Bankable::MIDIButtonLatching< SingleAddress, DigitalNoteSender >, Bankable::MIDIButtonLatching< SingleAddress, DigitalCCSender >, Bankable::MIDIIncrementDecrementButtons< BankAddress, RelativeSender, ResetSender >, Bankable::MIDIIncrementDecrementButtons< TwoManyAddresses< N >, RelativeCCSender, DigitalNoteSender >, Bankable::MIDIIncrementDecrementButtons< TwoSingleAddresses, RelativeCCSender, DigitalNoteSender >, MIDIFilteredAnalogAddressable< Sender >, Bankable::MIDIButton< BankAddress, Sender >, MIDIFilteredAnalogAddressable< ContinuousCCSender >, Bankable::MIDIButton< ManyAddresses< N >, DigitalCCSender >, Bankable::MIDIButton< SingleAddress, ProgramChangeSender >, Bankable::MIDIButton< ManyAddresses< N >, ProgramChangeSender >, Bankable::MIDIButton< ManyAddresses< N >, DigitalNoteSender >, Bankable::MIDIButton< SingleAddress, DigitalNoteSender >, Bankable::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 > >, GenericManyButtonsSelector< N, Callback >, GenericManyButtonsSelector< N >, GenericManyButtonsSelector< N, SelectorLEDsCallback< N > >, GenericIncrementDecrementSelector< N, Callback >, GenericIncrementSelector< N, Callback >, GenericIncrementDecrementSelector< N >, GenericIncrementDecrementSelector< N, SelectorLEDsCallback< N > >, GenericIncrementSelector< N >, GenericIncrementSelector< N, SelectorLEDsCallback< N > >, GenericSwitchSelector< Callback >, GenericSwitchSelector< SelectorSingleLEDCallback >, GenericSwitchSelector<>, Bankable::MIDIFilteredAnalog< BankAddress, Sender >, Bankable::MIDIFilteredAnalog< SingleAddress, PitchBendSender< 10 > >, Bankable::MIDIFilteredAnalog< ManyAddresses< N >, PitchBendSender< 10 > >, MIDIFilteredAnalog< Sender >, MIDIFilteredAnalog< PitchBendSender< 10 > >, Bankable::MIDIRotaryEncoder< Sender >, Bankable::MIDIRotaryEncoder< RelativeCCSender >, MIDIChordButton< Sender >, MIDIChordButton< DigitalNoteSender >, MIDIRotaryEncoder< Sender >, MIDIRotaryEncoder< RelativeCCSender >, Bankable::MIDIButtons< Sender, NUMBER_OF_BUTTONS >, Bankable::MIDIButtons< DigitalNoteSender, NUMBER_OF_BUTTONS >, Bankable::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()

template<class T = NormalUpdatable>
virtual void Updatable< T >::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 >, Bankable::MIDIButtonMatrix< BankAddress, Sender, nb_rows, nb_cols >, Bankable::MIDIButtonMatrix< ManyMatrixAddresses< NumBanks, nb_rows, nb_cols >, DigitalCCSender, nb_rows, nb_cols >, Bankable::MIDIButtonMatrix< ManyMatrixAddresses< NumBanks, nb_rows, nb_cols >, DigitalNoteSender, nb_rows, nb_cols >, Bankable::MIDIButtonMatrix< MatrixAddress< nb_rows, nb_cols >, DigitalNoteSender, nb_rows, nb_cols >, Bankable::MIDIButtonMatrix< MatrixAddress< nb_rows, nb_cols >, DigitalCCSender, nb_rows, nb_cols >, VolumeControl< N >, Bankable::MIDIChordButton< Sender >, Bankable::MIDIChordButton< DigitalNoteSender >, AudioVULEDs< N >, Bankable::MIDIButtonLatched< BankAddress, Sender >, Bankable::MIDIButtonLatched< SingleAddress, DigitalNoteSender >, Bankable::MIDIButtonLatched< SingleAddress, DigitalCCSender >, Bankable::MIDIFilteredAnalogAddressable< BankAddress, Sender >, Bankable::MIDIFilteredAnalogAddressable< ManyAddresses< N >, ContinuousCCSender >, Bankable::MIDIFilteredAnalogAddressable< SingleAddress, ContinuousCCSender >, Bankable::MIDIButtonLatching< BankAddress, Sender >, Bankable::MIDIButtonLatching< SingleAddress, DigitalNoteSender >, Bankable::MIDIButtonLatching< SingleAddress, DigitalCCSender >, MIDIFilteredAnalogAddressable< Sender >, Bankable::MIDIButton< BankAddress, Sender >, Bankable::MIDIIncrementDecrementButtons< BankAddress, RelativeSender, ResetSender >, MIDIFilteredAnalogAddressable< ContinuousCCSender >, Bankable::MIDIButton< ManyAddresses< N >, DigitalCCSender >, Bankable::MIDIButton< SingleAddress, ProgramChangeSender >, Bankable::MIDIButton< ManyAddresses< N >, ProgramChangeSender >, Bankable::MIDIButton< ManyAddresses< N >, DigitalNoteSender >, Bankable::MIDIButton< SingleAddress, DigitalNoteSender >, Bankable::MIDIButton< SingleAddress, DigitalCCSender >, Bankable::MIDIIncrementDecrementButtons< TwoManyAddresses< N >, RelativeCCSender, DigitalNoteSender >, Bankable::MIDIIncrementDecrementButtons< TwoSingleAddresses, RelativeCCSender, DigitalNoteSender >, MIDIButtonLatching< Sender >, MIDIButtonLatching< DigitalNoteSender >, MIDIButtonLatching< DigitalCCSender >, MIDIButton< Sender >, MIDIButton< DigitalNoteSender >, MIDIButton< DigitalCCSender >, MIDIButton< ProgramChangeSender >, MIDIIncrementDecrementButtons< RelativeSender, ResetSender >, MIDIIncrementDecrementButtons< RelativeCCSender, DigitalNoteSender >, GenericEncoderSelector< N, Callback >, GenericEncoderSelector< N >, GenericEncoderSelector< N, SelectorLEDsCallback< N > >, GenericIncrementDecrementSelector< N, Callback >, GenericIncrementSelector< N, Callback >, GenericManyButtonsSelector< N, Callback >, GenericIncrementDecrementSelector< N >, GenericIncrementDecrementSelector< N, SelectorLEDsCallback< N > >, GenericIncrementSelector< N >, GenericIncrementSelector< N, SelectorLEDsCallback< N > >, GenericManyButtonsSelector< N >, GenericManyButtonsSelector< N, SelectorLEDsCallback< N > >, GenericProgramChangeSelector< N, Callback >, GenericProgramChangeSelector< N >, GenericProgramChangeSelector< N, SelectorLEDsCallback< N > >, GenericSwitchSelector< Callback >, GenericSwitchSelector< SelectorSingleLEDCallback >, GenericSwitchSelector<>, Bankable::MIDIFilteredAnalog< BankAddress, Sender >, Bankable::MIDIFilteredAnalog< SingleAddress, PitchBendSender< 10 > >, Bankable::MIDIFilteredAnalog< ManyAddresses< N >, PitchBendSender< 10 > >, MIDIFilteredAnalog< Sender >, MIDIFilteredAnalog< PitchBendSender< 10 > >, Bankable::MIDIRotaryEncoder< Sender >, Bankable::MIDIRotaryEncoder< RelativeCCSender >, MIDIChordButton< Sender >, MIDIChordButton< DigitalNoteSender >, MIDIRotaryEncoder< Sender >, MIDIRotaryEncoder< RelativeCCSender >, Bankable::MIDIButtons< Sender, NUMBER_OF_BUTTONS >, Bankable::MIDIButtons< DigitalNoteSender, NUMBER_OF_BUTTONS >, Bankable::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]

template<class T = NormalUpdatable>
void Updatable< T >::enable ( )
inline

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

Definition at line 40 of file Updatable.hpp.

◆ disable() [1/4]

template<class T = NormalUpdatable>
void Updatable< T >::disable ( )
inline

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

Definition at line 50 of file Updatable.hpp.

◆ isEnabled()

template<class T = NormalUpdatable>
bool Updatable< T >::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 64 of file Updatable.hpp.

◆ beginAll()

template<class T = NormalUpdatable>
static void Updatable< T >::beginAll ( )
inlinestatic

Begin all enabled instances of this class.

See also
begin()

Definition at line 68 of file Updatable.hpp.

◆ updateAll()

template<class T = NormalUpdatable>
static void Updatable< T >::updateAll ( )
inlinestatic

Update all enabled instances of this class.

See also
update()
Examples
2.VU-Meter-OLED-USB-DAC.ino.

Definition at line 75 of file Updatable.hpp.

◆ enable() [2/4]

template<class T = NormalUpdatable>
static void Updatable< T >::enable ( Updatable< T > *  element)
inlinestatic

Definition at line 80 of file Updatable.hpp.

◆ enable() [3/4]

template<class T = NormalUpdatable>
static void Updatable< T >::enable ( Updatable< T > &  element)
inlinestatic

Definition at line 82 of file Updatable.hpp.

◆ enable() [4/4]

template<class T = NormalUpdatable>
template<class U , size_t N>
static void Updatable< T >::enable ( U(&)  array[N])
inlinestatic

Definition at line 85 of file Updatable.hpp.

◆ disable() [2/4]

template<class T = NormalUpdatable>
static void Updatable< T >::disable ( Updatable< T > *  element)
inlinestatic

Definition at line 90 of file Updatable.hpp.

◆ disable() [3/4]

template<class T = NormalUpdatable>
static void Updatable< T >::disable ( Updatable< T > &  element)
inlinestatic

Definition at line 92 of file Updatable.hpp.

◆ disable() [4/4]

template<class T = NormalUpdatable>
template<class U , size_t N>
static void Updatable< T >::disable ( U(&)  array[N])
inlinestatic

Definition at line 95 of file Updatable.hpp.

Member Data Documentation

◆ updatables

template<class T = NormalUpdatable>
DoublyLinkedList< Updatable< T > > Updatable< T >::updatables
staticprivate

Definition at line 101 of file Updatable.hpp.

◆ next

Updatable< T > * DoublyLinkable< Updatable< T > >::next
protectedinherited

Definition at line 301 of file LinkedList.hpp.

◆ previous

Updatable< T > * DoublyLinkable< Updatable< T > >::previous
protectedinherited

Definition at line 302 of file LinkedList.hpp.


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