Control Surface
main
MIDI Control Surface library for Arduino
|
Containers like Array, BitArray, DoublyLinkedList.
Classes | |
class | ArraySlice< T, N, Reverse, Const > |
Class for a view on a slice of an array. More... | |
struct | Array< T, N > |
An array wrapper for easy copying, comparing, and iterating. More... | |
class | BitArray< N > |
A class for arrays of bits. More... | |
class | DoublyLinkedList< Node > |
A class for doubly linked lists. More... | |
class | DoublyLinkable< Node > |
A class that can be inherited from to allow inserting into a DoublyLinkedList. More... | |
Typedefs | |
template<class T , size_t NumRows, size_t NumCols> | |
using | Array2D = Array<Array<T, NumCols>, NumRows> |
An easy alias for two-dimensional Arrays. | |
Functions | |
template<class T , size_t N, class G > | |
Array< T, N > | generateArray (G generator) |
Generate an array using the given generator. | |
template<size_t N, class G > | |
auto | generateArray (G generator) -> Array< decltype(generator()), N > |
Generate an array using the given generator. | |
template<class T , size_t N, class U > | |
Array< T, N > | copyAs (const Array< U, N > &src) |
Copy an Array to an Array of a different type. | |
template<class F , class U , size_t N> | |
Array< decltype(F{}(U{})), N > | apply (const Array< U, N > &src, F f) |
Apply a function to all elements of the array and return a copy. | |
template<class T , size_t N, class... Args> | |
Array< T, N > | fillArray (Args... args) |
Fill the array with the same value for each element. | |
template<class T , size_t N, class U , class V = U> | |
Array< T, N > | generateIncrementalArray (U start=0, V increment=V(1)) |
Generate an array where the first value is given, and the subsequent values are calculated as the previous value incremented with a given value: \( x[0] = \mathrm{start} \) \( x[k+1] = x[k] + \mathrm{increment} \) . | |
template<class T , size_t M, size_t N> | |
Array< T, M+N > | cat (const Array< T, M > &a, const Array< T, N > &b) |
Concatenate two arrays. | |
template<class T1 , class T2 , size_t N1, size_t N2, bool Reverse1, bool Reverse2, bool Const1, bool Const2> | |
Array< decltype(T1() *T2()), N1+N2 - 1 > | distribute (const ArraySlice< T1, N1, Reverse1, Const1 > &a, const ArraySlice< T2, N2, Reverse2, Const2 > &b) |
template<class T1 , class T2 , size_t N1, size_t N2, bool Reverse1, bool Const1> | |
Array< decltype(T1() *T2()), N1+N2 - 1 > | distribute (const ArraySlice< T1, N1, Reverse1, Const1 > &a, const Array< T2, N2 > &b) |
template<class T1 , class T2 , size_t N1, size_t N2, bool Reverse2, bool Const2> | |
Array< decltype(T1() *T2()), N1+N2 - 1 > | distribute (const Array< T1, N1 > &a, const ArraySlice< T2, N2, Reverse2, Const2 > &b) |
template<class T1 , class T2 , size_t N1, size_t N2> | |
Array< decltype(T1() *T2()), N1+N2 - 1 > | distribute (const Array< T1, N1 > &a, const Array< T2, N2 > &b) |
template<size_t Start, size_t End> | |
auto | slice () -> ArraySlice< T, abs_diff(Start, End)+1,(End< Start), false > |
template<size_t Start, size_t End> | |
auto | slice () const -> ArraySlice< T, abs_diff(Start, End)+1,(End< Start), true > |
template<size_t Start, size_t End> | |
auto | slice () const -> ArraySlice< T, abs_diff(End, Start)+1, Reverse ^(End< Start), Const > |
template<class T , size_t N, bool Reverse, bool Const> | |
ArraySlice< T, N, Reverse, Const >::iterator | operator+ (typename ArraySlice< T, N, Reverse, Const >::iterator::difference_type n, typename ArraySlice< T, N, Reverse, Const >::iterator a) |
<T, N, Reverse, Const>iterator | |
template<class T1 , class T2 , size_t N1, size_t N2, bool Reverse1, bool Reverse2, bool Const1, bool Const2> | |
bool | operator== (ArraySlice< T1, N1, Reverse1, Const1 > a, ArraySlice< T2, N2, Reverse2, Const2 > b) |
Slice == Slice. | |
template<class T1 , class T2 , size_t N1, size_t N2, bool Reverse2, bool Const2> | |
bool | operator== (const Array< T1, N1 > &a, ArraySlice< T2, N2, Reverse2, Const2 > b) |
Array == Slice. | |
template<class T1 , class T2 , size_t N1, size_t N2, bool Reverse1, bool Const1> | |
bool | operator== (ArraySlice< T1, N1, Reverse1, Const1 > a, const Array< T2, N2 > &b) |
Slice == Array. | |
template<class T1 , class T2 , size_t N1, size_t N2, bool Reverse1, bool Reverse2, bool Const1, bool Const2> | |
bool | operator!= (ArraySlice< T1, N1, Reverse1, Const1 > a, ArraySlice< T2, N2, Reverse2, Const2 > b) |
Slice != Slice. | |
template<class T1 , class T2 , size_t N1, size_t N2, bool Reverse2, bool Const2> | |
bool | operator!= (const Array< T1, N1 > &a, ArraySlice< T2, N2, Reverse2, Const2 > b) |
Array != Slice. | |
template<class T1 , class T2 , size_t N1, size_t N2, bool Reverse1, bool Const1> | |
bool | operator!= (ArraySlice< T1, N1, Reverse1, Const1 > a, const Array< T2, N2 > &b) |
Slice != Array. | |
template<class T1 , class T2 , size_t N1, size_t N2, bool Reverse1, bool Reverse2, bool Const1, bool Const2> | |
Array< decltype(T1 {}+T2 {}), N1 > | operator+ (ArraySlice< T1, N1, Reverse1, Const1 > a, ArraySlice< T2, N2, Reverse2, Const2 > b) |
Slice + Slice. | |
template<class T1 , class T2 , size_t N1, size_t N2> | |
Array< decltype(T1 {}+T2 {}), N1 > | operator+ (const Array< T1, N1 > &a, const Array< T2, N2 > &b) |
Array + Array. | |
template<class T1 , class T2 , size_t N1, size_t N2, bool Reverse1, bool Reverse2, bool Const1, bool Const2> | |
const ArraySlice< T1, N1, Reverse1, Const1 > & | operator+= (const ArraySlice< T1, N1, Reverse1, Const1 > &a, const ArraySlice< T2, N2, Reverse2, Const2 > &b) |
Slice += Slice. | |
template<class T1 , class T2 , size_t N1, size_t N2> | |
Array< T1, N1 > & | operator+= (Array< T1, N1 > &a, const Array< T2, N2 > &b) |
Array += Array. | |
template<class T1 , class T2 , size_t N1, size_t N2, bool Reverse1, bool Reverse2, bool Const1, bool Const2> | |
Array< decltype(T1 {} - T2 {}), N1 > | operator- (ArraySlice< T1, N1, Reverse1, Const1 > a, ArraySlice< T2, N2, Reverse2, Const2 > b) |
Slice - Slice. | |
template<class T1 , class T2 , size_t N1, size_t N2> | |
Array< decltype(T1 {} - T2 {}), N1 > | operator- (const Array< T1, N1 > &a, const Array< T2, N2 > &b) |
Array - Array. | |
template<class T1 , class T2 , size_t N1, size_t N2, bool Reverse1, bool Reverse2, bool Const1, bool Const2> | |
const ArraySlice< T1, N1, Reverse1, Const1 > & | operator-= (const ArraySlice< T1, N1, Reverse1, Const1 > &a, const ArraySlice< T2, N2, Reverse2, Const2 > &b) |
Slice -= Slice. | |
template<class T1 , class T2 , size_t N1, size_t N2> | |
Array< T1, N1 > & | operator-= (Array< T1, N1 > &a, const Array< T2, N2 > &b) |
Array -= Array. | |
template<class T1 , class T2 , size_t N1, bool Reverse1, bool Const1> | |
Array< decltype(T1 {} *T2 {}), N1 > | operator* (ArraySlice< T1, N1, Reverse1, Const1 > a, T2 b) |
Slice * Scalar. | |
template<class T1 , class T2 , size_t N1> | |
Array< decltype(T1 {} *T2 {}), N1 > | operator* (const Array< T1, N1 > &a, T2 b) |
Array * Scalar. | |
template<class T1 , class T2 , size_t N2, bool Reverse2, bool Const2> | |
Array< decltype(T1 {} *T2 {}), N2 > | operator* (T1 a, ArraySlice< T2, N2, Reverse2, Const2 > b) |
Scalar * Slice. | |
template<class T1 , class T2 , size_t N2> | |
Array< decltype(T1 {} *T2 {}), N2 > | operator* (T1 a, const Array< T2, N2 > &b) |
Scalar * Array. | |
template<class T1 , class T2 , size_t N1, bool Reverse1, bool Const1> | |
const ArraySlice< T1, N1, Reverse1, Const1 > & | operator*= (const ArraySlice< T1, N1, Reverse1, Const1 > &a, T2 b) |
Slice *= Scalar. | |
template<class T1 , class T2 , size_t N1> | |
Array< T1, N1 > & | operator*= (Array< T1, N1 > &a, T2 b) |
Array *= Scalar. | |
template<class T1 , class T2 , size_t N1, bool Reverse1, bool Const1> | |
Array< decltype(T1 {}/T2 {}), N1 > | operator/ (ArraySlice< T1, N1, Reverse1, Const1 > a, T2 b) |
Slice / Scalar. | |
template<class T1 , class T2 , size_t N1> | |
Array< decltype(T1 {}/T2 {}), N1 > | operator/ (const Array< T1, N1 > &a, T2 b) |
Array / Scalar. | |
template<class T1 , class T2 , size_t N1, bool Reverse1, bool Const1> | |
const ArraySlice< T1, N1, Reverse1, Const1 > & | operator/= (const ArraySlice< T1, N1, Reverse1, Const1 > &a, T2 b) |
Slice /= Scalar. | |
template<class T1 , class T2 , size_t N1> | |
Array< T1, N1 > & | operator/= (Array< T1, N1 > &a, T2 b) |
Array /= Scalar. | |
template<class T , size_t N, bool Reverse, bool Const> | |
Array< decltype(-T {}), N > | operator- (ArraySlice< T, N, Reverse, Const > a) |
-Slice | |
template<class T , size_t N> | |
Array< decltype(-T {}), N > | operator- (const Array< T, N > &a) |
-Array | |
Generate an array using the given generator.
T | The type of the elements in the array. |
N | The number of elements in the array. |
G | The generator functor type. |
generator | A functor that will be called to create each element. |
Definition at line 64 of file ArrayHelpers.hpp.
Generate an array using the given generator.
N | The number of elements in the array. |
G | The generator functor type. |
generator | A functor that will be called to create each element. |
Definition at line 84 of file ArrayHelpers.hpp.
Copy an Array to an Array of a different type.
T | The type of the new array. |
N | The number of elements in the arrays. |
U | The type of the source array. |
src | The source array to be copied. |
Definition at line 105 of file ArrayHelpers.hpp.
Apply a function to all elements of the array and return a copy.
Definition at line 117 of file ArrayHelpers.hpp.
Fill the array with the same value for each element.
Definition at line 129 of file ArrayHelpers.hpp.
Generate an array where the first value is given, and the subsequent values are calculated as the previous value incremented with a given value:
\( x[0] = \mathrm{start} \)
\( x[k+1] = x[k] + \mathrm{increment} \) .
For example:
is equivalent to
T | The type of the elements in the array. |
N | The number of elements in the array. |
U | The type of the initial value. |
V | The type of the value that will be added to each subsequent element. |
start | The first value in the array. |
increment | The value to add to each subsequent element of the array. |
Definition at line 176 of file ArrayHelpers.hpp.
Concatenate two arrays.
T | The type of the elements in the array. |
M | The number of elements in the first array. |
N | The number of elements in the second array. |
a | The first array. |
b | The second array. |
Definition at line 197 of file ArrayHelpers.hpp.
Array< decltype(T1() *T2()), N1+N2 - 1 > distribute | ( | const ArraySlice< T1, N1, Reverse1, Const1 > & | a, |
const ArraySlice< T2, N2, Reverse2, Const2 > & | b ) |
Definition at line 211 of file ArrayHelpers.hpp.
Array< decltype(T1() *T2()), N1+N2 - 1 > distribute | ( | const ArraySlice< T1, N1, Reverse1, Const1 > & | a, |
const Array< T2, N2 > & | b ) |
Definition at line 222 of file ArrayHelpers.hpp.
Array< decltype(T1() *T2()), N1+N2 - 1 > distribute | ( | const Array< T1, N1 > & | a, |
const ArraySlice< T2, N2, Reverse2, Const2 > & | b ) |
Definition at line 229 of file ArrayHelpers.hpp.
Array< decltype(T1() *T2()), N1+N2 - 1 > distribute | ( | const Array< T1, N1 > & | a, |
const Array< T2, N2 > & | b ) |
Definition at line 236 of file ArrayHelpers.hpp.
|
related |