Control Surface  1.1.1
MIDI Control Surface library for Arduino
Classes | Namespaces | Typedefs | Functions
Array.hpp File Reference
#include <AH/Settings/Warnings.hpp>
#include <AH/Error/Error.hpp>
#include <AH/STL/iterator>
#include <AH/STL/type_traits>
#include <stddef.h>
Include dependency graph for Array.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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  ArraySlice< T, N, Reverse, Const >
 Class for a view on a slice of an array. More...
 
class  ArraySlice< T, N, Reverse, Const >::Iterator
 

Namespaces

 AH
 

Typedefs

template<class T , size_t nb_rows, size_t nb_cols>
using Array2D = Array< Array< T, nb_cols >, nb_rows >
 An easy alias for two-dimensional Arrays. More...
 

Functions

template<class T >
constexpr T abs_diff (const T &a, const T &b)
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
template<class T1 , class T2 , size_t N1>
Array< decltype(T1{} *T2{}), N1 > operator* (const Array< T1, N1 > &a, T2 b)
 Array * Scalar. More...
 
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. More...
 
template<class T1 , class T2 , size_t N2>
Array< decltype(T1{} *T2{}), N2 > operator* (T1 a, const Array< T2, N2 > &b)
 Scalar * Array. More...
 
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. More...
 
template<class T1 , class T2 , size_t N1>
Array< T1, N1 > & operator*= (Array< T1, N1 > &a, T2 b)
 Array *= Scalar. More...
 
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. More...
 
template<class T1 , class T2 , size_t N1>
Array< decltype(T1{}/T2{}), N1 > operator/ (const Array< T1, N1 > &a, T2 b)
 Array / Scalar. More...
 
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. More...
 
template<class T1 , class T2 , size_t N1>
Array< T1, N1 > & operator/= (Array< T1, N1 > &a, T2 b)
 Array /= Scalar. More...
 
template<class T , size_t N, bool Reverse, bool Const>
Array< decltype(-T{}), N > operator- (ArraySlice< T, N, Reverse, Const > a)
 -Slice More...
 
template<class T , size_t N>
Array< decltype(-T{}), N > operator- (const Array< T, N > &a)
 -Array More...