| 
    Diag-Client-Lib
    
   | 
 
A view over a contiguous sequence of objects. More...
#include <span.h>
Public Types | |
| using | element_type = T | 
| Type alias for the type of elements in this Span.  More... | |
| using | value_type = typename std::remove_cv< element_type >::type | 
| Type alias for the type of values in this Span.  More... | |
| using | size_type = std::size_t | 
| Type alias for the type of parameters that indicate a size or a number of values.  More... | |
| using | difference_type = std::ptrdiff_t | 
| Type alias for the type of parameters that indicate a difference of indexes into the Span.  More... | |
| using | pointer = element_type * | 
| Type alias type for a pointer to an element.  More... | |
| using | const_pointer = const element_type * | 
| Type alias type for a pointer to an const element.  More... | |
| using | reference = element_type & | 
| Type alias type for a reference to an element.  More... | |
| using | const_reference = const element_type & | 
| Type alias type for a reference to an const element.  More... | |
| using | iterator = pointer | 
| The type of an iterator to elements.  More... | |
| using | const_iterator = const_pointer | 
| The type of a const_iterator to elements.  More... | |
| using | reverse_iterator = std::reverse_iterator< iterator > | 
| The type of a reverse_iterator to elements.  More... | |
| using | const_reverse_iterator = std::reverse_iterator< const_iterator > | 
| The type of a const_reverse_iterator to elements.  More... | |
Public Member Functions | |
| template<std::size_t E = Extent, typename std::enable_if<(E==dynamic_extent||E==0), bool >::type = true> | |
| constexpr | Span () noexcept | 
| Default constructor.  More... | |
| constexpr | Span (pointer ptr, size_type count) | 
| Construct a new Span from the given pointer and size.  More... | |
| constexpr | Span (pointer first_elem, pointer last_elem) | 
| Construct a new Span from the open range between [first_elem, last_elem)  More... | |
| template<std::size_t N, std::size_t E = Extent, typename std::enable_if<(E==dynamic_extent||N==extent) &&details::is_container_element_type_convertible< element_type(&)[N], T >::value, bool >::type = true> | |
| constexpr | Span (element_type(&arr)[N]) noexcept | 
| Construct a new Span from the given raw array.  More... | |
| template<typename U , std::size_t N, std::size_t E = Extent, typename std::enable_if<(E==dynamic_extent||N==extent) &&details::is_container_element_type_convertible< std::array< U, N > &, T >::value, bool >::type = true> | |
| constexpr | Span (std::array< U, N > &arr) noexcept | 
| Construct a new Span from the given std::array.  More... | |
| template<typename U , std::size_t N, std::size_t E = Extent, typename std::enable_if<(E==dynamic_extent||N==extent) &&details::is_container_element_type_convertible< const std::array< U, N > &, T >::value, bool >::type = true> | |
| constexpr | Span (const std::array< U, N > &arr) noexcept | 
| Construct a new Span from the given const std::array.  More... | |
| template<typename Container , std::size_t E = Extent, typename std::enable_if<(E==dynamic_extent) &&details::is_container_type< Container >::value &&details::is_container_element_type_convertible< Container &, T >::value, bool >::type = true> | |
| constexpr | Span (Container &cont) noexcept | 
| Construct a new Span from the given container.  More... | |
| template<typename Container , std::size_t E = Extent, typename std::enable_if<(E==dynamic_extent) &&details::is_container_type< Container >::value &&details::is_container_element_type_convertible< Container &, T >::value, bool >::type = true> | |
| constexpr | Span (const Container &cont) noexcept | 
| Construct a new Span from the given const container.  More... | |
| constexpr | Span (const Span &) noexcept=default | 
| Copy construct a new Span from another instance.  More... | |
| template<typename U , std::size_t N, typename std::enable_if<(Extent==dynamic_extent||N==dynamic_extent||Extent==N) &&details::is_container_element_type_convertible< U(*)[], T(*)[]>::value >::type = true> | |
| constexpr | Span (const Span< U, N > &other_span) noexcept | 
| Converting constructor.  More... | |
| ~Span () noexcept=default | |
| Destructor.  More... | |
| constexpr Span & | operator= (const Span &other) noexcept=default | 
| Copy assignment operator.  More... | |
| template<std::size_t Count> | |
| constexpr Span< element_type, Count > | first () const | 
| Return a subspan containing only the first elements of this Span.  More... | |
| constexpr Span< element_type, dynamic_extent > | first (size_type count) const | 
| Return a subspan containing only the first elements of this Span.  More... | |
| template<std::size_t Count> | |
| constexpr Span< element_type, Count > | last () const | 
| Return a subspan containing only the last elements of this Span.  More... | |
| constexpr Span< element_type, dynamic_extent > | last (size_type count) const | 
| Return a subspan containing only the last elements of this Span.  More... | |
| template<std::size_t Offset, std::size_t Count = dynamic_extent> | |
| constexpr auto | subspan () const noexcept -> Span< element_type, Count !=dynamic_extent ? Count :(Extent !=dynamic_extent ? Extent - Offset :dynamic_extent)> | 
| Return a subspan of this Span.  More... | |
| constexpr Span< element_type, dynamic_extent > | subspan (size_type offset, size_type count=dynamic_extent) const | 
| Return a subspan of this Span.  More... | |
| constexpr size_type | size () const noexcept | 
| Return the size of this Span.  More... | |
| constexpr size_type | size_bytes () const noexcept | 
| Return the size of this Span in bytes.  More... | |
| constexpr bool | empty () const noexcept | 
| Return whether this Span is empty.  More... | |
| constexpr reference | operator[] (size_type idx) const | 
| Return a reference to the n-th element of this Span.  More... | |
| constexpr reference | front () const | 
| Return a reference to the first element of this Span.  More... | |
| constexpr reference | back () const | 
| Return a reference to the last element of this Span.  More... | |
| constexpr pointer | data () const noexcept | 
| Return a pointer to the start of the memory block covered by this Span.  More... | |
| constexpr iterator | begin () const noexcept | 
| Return an iterator pointing to the first element of this Span.  More... | |
| constexpr iterator | end () const noexcept | 
| Return an iterator pointing past the last element of this Span.  More... | |
| constexpr const_iterator | cbegin () const noexcept | 
| Return a const_iterator pointing to the first element of this Span.  More... | |
| constexpr const_iterator | cend () const noexcept | 
| Return a const_iterator pointing past the last element of this Span.  More... | |
| constexpr reverse_iterator | rbegin () const noexcept | 
| Return a reverse_iterator pointing to the last element of this Span.  More... | |
| constexpr reverse_iterator | rend () const noexcept | 
| Return a reverse_iterator pointing past the first element of this Span.  More... | |
| constexpr const_reverse_iterator | crbegin () const noexcept | 
| Return a const_reverse_iterator pointing to the last element of this Span.  More... | |
| constexpr const_reverse_iterator | crend () const noexcept | 
| Return a const_reverse_iterator pointing past the first element of this Span.  More... | |
Static Public Attributes | |
| static constexpr size_type | extent = Extent | 
| A constant reflecting the configured Extent of this Span.  More... | |
Private Attributes | |
| details::span_storage< T, Extent > | storage_ | 
| The storage of span related data.  More... | |
A view over a contiguous sequence of objects.
The type T is required to be a complete object type that is not an abstract class type. This class is implemented based on API specification of ara::core::Span from Adaptive Platform Core AUTOSAR AP R21-11
| using core_type::Span< T, Extent >::const_iterator = const_pointer | 
| using core_type::Span< T, Extent >::const_pointer = const element_type * | 
| using core_type::Span< T, Extent >::const_reference = const element_type & | 
| using core_type::Span< T, Extent >::const_reverse_iterator = std::reverse_iterator<const_iterator> | 
| using core_type::Span< T, Extent >::difference_type = std::ptrdiff_t | 
| using core_type::Span< T, Extent >::element_type = T | 
| using core_type::Span< T, Extent >::iterator = pointer | 
| using core_type::Span< T, Extent >::pointer = element_type * | 
| using core_type::Span< T, Extent >::reference = element_type & | 
| using core_type::Span< T, Extent >::reverse_iterator = std::reverse_iterator<iterator> | 
| using core_type::Span< T, Extent >::size_type = std::size_t | 
| using core_type::Span< T, Extent >::value_type = typename std::remove_cv<element_type>::type | 
      
  | 
  inlineconstexprnoexcept | 
      
  | 
  inlineconstexpr | 
Construct a new Span from the given pointer and size.
[ptr, ptr + count) shall be a valid range. If extent is not equal to dynamic_extent, then count shall be equal to Extent
| [in] | ptr | The pointer | 
| [in] | count | The number of elements to take from ptr | 
Definition at line 280 of file span.h.
References core_type::details::CheckIfExpectedOrAbort(), and core_type::dynamic_extent.

      
  | 
  inlineconstexpr | 
Construct a new Span from the open range between [first_elem, last_elem)
[first_elem, last_elem) shall be a valid range. If extent is not equal to dynamic_extent, then (last_elem - first_elem) shall be equal to extent
| [in] | first_elem | The pointer to the first element | 
| [in] | last_elem | The pointer to past the last element | 
Definition at line 294 of file span.h.
References core_type::details::CheckIfExpectedOrAbort(), and core_type::dynamic_extent.

      
  | 
  inlineexplicitconstexprnoexcept | 
Construct a new Span from the given raw array.
This constructor shall not participate in overload resolution unless: extent == dynamic_extent || N == extent is true, and std::remove_pointer_t<decltype(std::data(arr))>(*)[] is convertible to T(*)[]
| N | The size of the raw array | 
| [in] | arr | The raw array | 
Definition at line 314 of file span.h.
      
  | 
  inlineexplicitconstexprnoexcept | 
