Kenji Arai / mbed-os_TYBLE16

Dependents:   TYBLE16_simple_data_logger TYBLE16_MP3_Air

Embed: (wiki syntax)

« Back to documentation index

Span class

Data Structures

struct  Span< ElementType, Extent >
 Nonowning view to a sequence of contiguous elements. More...
struct  Span< ElementType, SPAN_DYNAMIC_EXTENT >
 Span specialization that handle dynamic size. More...

Functions

template<typename T , ptrdiff_t LhsExtent, ptrdiff_t RhsExtent>
bool operator== (const Span< T, LhsExtent > &lhs, T(&rhs)[RhsExtent])
 Equality operation between a Span and a reference to a C++ array.
template<typename T , ptrdiff_t LhsExtent, ptrdiff_t RhsExtent>
bool operator== (T(&lhs)[LhsExtent], const Span< T, RhsExtent > &rhs)
 Equality operation between a Span and a reference to a C++ array.
template<typename T , ptrdiff_t LhsExtent, ptrdiff_t RhsExtent>
bool operator!= (const Span< T, LhsExtent > &lhs, T(&rhs)[RhsExtent])
 Not Equal operation between a Span and a reference to a C++ array.
template<typename T , ptrdiff_t LhsExtent, ptrdiff_t RhsExtent>
bool operator!= (T(&lhs)[LhsExtent], const Span< T, RhsExtent > &rhs)
 Not Equal operation between a Span and a reference to a C++ array.
template<ptrdiff_t Extent, typename T >
Span< T, Extent > make_Span (T *elements)
 Generate a Span from a pointer to a C/C++ array.
template<typename T , size_t Extent>
Span< const T, Extent > make_const_Span (const T(&elements)[Extent])
 Generate a Span to a const content from a reference to a C/C++ array.
template<typename T , typename U , ptrdiff_t LhsExtent, ptrdiff_t RhsExtent>
bool operator== (const Span< T, LhsExtent > &lhs, const Span< U, RhsExtent > &rhs)
 Equality operator between two Span objects.
template<typename T , typename U , ptrdiff_t LhsExtent, ptrdiff_t RhsExtent>
bool operator!= (const Span< T, LhsExtent > &lhs, const Span< U, RhsExtent > &rhs)
 Not equal operator.
template<typename T , size_t Size>
Span< T, Size > make_Span (T(&elements)[Size])
 Generate a Span from a reference to a C/C++ array.
template<typename T >
Span< T > make_Span (T *array_ptr, ptrdiff_t array_size)
 Generate a Span from a C/C++ pointer and the size of the array.
template<size_t Extent, typename T >
Span< const T, Extent > make_const_Span (const T *elements)
 Generate a Span to a const content from a pointer to a C/C++ array.
template<typename T >
Span< const T > make_const_Span (T *array_ptr, size_t array_size)
 Generate a Span to a const content from a C/C++ pointer and the size of the array.

Variables

const ptrdiff_t SPAN_DYNAMIC_EXTENT = -1
 Special value for the Extent parameter of Span.

Function Documentation

Span<const T, Extent> mbed::make_const_Span ( const T(&)  elements[Extent] )

Generate a Span to a const content from a reference to a C/C++ array.

Template Parameters:
TType of elements held in elements.
ExtentNumber of items held in elements.
Parameters:
elementsThe array viewed.
Returns:
The Span to elements.
Note:
This helper avoids the typing of template parameter when Span is created 'inline'.

Definition at line 972 of file Span.h.

Span< const T, Extent > make_const_Span ( const T *  elements ) [related, inherited]

Generate a Span to a const content from a pointer to a C/C++ array.

Template Parameters:
ExtentNumber of items held in elements.
TType of elements held in elements.
Parameters:
elementsThe reference to the array viewed.
Returns:
The Span to elements.
Note:
This helper avoids the typing of template parameter when Span is created 'inline'.

Definition at line 993 of file Span.h.

Span< const T > make_const_Span ( T *  array_ptr,
size_t  array_size 
) [related, inherited]

Generate a Span to a const content from a C/C++ pointer and the size of the array.

