Arduino Helpers master
Utility library for Arduino
Classes | Namespaces | Macros | Functions
ArrayHelpers.hpp File Reference
#include "Array.hpp"
#include <AH/STL/algorithm>
#include <AH/PrintStream/PrintStream.hpp>
+ Include dependency graph for ArrayHelpers.hpp:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  Incrementor< T, V >
 Utility class that acts as a functor to return incremental values. More...
 

Namespaces

namespace  detail
 

Macros

#define USE_CONSTEXPR_ARRAY_HELPERS
 

Functions

template<class T , size_t N, class G >
Array< T, N > generateArray (G generator)
 Generate an array using the given generator. More...
 
template<size_t N, class G >
auto generateArray (G generator) -> Array< decltype(generator()), N >
 Generate an array using the given generator. More...
 
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. More...
 
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. More...
 
template<class T , size_t N, class... Args>
Array< T, N > fillArray (Args... args)
 Fill the array with the same value for each element. More...
 
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} \) . More...
 
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. 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+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<class T , size_t N, bool Reverse, bool Const>
std::enable_if_t< std::is_arithmetic< T >::value, Print & > operator<< (Print &os, const AH::ArraySlice< T, N, Reverse, Const > &a)
 
template<class T , size_t N>
std::enable_if_t< std::is_arithmetic< T >::value, Print & > operator<< (Print &os, const AH::Array< T, N > &a)
 

Macro Definition Documentation

◆ USE_CONSTEXPR_ARRAY_HELPERS

#define USE_CONSTEXPR_ARRAY_HELPERS

Definition at line 11 of file ArrayHelpers.hpp.

Function Documentation

◆ operator<<() [1/2]

std::enable_if_t< std::is_arithmetic< T >::value, Print & > operator<< ( Print &  os,
const AH::ArraySlice< T, N, Reverse, Const > &  a 
)

Definition at line 236 of file ArrayHelpers.hpp.

◆ operator<<() [2/2]

std::enable_if_t< std::is_arithmetic< T >::value, Print & > operator<< ( Print &  os,
const AH::Array< T, N > &  a 
)

Definition at line 236 of file ArrayHelpers.hpp.