Construct a new Span from the given std::array.
This constructor shall not participate in overload resolution unless: extent == dynamic_extent || N == extent is true, and std::remove_pointer_t<decltype(std::data(arr))>(*)[] is convertible to T(*)[]
| U | The type of elements within the std::array | 
| N | The size of the raw array | 
| [in] | arr | The std::array | 
Definition at line 332 of file span.h.
      
  | 
  inlineexplicitconstexprnoexcept | 
Construct a new Span from the given const std::array.
This constructor shall not participate in overload resolution unless: extent == dynamic_extent || N == extent is true, and std::remove_pointer_t<decltype(std::data(arr))>(*)[] is convertible to T(*)[]
| U | The type of elements within the std::array | 
| N | The size of the raw array | 
| [in] | arr | The std::array | 
Definition at line 350 of file span.h.
      
  | 
  inlineexplicitconstexprnoexcept | 
Construct a new Span from the given container.
[std::data(cont), std::data(cont) + std::size(cont)) shall be a valid range. This constructor shall not participate in overload resolution unless: extent == dynamic_extent is true, Container is not a specialization of Span, Container is not a specialization of Array, Container is not a specialization of std::array, std::is_array<Container>::value is false, std::data(cont) and std::size(cont) are both well-formed, and std::remove_pointer_t<decltype(ara::core::data(cont))>(*)[] is convertible to T(*)[].
| Container | The type of container | 
| [in] | cont | The container | 
Definition at line 369 of file span.h.
      
  | 
  inlineexplicitconstexprnoexcept | 
Construct a new Span from the given const container.
[std::data(cont), std::data(cont) + std::size(cont)) shall be a valid range. This constructor shall not participate in overload resolution unless: extent == dynamic_extent is true, Container is not a specialization of Span, Container is not a specialization of Array, Container is not a specialization of std::array, std::is_array<Container>::value is false, std::data(cont) and std::size(cont) are both well-formed, and std::remove_pointer_t<decltype(ara::core::data(cont))>(*)[] is convertible to T(*)[].
| Container | The type of container | 
| [in] | cont | The container | 
Definition at line 388 of file span.h.
      
  | 
  constexprdefaultnoexcept | 
Copy construct a new Span from another instance.
      
  | 
  inlineexplicitconstexprnoexcept | 
