emlabcpp
modern opinionated embedded C++ library
emlabcpp::bounded_view< Iterator, SizeType > Class Template Reference

#include <bounded_view.h>

+ Inheritance diagram for emlabcpp::bounded_view< Iterator, SizeType >:
+ Collaboration diagram for emlabcpp::bounded_view< Iterator, SizeType >:

Public Types

using size_type = SizeType
 
using iterator = Iterator
 
- Public Types inherited from emlabcpp::view< Iterator, EndIterator >
using value_type = typename std::iterator_traits< Iterator >::value_type
 standard public usings for container More...
 
using reverse_iterator = std::reverse_iterator< Iterator >
 
using iterator = Iterator
 
using difference_type = typename std::iterator_traits< Iterator >::difference_type
 
using size_type = std::size_t
 

Public Member Functions

template<bounded_derived OtherSize>
 requires (OtherSize::min_val >=min &&OtherSize::max_val<=max) bounded_view(bounded_view< Iterator
 
OtherSize const std::end (other))
 
template<typename Container >
 requires (range_container< Container > &&static_sized< Container > &&std::tuple_size_v< Container ><=max &&std::tuple_size_v< Container > >=min) explicit bounded_view(Container &cont)
 
template<std::size_t n>
 requires (n<=min) bounded_view< iterator
 
bounded< std::size_t, n, n > first () const
 
template<std::size_t n>
 requires (n<=min) bounded_view< iterator
 
bounded< std::size_t, min - n, max - n > offset () const
 
template<typename OffsetSizeType >
std::optional< bounded_view< iterator, OffsetSizeType > > opt_offset (std::size_t offset)
 
- Public Member Functions inherited from emlabcpp::view< Iterator, EndIterator >
constexpr view ()=default
 
template<range_container_with_iter< iterator > Cont>
constexpr view (Cont &cont)
 constructor from Container, uses begin/end of the container More...
 
template<range_container_with_iter< iterator > Cont>
constexpr view (Cont const &cont)
 constructor from Container, uses begin/end of the container More...
 
template<data_container_with_iter< iterator > Cont>
 requires (!range_container_with_iter< Cont, iterator >) const expr view(Cont &cont)
 
template<data_container_with_iter< iterator > Cont>
 requires (!range_container_with_iter< Cont, iterator >) const expr view(Cont const &cont)
 
constexpr view (Iterator begin, EndIterator end)
 constructor from the iterators that should internally be stored More...
 
template<std::convertible_to< Iterator > OtherIterator, std::convertible_to< EndIterator > OtherEndIterator>
constexpr view (view< OtherIterator, OtherEndIterator > other)
 
constexpr Iterator begin () const
 Start of the dataset iterator. More...
 
constexpr EndIterator end () const
 Past the end iterator. More...
 
constexpr reverse_iterator rbegin () const
 Returns iterator to the last element that goes in reverse. More...
 
constexpr reverse_iterator rend () const
 Returns iterator to the element before first element, that can go in reverse. More...
 
constexpr size_type size () const
 Size of the view over dataset uses std::ranges::distance() to tell the size. More...
 
constexpr bool empty () const
 View is empty if both iterators are equal. More...
 
constexpr value_type const & front () const
 Returns first value of the range. More...
 
constexpr value_type const & back () const
 Returns last value of the range. More...
 
 operator std::span< value_type > ()
 

Static Public Member Functions

static std::optional< bounded_viewmake (view< Iterator > v)
 

Public Attributes

OtherSize const & other: bounded_view( std::begin( other )
 

Static Public Attributes

static constexpr std::size_t min = size_type::min_val
 
static constexpr std::size_t max = size_type::max_val
 

Friends

template<typename , bounded_derived >
class bounded_view
 

Member Typedef Documentation

◆ iterator

template<typename Iterator , bounded_derived SizeType>
using emlabcpp::bounded_view< Iterator, SizeType >::iterator = Iterator

◆ size_type

template<typename Iterator , bounded_derived SizeType>
using emlabcpp::bounded_view< Iterator, SizeType >::size_type = SizeType

Member Function Documentation

◆ first()

template<typename Iterator , bounded_derived SizeType>
bounded< std::size_t, n, n > emlabcpp::bounded_view< Iterator, SizeType >::first ( ) const
inline

◆ make()

◆ offset()

template<typename Iterator , bounded_derived SizeType>
bounded< std::size_t, min - n, max - n > emlabcpp::bounded_view< Iterator, SizeType >::offset ( ) const
inline

◆ opt_offset()

template<typename Iterator , bounded_derived SizeType>
template<typename OffsetSizeType >
std::optional< bounded_view< iterator, OffsetSizeType > > emlabcpp::bounded_view< Iterator, SizeType >::opt_offset ( std::size_t  offset)
inline

◆ requires() [1/4]

template<typename Iterator , bounded_derived SizeType>
template<std::size_t n>
emlabcpp::bounded_view< Iterator, SizeType >::requires ( n<=  min)

◆ requires() [2/4]

template<typename Iterator , bounded_derived SizeType>
template<std::size_t n>
emlabcpp::bounded_view< Iterator, SizeType >::requires ( n<=  min)

◆ requires() [3/4]

template<typename Iterator , bounded_derived SizeType>
template<bounded_derived OtherSize>
emlabcpp::bounded_view< Iterator, SizeType >::requires ( OtherSize::min_val >=min &&OtherSize::max_val<=  max)

◆ requires() [4/4]

template<typename Iterator , bounded_derived SizeType>
template<typename Container >
emlabcpp::bounded_view< Iterator, SizeType >::requires ( range_container< Container > &&static_sized< Container > &&std::tuple_size_v< Container ><=max &&std::tuple_size_v< Container > >=  min) &
inline

◆ std::end()

template<typename Iterator , bounded_derived SizeType>
OtherSize const emlabcpp::bounded_view< Iterator, SizeType >::std::end ( other  )
inline

Friends And Related Function Documentation

◆ bounded_view

template<typename Iterator , bounded_derived SizeType>
template<typename , bounded_derived >
friend class bounded_view
friend

Member Data Documentation

◆ max

template<typename Iterator , bounded_derived SizeType>
constexpr std::size_t emlabcpp::bounded_view< Iterator, SizeType >::max = size_type::max_val
staticconstexpr

◆ min

template<typename Iterator , bounded_derived SizeType>
constexpr std::size_t emlabcpp::bounded_view< Iterator, SizeType >::min = size_type::min_val
staticconstexpr

◆ other

template<typename Iterator , bounded_derived SizeType>
OtherSize const& emlabcpp::bounded_view< Iterator, SizeType >::other

The documentation for this class was generated from the following file: