sbepp
Loading...
Searching...
No Matches
sbepp::detail::nested_group_base< Byte, Entry, Dimension > Class Template Reference

Base class for a nested group. More...

#include <sbepp.hpp>

Inheritance diagram for sbepp::detail::nested_group_base< Byte, Entry, Dimension >:
sbepp::detail::byte_range< Byte >

Public Types

using value_type = Entry
 entry type
 
using reference = value_type
 value_type
 
using sbe_size_type
 numInGroup value type
 
using size_type = typename sbe_size_type::value_type
 raw size type
 
using difference_type = typename std::make_signed<size_type>::type
 signed size_type
 
using iterator
 Forward iterator to value_type. Satisfies std::forward_iterator
 
template<typename Byte2 >
using cursor_range_t
 Type of a cursor range. Satisfies std::ranges::input_range
 
template<typename Byte2 >
using cursor_iterator = typename cursor_range_t<Byte2>::iterator
 cursor_range_t::iterator. Satisfies std::input_iterator
 

Public Member Functions

constexpr sbe_size_type sbe_size () const noexcept
 Returns header's numInGroup
 
constexpr size_type size () const noexcept
 Returns raw size.
 
constexpr void resize (const size_type count) const noexcept
 Sets numInGroup to count
 
constexpr bool empty () const noexcept
 Checks if size() == 0
 
constexpr iterator begin () const noexcept
 Returns an iterator to the beginning.
 
constexpr iterator end () const noexcept
 Returns an iterator to the end.
 
constexpr reference front () const noexcept
 Returns the first element.
 
constexpr void clear () const noexcept
 Resizes to 0
 
template<typename Byte2 , typename = enable_if_cursor_compatible_t<Byte, Byte2>>
constexpr cursor_range_t< Byte2 > cursor_range (cursor< Byte2 > &c) const noexcept
 Returns cursor range to all group entries.
 
template<typename Byte2 , typename = enable_if_cursor_compatible_t<Byte, Byte2>>
constexpr cursor_range_t< Byte2 > cursor_subrange (cursor< Byte2 > &c, const size_type pos) const noexcept
 Returns cursor range to [pos; size()) entries.
 
template<typename Byte2 , typename = enable_if_cursor_compatible_t<Byte, Byte2>>
constexpr cursor_range_t< Byte2 > cursor_subrange (cursor< Byte2 > &c, const size_type pos, const size_type count) const noexcept
 Returns cursor range to [pos; pos+count) entries.
 
template<typename Byte2 , typename = enable_if_cursor_compatible_t<Byte, Byte2>>
constexpr cursor_iterator< Byte2 > cursor_begin (cursor< Byte2 > &c) const noexcept
 Returns cursor iterator to the beginning.
 
template<typename Byte2 , typename = enable_if_cursor_compatible_t<Byte, Byte2>>
constexpr cursor_iterator< Byte2 > cursor_end (cursor< Byte2 > &c) const noexcept
 Returns cursor iterator to the end.
 
- Public Member Functions inherited from sbepp::detail::byte_range< Byte >
 byte_range ()=default
 Initializes to nullptr
 
constexpr byte_range (Byte *begin, Byte *end) noexcept
 Constructs from a pair of pointers.
 
constexpr byte_range (Byte *ptr, const std::size_t size) noexcept
 Constructs from pointer and size.
 
template<typename Byte2 , typename = enable_if_convertible_t<Byte2, Byte>>
constexpr byte_range (const byte_range< Byte2 > &other) noexcept
 Copy constructor. Available if Byte2* is convertible to Byte*
 

Static Public Member Functions

static constexpr size_type max_size () noexcept
 Returns numInGroup's maxValue
 

Detailed Description

template<typename Byte, typename Entry, typename Dimension>
class sbepp::detail::nested_group_base< Byte, Entry, Dimension >

Base class for a nested group.

Member Function Documentation

◆ clear()

template<typename Byte , typename Entry , typename Dimension >
constexpr void sbepp::detail::nested_group_base< Byte, Entry, Dimension >::clear ( ) const
inlineconstexprnoexcept

Resizes to 0

Postcondition
size() == 0

◆ cursor_subrange() [1/2]

template<typename Byte , typename Entry , typename Dimension >
template<typename Byte2 , typename = enable_if_cursor_compatible_t<Byte, Byte2>>
constexpr cursor_range_t< Byte2 > sbepp::detail::nested_group_base< Byte, Entry, Dimension >::cursor_subrange ( cursor< Byte2 > & c,
const size_type pos ) const
inlineconstexprnoexcept

Returns cursor range to [pos; size()) entries.

Precondition
pos < size()

◆ cursor_subrange() [2/2]

template<typename Byte , typename Entry , typename Dimension >
template<typename Byte2 , typename = enable_if_cursor_compatible_t<Byte, Byte2>>
constexpr cursor_range_t< Byte2 > sbepp::detail::nested_group_base< Byte, Entry, Dimension >::cursor_subrange ( cursor< Byte2 > & c,
const size_type pos,
const size_type count ) const
inlineconstexprnoexcept

Returns cursor range to [pos; pos+count) entries.

Precondition
pos < size()
count <= size() - pos

◆ front()

template<typename Byte , typename Entry , typename Dimension >
constexpr reference sbepp::detail::nested_group_base< Byte, Entry, Dimension >::front ( ) const
inlineconstexprnoexcept

Returns the first element.

Precondition
!empty()

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