Converting constructor.
This ctor allows construction of a cv-qualified Span from a normal Span, and also of a dynamic_extent-Span<> from a static extent-one. This constructor shall not participate in overload resolution unless: Extent == dynamic_extent || Extent == N is true, U(*)[] is convertible to T(*)[].
| [in] | other_span | The other Span instance | 
Definition at line 413 of file span.h.
      
  | 
  defaultnoexcept | 
Destructor.
      
  | 
  inlineconstexpr | 
Return a reference to the last element of this Span.
The behavior of this function is undefined if empty() is true
Definition at line 566 of file span.h.
References core_type::details::CheckIfExpectedOrAbort(), core_type::Span< T, Extent >::data(), core_type::Span< T, Extent >::empty(), and core_type::Span< T, Extent >::size().

      
  | 
  inlineconstexprnoexcept | 
Return an iterator pointing to the first element of this Span.
Definition at line 581 of file span.h.
References core_type::Span< T, Extent >::data().
Referenced by core_type::Span< T, Extent >::cbegin(), core_type::Span< T, Extent >::crend(), and core_type::Span< T, Extent >::rend().


      
  | 
  inlineconstexprnoexcept | 
Return a const_iterator pointing to the first element of this Span.
Definition at line 593 of file span.h.
References core_type::Span< T, Extent >::begin().

      
  | 
  inlineconstexprnoexcept | 
Return a const_iterator pointing past the last element of this Span.
Definition at line 599 of file span.h.
References core_type::Span< T, Extent >::end().

      
  | 
  inlineconstexprnoexcept | 
Return a const_reverse_iterator pointing to the last element of this Span.
Definition at line 617 of file span.h.
References core_type::Span< T, Extent >::end().

      
  | 
  inlineconstexprnoexcept | 
Return a const_reverse_iterator pointing past the first element of this Span.
Definition at line 625 of file span.h.
References core_type::Span< T, Extent >::begin().

      
  | 
  inlineconstexprnoexcept | 
Return a pointer to the start of the memory block covered by this Span.
Definition at line 575 of file span.h.
References core_type::Span< T, Extent >::storage_.
Referenced by core_type::Span< T, Extent >::back(), core_type::Span< T, Extent >::begin(), core_type::Span< T, Extent >::end(), core_type::Span< T, Extent >::first(), core_type::Span< T, Extent >::front(), core_type::Span< T, Extent >::last(), core_type::Span< T, Extent >::operator[](), and core_type::Span< T, Extent >::subspan().

      
  | 
  inlineconstexprnoexcept | 
Return whether this Span is empty.
Definition at line 538 of file span.h.
References core_type::Span< T, Extent >::size().
Referenced by core_type::Span< T, Extent >::back(), and core_type::Span< T, Extent >::front().


      
  | 
  inlineconstexprnoexcept | 
Return an iterator pointing past the last element of this Span.
Definition at line 587 of file span.h.
References core_type::Span< T, Extent >::data(), and core_type::Span< T, Extent >::size().
Referenced by core_type::Span< T, Extent >::cend(), core_type::Span< T, Extent >::crbegin(), and core_type::Span< T, Extent >::rbegin().


      
  | 
  inlineconstexpr | 
Return a subspan containing only the first elements of this Span.
The implementation shall ensure that (Count <= Extent) is true. The behavior of this function is undefined if (Count > size()).
| Count | The number of elements to take over | 
Definition at line 435 of file span.h.
References core_type::details::CheckIfExpectedOrAbort(), core_type::Span< T, Extent >::data(), and core_type::Span< T, Extent >::size().

      
  | 
  inlineconstexpr | 
Return a subspan containing only the first elements of this Span.
The behavior of this function is undefined if (count > size())
| [in] | count | The number of elements to take over | 
Definition at line 447 of file span.h.
References core_type::details::CheckIfExpectedOrAbort(), core_type::Span< T, Extent >::data(), and core_type::Span< T, Extent >::size().

      
  | 
  inlineconstexpr | 