Template Parameters:
TType of elements held in array_ptr.
Parameters:
array_ptrThe pointer to the array to viewed.
array_sizeThe number of T elements in the array.
Returns:
The Span to array_ptr with a size of array_size.
Note:
This helper avoids the typing of template parameter when Span is created 'inline'.

Definition at line 1015 of file Span.h.

Span< T, Size > make_Span ( T(&)  elements[Size] ) [related, inherited]

Generate a Span from a reference to a C/C++ array.

Template Parameters:
TType of elements held in elements.
ExtentNumber of items held in elements.
Parameters:
elementsThe reference to the array viewed.
Returns:
The Span to elements.
Note:
This helper avoids the typing of template parameter when Span is created 'inline'.

Definition at line 914 of file Span.h.

Span< T > make_Span ( T *  array_ptr,
ptrdiff_t  array_size 
) [related, inherited]

Generate a Span from a C/C++ pointer and the size of the array.

Template Parameters:
TType of elements held in array_ptr.
Parameters:
array_ptrThe pointer to the array viewed.
array_sizeThe number of T elements in the array.
Returns:
The Span to array_ptr with a size of array_size.
Note:
This helper avoids the typing of template parameter when Span is created 'inline'.

Definition at line 954 of file Span.h.

Span<T, Extent> mbed::make_Span ( T *  elements )

Generate a Span from a pointer to a C/C++ array.

Template Parameters:
ExtentNumber of items held in elements.
TType of elements held in elements.
Parameters:
elementsThe reference to the array viewed.
Returns:
The Span to elements.
Note:
This helper avoids the typing of template parameter when Span is created 'inline'.

Definition at line 933 of file Span.h.

bool operator!= ( const Span< T, LhsExtent > &  lhs,
const Span< U, RhsExtent > &  rhs 
) [related, inherited]

Not equal operator.

Parameters:
lhsLeft side of the binary operation.
rhsRight side of the binary operation.
Returns:
True if arrays in input do not have the same size or the same content and false otherwise.

Definition at line 863 of file Span.h.

bool mbed::operator!= ( const Span< T, LhsExtent > &  lhs,
T(&)  rhs[RhsExtent] 
)

Not Equal operation between a Span and a reference to a C++ array.

Parameters:
lhsLeft side of the binary operation.
rhsRight side of the binary operation.
Returns:
True if elements in input have the same size and the same content and false otherwise.

Definition at line 878 of file Span.h.

bool mbed::operator!= ( T(&)  lhs[LhsExtent],
const Span< T, RhsExtent > &  rhs 
)

Not Equal operation between a Span and a reference to a C++ array.

Parameters:
lhsLeft side of the binary operation.
rhsRight side of the binary operation.
Returns:
True if elements in input have the same size and the same content and false otherwise.

Definition at line 893 of file Span.h.

bool operator== ( const Span< T, LhsExtent > &  lhs,
const Span< U, RhsExtent > &  rhs 
) [related, inherited]

Equality operator between two Span objects.

Parameters:
lhsLeft side of the binary operation.
rhsRight side of the binary operation.
Returns:
True if Spans in input have the same size and the same content and false otherwise.

Definition at line 806 of file Span.h.

bool mbed::operator== ( T(&)  lhs[LhsExtent],
const Span< T, RhsExtent > &  rhs 
)

Equality operation between a Span and a reference to a C++ array.

Parameters:
lhsLeft side of the binary operation.
rhsRight side of the binary operation.
Returns:
True if elements in input have the same size and the same content and false otherwise.

Definition at line 846 of file Span.h.

bool mbed::operator== ( const Span< T, LhsExtent > &  lhs,
T(&)  rhs[RhsExtent] 
)

Equality operation between a Span and a reference to a C++ array.

Parameters:
lhsLeft side of the binary operation.
rhsRight side of the binary operation.
Returns:
True if elements in input have the same size and the same content and false otherwise.

Definition at line 831 of file Span.h.


Variable Documentation

const ptrdiff_t SPAN_DYNAMIC_EXTENT = -1 [related, inherited]

Special value for the Extent parameter of Span.

If the type uses this value, then the size of the array is stored in the object at runtime.

Definition at line 68 of file Span.h.