sparrow 0.6.0
Loading...
Searching...
No Matches
sparrow::u8_buffer< T > Class Template Reference

This buffer class is use as storage buffer for all sparrow arrays. More...

#include <u8_buffer.hpp>

Inheritance diagram for sparrow::u8_buffer< T >:
[legend]
Collaboration diagram for sparrow::u8_buffer< T >:
[legend]

Public Types

using holder_type = detail::holder<buffer<std::uint8_t>>
 
using buffer_adaptor_type = buffer_adaptor<T, buffer<std::uint8_t>&>
 
- Public Types inherited from sparrow::buffer_adaptor< T, buffer< std::uint8_t > & >
using value_type
 
using reference
 
using const_reference
 
using pointer
 
using const_pointer
 
using buffer_reference_value_type
 
using buffer_reference
 
using size_type
 
using difference_type
 
using iterator
 
using const_iterator
 
using reverse_iterator
 
using const_reverse_iterator
 

Public Member Functions

 u8_buffer (u8_buffer &&other)
 
 u8_buffer (const u8_buffer &other)
 
u8_bufferoperator= (u8_buffer &&other)=delete
 
u8_bufferoperator= (u8_buffer &other)=delete
 
 ~u8_buffer ()=default
 
 u8_buffer (std::size_t n, const T &val=T{})
 Constructs a buffer with n elements, each initialized to val.
 
template<std::ranges::input_range R>
requires ( !std::same_as<u8_buffer<T>, std::decay_t<R>> && std::convertible_to<std::ranges::range_value_t<R>, T> )
 u8_buffer (R &&range)
 Constructs a buffer with the elements of the range range.
 
 u8_buffer (std::initializer_list< T > ilist)
 Constructs a buffer with the elements of the initializer list ilist.
 
template<allocator A = std::allocator<T>>
 u8_buffer (T *data_ptr, std::size_t count, const A &a=A())
 Constructs a buffer by taking ownership of the storage pointed to by data_ptr.
 
buffer< std::uint8_t > extract_storage () &&
 
- Public Member Functions inherited from sparrow::buffer_adaptor< T, buffer< std::uint8_t > & >
 buffer_adaptor (FromBufferRef buf)
 
 buffer_adaptor (const FromBufferRef buf)
 
constexpr pointer data () noexcept
 
constexpr const_pointer data () const noexcept
 
constexpr reference operator[] (size_type idx)
 
constexpr const_reference operator[] (size_type idx) const
 
constexpr reference front ()
 
constexpr const_reference front () const
 
constexpr reference back ()
 
constexpr const_reference back () const
 
constexpr iterator begin () noexcept
 
constexpr iterator end () noexcept
 
constexpr const_iterator begin () const noexcept
 
constexpr const_iterator end () const noexcept
 
constexpr const_iterator cbegin () const noexcept
 
constexpr const_iterator cend () const noexcept
 
constexpr reverse_iterator rbegin () noexcept
 
constexpr reverse_iterator rend () noexcept
 
constexpr const_reverse_iterator rbegin () const noexcept
 
constexpr const_reverse_iterator rend () const noexcept
 
constexpr const_reverse_iterator crbegin () const noexcept
 
constexpr const_reverse_iterator crend () const noexcept
 
constexpr size_type size () const noexcept
 
constexpr size_type max_size () const noexcept
 
constexpr size_type capacity () const noexcept
 
constexpr bool empty () const noexcept
 
constexpr void reserve (size_type new_cap)
 
constexpr void shrink_to_fit ()
 
constexpr void clear () noexcept
 
constexpr iterator insert (const_iterator pos, const value_type &value)
 
constexpr iterator insert (const_iterator pos, size_type count, const value_type &value)
 
constexpr iterator insert (const_iterator pos, InputIt first, InputIt last)
 
constexpr iterator insert (const_iterator pos, std::initializer_list< value_type > ilist)
 
constexpr iterator emplace (const_iterator pos, Args &&... args)
 
constexpr iterator erase (const_iterator pos)
 
constexpr iterator erase (const_iterator first, const_iterator last)
 
constexpr void push_back (const value_type &value)
 
constexpr void pop_back ()
 
constexpr void resize (size_type new_size)
 
constexpr void resize (size_type new_size, const value_type &value)
 
 buffer_adaptor (FromBufferRef buf)
 
 buffer_adaptor (const FromBufferRef buf)
 
constexpr pointer data () noexcept
 
constexpr const_pointer data () const noexcept
 
constexpr reference operator[] (size_type idx)
 
constexpr const_reference operator[] (size_type idx) const
 
constexpr reference front ()
 
constexpr const_reference front () const
 
constexpr reference back ()
 
constexpr const_reference back () const
 
constexpr iterator begin () noexcept
 
constexpr const_iterator begin () const noexcept
 
constexpr iterator end () noexcept
 
constexpr const_iterator end () const noexcept
 
constexpr const_iterator cbegin () const noexcept
 
constexpr const_iterator cend () const noexcept
 
constexpr reverse_iterator rbegin () noexcept
 
constexpr const_reverse_iterator rbegin () const noexcept
 