Return a reference to the first element of this Span.
The behavior of this function is undefined if empty() is true
Definition at line 556 of file span.h.
References core_type::details::CheckIfExpectedOrAbort(), core_type::Span< T, Extent >::data(), and core_type::Span< T, Extent >::empty().

      
  | 
  inlineconstexpr | 
Return a subspan containing only the last elements of this Span.
The implementation shall ensure that (Count <= Extent) is true. The behavior of this function is undefined if (Count > size()).
| Count | The number of elements to take over | 
Definition at line 461 of file span.h.
References core_type::details::CheckIfExpectedOrAbort(), core_type::Span< T, Extent >::data(), and core_type::Span< T, Extent >::size().

      
  | 
  inlineconstexpr | 
Return a subspan containing only the last elements of this Span.
The behavior of this function is undefined if (count > size())
| [in] | count | The number of elements to take over | 
Definition at line 473 of file span.h.
References core_type::details::CheckIfExpectedOrAbort(), core_type::Span< T, Extent >::data(), and core_type::Span< T, Extent >::size().

      
  | 
  constexprdefaultnoexcept | 
Copy assignment operator.
      
  | 
  inlineconstexpr | 
Return a reference to the n-th element of this Span.
| [in] | idx | The index into this Span | 
Definition at line 546 of file span.h.
References core_type::details::CheckIfExpectedOrAbort(), core_type::Span< T, Extent >::data(), and core_type::Span< T, Extent >::size().

      
  | 
  inlineconstexprnoexcept | 
Return a reverse_iterator pointing to the last element of this Span.
Definition at line 605 of file span.h.
References core_type::Span< T, Extent >::end().

      
  | 
  inlineconstexprnoexcept | 
Return a reverse_iterator pointing past the first element of this Span.
Definition at line 611 of file span.h.
References core_type::Span< T, Extent >::begin().

      
  | 
  inlineconstexprnoexcept | 
Return the size of this Span.
Definition at line 526 of file span.h.
References core_type::Span< T, Extent >::storage_.
Referenced by core_type::Span< T, Extent >::back(), doip_client::DoipMessage::DoipMessage(), core_type::Span< T, Extent >::empty(), core_type::Span< T, Extent >::end(), core_type::Span< T, Extent >::first(), core_type::Span< T, Extent >::last(), core_type::Span< T, Extent >::operator[](), core_type::Span< T, Extent >::size_bytes(), and core_type::Span< T, Extent >::subspan().

      
  | 
  inlineconstexprnoexcept | 
Return the size of this Span in bytes.
Definition at line 532 of file span.h.
References core_type::Span< T, Extent >::size().

      
  | 
  inlineconstexprnoexcept | 
Return a subspan of this Span.
The second template argument of the returned Span type is: Count != dynamic_extent ? Count : (Extent != dynamic_extent ? Extent - Offset : dynamic_extent) The implementation shall ensure that (Offset <= Extent && (Count == dynamic_extent || Count <= Extent - Offset)) is true. The behavior of this function is undefined unless (Offset <= size() && (Count == dynamic_extent || Count <= size() - Offset)) is true.
| Offset | The offset into this Span from which to start | 
| Count | The number of elements to take over | 
Definition at line 491 of file span.h.
References core_type::details::CheckIfExpectedOrAbort(), core_type::Span< T, Extent >::data(), core_type::dynamic_extent, and core_type::Span< T, Extent >::size().

      
  | 
  inlineconstexpr | 
Return a subspan of this Span.
The behavior of this function is undefined unless (offset <= size() && (count == dynamic_extent || count <= size() - offset)) is true
| [in] | offset | The offset into this Span from which to start | 
| [in] | count | The number of elements to take over | 
Definition at line 512 of file span.h.
References core_type::details::CheckIfExpectedOrAbort(), core_type::Span< T, Extent >::data(), core_type::dynamic_extent, and core_type::Span< T, Extent >::size().

      
  | 
  staticconstexpr | 
      
  | 
  private | 
The storage of span related data.
Definition at line 633 of file span.h.
Referenced by core_type::Span< T, Extent >::data(), and core_type::Span< T, Extent >::size().