Mistake on this page?
Report an issue in GitHub or email us
Public Member Functions
ArrayView< T,-1 > Struct Template Reference

ArrayView specialisation that handle dynamic array size. More...

#include <ArrayView.h>

Public Member Functions

 ArrayView ()
 Construct a view to an empty array. More...
 
 ArrayView (T *array_ptr, size_t array_size)
 Construct an array view from a pointer to a buffer and its size. More...
 
template<size_t Size>
 ArrayView (T(&elements)[Size])
 Construct an array view from the reference to an array. More...
 
template<size_t Size>
 ArrayView (ArrayView< T, Size > other)
 Construct a ArrayView object with a dynamic size from an ArrayView object with a static size. More...
 
size_t size () const
 Return the size of the array viewed. More...
 
T & operator[] (size_t index)
 Access to a mutable element of the array. More...
 
const T & operator[] (size_t index) const
 Access to an immutable element of the array. More...
 
T * data ()
 Get the raw pointer to the array. More...
 
const T * data () const
 Get the raw const pointer to the array. More...
 

Detailed Description

template<typename T>
struct ble::ArrayView< T,-1 >

ArrayView specialisation that handle dynamic array size.

Definition at line 174 of file ArrayView.h.

Constructor & Destructor Documentation

ArrayView ( )

Construct a view to an empty array.

Postcondition
a call to size() will return 0, and data() will return NULL.

Definition at line 181 of file ArrayView.h.

ArrayView ( T *  array_ptr,
size_t  array_size 
)

Construct an array view from a pointer to a buffer and its size.

Parameters
array_ptrPointer to the array data
array_sizeNumber of elements of T present in the array.
Postcondition
a call to size() will return array_size and data() will return array_tpr.

Definition at line 192 of file ArrayView.h.

ArrayView ( T(&)  elements[Size])

Construct an array view from the reference to an array.

Parameters
elementsReference to the array viewed.
Template Parameters
SizeNumber of elements of T presents in the array.
Postcondition
a call to size() will return Size, and data() will return a pointer to elements.

Definition at line 206 of file ArrayView.h.

ArrayView ( ArrayView< T, Size >  other)

Construct a ArrayView object with a dynamic size from an ArrayView object with a static size.

Parameters
otherThe ArrayView object used to construct this.

Definition at line 216 of file ArrayView.h.

Member Function Documentation

T* data ( )

Get the raw pointer to the array.

Returns
The raw pointer to the array.

Definition at line 262 of file ArrayView.h.

const T* data ( ) const

Get the raw const pointer to the array.

Returns
The raw pointer to the array.

Definition at line 272 of file ArrayView.h.

T& operator[] ( size_t  index)

Access to a mutable element of the array.

Parameters
indexElement index to access.
Returns
A reference to the element at the index specified in input.
Precondition
index shall be less than size().

Definition at line 238 of file ArrayView.h.

const T& operator[] ( size_t  index) const

Access to an immutable element of the array.

Parameters
indexElement index to access.
Returns
A const reference to the element at the index specified in input.
Precondition
index shall be less than size().

Definition at line 252 of file ArrayView.h.

size_t size ( ) const

Return the size of the array viewed.

Returns
The number of elements present in the array viewed.

Definition at line 224 of file ArrayView.h.

Important Information for this Arm website

This site uses cookies to store information on your computer. By continuing to use our site, you consent to our cookies. If you are not happy with the use of these cookies, please review our Cookie Policy to learn how they can be disabled. By disabling cookies, some features of the site will not work.