constexpr reverse_iterator rend () noexcept
 
constexpr const_reverse_iterator rend () const noexcept
 
constexpr const_reverse_iterator crbegin () const noexcept
 
constexpr const_reverse_iterator crend () const noexcept
 
constexpr size_type size () const noexcept
 
constexpr size_type max_size () const noexcept
 
constexpr size_type capacity () const noexcept
 
constexpr bool empty () const noexcept
 
constexpr void reserve (size_type new_cap)
 
constexpr void shrink_to_fit ()
 
constexpr void clear () noexcept
 
constexpr iterator insert (const_iterator pos, const value_type &value)
 
constexpr iterator insert (const_iterator pos, size_type count, const value_type &value)
 
constexpr iterator insert (const_iterator pos, InputIt first, InputIt last)
 
constexpr iterator insert (const_iterator pos, std::initializer_list< value_type > ilist)
 
constexpr iterator emplace (const_iterator pos, Args &&... args)
 
constexpr iterator erase (const_iterator pos)
 
constexpr iterator erase (const_iterator first, const_iterator last)
 
constexpr void push_back (const value_type &value)
 
constexpr void pop_back ()
 
constexpr void resize (size_type new_size)
 
constexpr void resize (size_type new_size, const value_type &value)
 

Additional Inherited Members

- Static Public Attributes inherited from sparrow::buffer_adaptor< T, buffer< std::uint8_t > & >
static constexpr bool is_const
 
static constexpr bool is_const
 

Detailed Description

template<class T>
class sparrow::u8_buffer< T >

This buffer class is use as storage buffer for all sparrow arrays.

Its internal storage can be extracted.

Definition at line 73 of file u8_buffer.hpp.

Member Typedef Documentation

◆ buffer_adaptor_type

template<class T>
using sparrow::u8_buffer< T >::buffer_adaptor_type = buffer_adaptor<T, buffer<std::uint8_t>&>

Definition at line 79 of file u8_buffer.hpp.

◆ holder_type

template<class T>
using sparrow::u8_buffer< T >::holder_type = detail::holder<buffer<std::uint8_t>>

Definition at line 78 of file u8_buffer.hpp.

Constructor & Destructor Documentation

◆ u8_buffer() [1/6]

template<class T>
sparrow::u8_buffer< T >::u8_buffer ( u8_buffer< T > && other)

Definition at line 123 of file u8_buffer.hpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ u8_buffer() [2/6]

template<class T>
sparrow::u8_buffer< T >::u8_buffer ( const u8_buffer< T > & other)

Definition at line 130 of file u8_buffer.hpp.

Here is the call graph for this function:

◆ ~u8_buffer()

template<class T>
sparrow::u8_buffer< T >::~u8_buffer ( )
default

◆ u8_buffer() [3/6]

template<class T>
sparrow::u8_buffer< T >::u8_buffer ( std::size_t n,
const T & val = T{} )

Constructs a buffer with n elements, each initialized to val.

Parameters
nNumber of elements.
valValue to initialize the elements with.

Definition at line 137 of file u8_buffer.hpp.

Here is the call graph for this function:

◆ u8_buffer() [4/6]

template<class T>
requires ( !std::same_as<u8_buffer<T>, std::decay_t<R>> && std::convertible_to<std::ranges::range_value_t<R>, T> )
template<std::ranges::input_range R>
requires ( !std::same_as<u8_buffer<T>, std::decay_t<R>> && std::convertible_to<std::ranges::range_value_t<R>, T> )
sparrow::u8_buffer< T >::u8_buffer ( R && range)

Constructs a buffer with the elements of the range range.

The range elements must be convertible to T.

Parameters
rangeThe range.

Definition at line 148 of file u8_buffer.hpp.

Here is the call graph for this function:

◆ u8_buffer() [5/6]

template<class T>
sparrow::u8_buffer< T >::u8_buffer ( std::initializer_list< T > ilist)

Constructs a buffer with the elements of the initializer list ilist.

Parameters
ilistThe initializer list.

Definition at line 156 of file u8_buffer.hpp.

Here is the call graph for this function:

◆ u8_buffer() [6/6]

template<class T>
template<allocator A>
sparrow::u8_buffer< T >::u8_buffer ( T * data_ptr,
std::size_t count,
const A & a = A() )

Constructs a buffer by taking ownership of the storage pointed to by data_ptr.

Parameters
data_ptrPointer to the storage.
countNumber of elements in the storage.

Definition at line 165 of file u8_buffer.hpp.

Member Function Documentation

◆ extract_storage()

template<class T>
buffer< std::uint8_t > sparrow::detail::holder< buffer< std::uint8_t > >::extract_storage ( ) &&
inlinenodiscard

Definition at line 46 of file u8_buffer.hpp.

Here is the caller graph for this function:

◆ operator=() [1/2]

template<class T>
u8_buffer & sparrow::u8_buffer< T >::operator= ( u8_buffer< T > && other)
delete

◆ operator=() [2/2]

template<class T>
u8_buffer & sparrow::u8_buffer< T >::operator= ( u8_buffer< T > & other)
delete

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