sparrow 0.3.0
|
Base class definining common interface for arrays with a bitmap. More...
#include <mutable_array_base.hpp>
Classes | |
struct | iterator_types |
Public Member Functions | |
reference | operator[] (size_type i) |
Returns a reference to the element at the specified position in the array. | |
iterator | begin () |
Returns an iterator to the first element of the array. | |
iterator | end () |
Returns a iterator to the element following the last element of the array. | |
template<typename T> | |
void | resize (size_type new_size, const nullable< T > &value) |
Resizes the array to contain new_length elements, does nothing if new_length == size() . | |
template<typename T> | |
iterator | insert (const_iterator pos, const nullable< T > &value) |
template<typename T> | |
iterator | insert (const_iterator pos, const nullable< T > &value, size_type count) |
template<typename T> | |
iterator | insert (const_iterator pos, std::initializer_list< nullable< T > > values) |
template<typename InputIt> requires std::input_iterator<InputIt> && mpl::is_type_instance_of_v<typename std::iterator_traits<InputIt>::value_type, nullable> | |
iterator | insert (const_iterator pos, InputIt first, InputIt last) |
Inserts elements from range [first , last ) before pos in the array. | |
template<std::ranges::input_range R> requires mpl::is_type_instance_of_v<std::ranges::range_value_t<R>, nullable> | |
iterator | insert (const_iterator pos, const R &range) |
Inserts elements from range range before pos in the array. | |
iterator | erase (const_iterator pos) |
Removes the element at pos from the array. | |
iterator | erase (const_iterator first, const_iterator last) |
Removes the elemens in the range [\cfirst , \clast ) from the array. | |
template<typename T> | |
void | push_back (const nullable< T > &value) |
Appends a copy of value to the end of the array. | |
void | pop_back () |
Removes the last element of the array. | |
template<typename T> | |
auto | insert (const_iterator pos, const nullable< T > &value) -> iterator |
Inserts a copy of value before pos in the array. | |
template<typename T> | |
auto | insert (const_iterator pos, const nullable< T > &value, size_type count) -> iterator |
Inserts count copies of value before pos in the array. | |
template<typename T> | |
auto | insert (const_iterator pos, std::initializer_list< nullable< T > > values) -> iterator |
Inserts elements from initializer list values before pos in the array. | |
const_reference | operator[] (size_type i) const |
Returns a constant reference to the element at the specified position in the array. | |
const_iterator | begin () const |
Returns a constant iterator to the first element of the array. | |
const_iterator | end () const |
Returns a constant iterator to the element following the last element of the array. | |
![]() | |
std::optional< std::string_view > | name () const |
std::optional< std::string_view > | metadata () const |
bool | empty () const |
Checks if the array has no element, i.e. | |
size_type | size () const |
Returns the number of elements in the array. | |
const_reference | at (size_type i) const |
Returns a constant reference to the element at the specified position in the array with bounds checking. | |
const_reference | operator[] (size_type i) const |
Returns a constant reference to the element at the specified position in the array. | |
const_reference | front () const |
Returns a constant reference to the first element in the container. | |
const_reference | back () const |
Returns a constant reference to the last element in the container. | |
const_iterator | begin () const |
Returns a constant iterator to the first element of the array. | |
const_iterator | end () const |
Returns a constant iterator to the element following the last element of the array. | |
const_iterator | cbegin () const |
Returns a constant iterator to the first element of the array. | |
const_iterator | cend () const |
Returns a constant iterator to the element following the last element of the array. | |
const_reverse_iterator | rbegin () const |
Returns a constant reverse iterator to the first element of the reversed array. | |
const_reverse_iterator | rend () const |
Returns a reverse iterator to the element following the last element of the reversed array. | |
const_reverse_iterator | crbegin () const |
Returns a constant reverse iterator to the first element of the reversed array. | |
const_reverse_iterator | crend () const |
Returns a reverse iterator to the element following the last element of the reversed array. | |
const_bitmap_range | bitmap () const |
Returns the validity bitmap of the array (i.e. | |
const_value_range | values () const |
Returns the raw values of the array (i.e. | |
D | slice (size_type start, size_type end) const |
Slices the array to keep only the elements between the given start and end . | |
D | slice_view (size_type start, size_type end) const |
Slices the array to keep only the elements between the given start and end . | |
Friends | |
class | layout_iterator< iterator_types > |
Additional Inherited Members | |
![]() | |
using | derived_type = D |
Base class definining common interface for arrays with a bitmap.
This class is a CRTP base class that defines and implements common interface for arrays with a bitmap. The immutable interface is inherited from array_crtp_base.
D | The derived type, i.e. the inheriting class for which mutable_array_base provides the interface. |
Definition at line 34 of file mutable_array_base.hpp.
using sparrow::mutable_array_base< D >::base_type = array_crtp_base<D> |
Definition at line 39 of file mutable_array_base.hpp.
using sparrow::mutable_array_base< D >::bitmap_const_reference = bitmap_type::const_reference |
Definition at line 48 of file mutable_array_base.hpp.
using sparrow::mutable_array_base< D >::bitmap_iterator = bitmap_type::iterator |
Definition at line 49 of file mutable_array_base.hpp.
using sparrow::mutable_array_base< D >::bitmap_range = std::ranges::subrange<bitmap_iterator> |
Definition at line 50 of file mutable_array_base.hpp.
using sparrow::mutable_array_base< D >::bitmap_reference = bitmap_type::reference |
Definition at line 47 of file mutable_array_base.hpp.
using sparrow::mutable_array_base< D >::bitmap_type = typename inner_types::bitmap_type |
Definition at line 46 of file mutable_array_base.hpp.
using sparrow::mutable_array_base< D >::const_bitmap_range = base_type::const_bitmap_range |
Definition at line 51 of file mutable_array_base.hpp.
using sparrow::mutable_array_base< D >::const_iterator = base_type::const_iterator |
Definition at line 76 of file mutable_array_base.hpp.
using sparrow::mutable_array_base< D >::const_reference = base_type::const_reference |
Definition at line 60 of file mutable_array_base.hpp.
using sparrow::mutable_array_base< D >::derived_type = D |
Definition at line 40 of file mutable_array_base.hpp.
using sparrow::mutable_array_base< D >::difference_type = base_type::difference_type |
Definition at line 44 of file mutable_array_base.hpp.
using sparrow::mutable_array_base< D >::inner_const_reference = typename base_type::inner_const_reference |
Definition at line 57 of file mutable_array_base.hpp.
using sparrow::mutable_array_base< D >::inner_reference = typename inner_types::inner_reference |
Definition at line 56 of file mutable_array_base.hpp.
using sparrow::mutable_array_base< D >::inner_types = array_inner_types<derived_type> |
Definition at line 41 of file mutable_array_base.hpp.
using sparrow::mutable_array_base< D >::inner_value_type = typename base_type::inner_value_type |
Definition at line 53 of file mutable_array_base.hpp.
using sparrow::mutable_array_base< D >::iterator = layout_iterator<iterator_types> |
Definition at line 75 of file mutable_array_base.hpp.
using sparrow::mutable_array_base< D >::iterator_tag = base_type::iterator_tag |
Definition at line 64 of file mutable_array_base.hpp.
using sparrow::mutable_array_base< D >::reference = nullable<inner_reference, bitmap_reference> |
Definition at line 59 of file mutable_array_base.hpp.
using sparrow::mutable_array_base< D >::self_type = mutable_array_base<D> |
Definition at line 38 of file mutable_array_base.hpp.
using sparrow::mutable_array_base< D >::size_type = base_type::size_type |
Definition at line 43 of file mutable_array_base.hpp.
using sparrow::mutable_array_base< D >::value_iterator = typename inner_types::value_iterator |
Definition at line 62 of file mutable_array_base.hpp.
using sparrow::mutable_array_base< D >::value_type = typename base_type::value_type |
Definition at line 54 of file mutable_array_base.hpp.
|
protected |
Definition at line 195 of file mutable_array_base.hpp.
|
protecteddefault |
|
protecteddefault |
|
nodiscard |
Returns an iterator to the first element of the array.
Definition at line 204 of file mutable_array_base.hpp.
|
nodiscard |
Returns a constant iterator to the first element of the array.
Definition at line 118 of file array_base.hpp.
|
nodiscardprotected |
Definition at line 239 of file mutable_array_base.hpp.
|
nodiscardprotected |
Definition at line 245 of file mutable_array_base.hpp.
|
nodiscard |
Returns a iterator to the element following the last element of the array.
Definition at line 214 of file mutable_array_base.hpp.
|
nodiscard |
Returns a constant iterator to the element following the last element of the array.
Definition at line 119 of file array_base.hpp.
auto sparrow::mutable_array_base< D >::erase | ( | const_iterator | first, |
const_iterator | last ) |
Removes the elemens in the range [\cfirst , \clast ) from the array.
first | The iterator to the first element to remove. |
last | The iterator to the element following the last element to remove. |
Definition at line 345 of file mutable_array_base.hpp.
auto sparrow::mutable_array_base< D >::erase | ( | const_iterator | pos | ) |
Removes the element at pos
from the array.
pos | The iterator to the element to remove. |
Definition at line 330 of file mutable_array_base.hpp.
|
nodiscardprotected |
Definition at line 232 of file mutable_array_base.hpp.
|
protected |
Definition at line 168 of file array_base.hpp.
iterator sparrow::mutable_array_base< D >::insert | ( | const_iterator | pos, |
const nullable< T > & | value ) |
auto sparrow::mutable_array_base< D >::insert | ( | const_iterator | pos, |
const nullable< T > & | value ) -> iterator |
Inserts a copy of value
before pos
in the array.
pos | The iterator before which the element will be inserted (pos may be the end() iterator). |
value | The element to insert. |
Definition at line 278 of file mutable_array_base.hpp.
iterator sparrow::mutable_array_base< D >::insert | ( | const_iterator | pos, |
const nullable< T > & | value, | ||
size_type | count ) |
auto sparrow::mutable_array_base< D >::insert | ( | const_iterator | pos, |
const nullable< T > & | value, | ||
size_type | count ) -> iterator |
Inserts count
copies of value
before pos
in the array.
pos | The iterator before which the elements will be inserted (pos may be the end() iterator). |
value | The element to insert. |
count | The number of elements to insert. |
pos
if count == 0
. Definition at line 293 of file mutable_array_base.hpp.
|
inline |
Inserts elements from range range
before pos
in the array.
R | the type of range to insert. |
pos | The iterator before which the elements will be inserted (pos may be the end() iterator). |
range | The range of values to insert. |
pos
if range
is empty. Definition at line 160 of file mutable_array_base.hpp.
|
inline |
Inserts elements from range [first
, last
) before pos
in the array.
pos | The iterator before which the elements will be inserted (pos may be the end() iterator). |
first | The iterator to the first element to insert. |
last | The iterator to the element following the last element to insert. |
pos
if first == last
. Definition at line 109 of file mutable_array_base.hpp.
iterator sparrow::mutable_array_base< D >::insert | ( | const_iterator | pos, |
std::initializer_list< nullable< T > > | values ) |
auto sparrow::mutable_array_base< D >::insert | ( | const_iterator | pos, |
std::initializer_list< nullable< T > > | values ) -> iterator |
Inserts elements from initializer list values
before pos
in the array.
pos | The iterator before which the elements will be inserted (pos may be the end() iterator). |
values | The std::initializer_list to insert the values from. |
pos
if values
is empty. Definition at line 317 of file mutable_array_base.hpp.
|
protecteddefault |
|
protecteddefault |
|
nodiscard |
Returns a reference to the element at the specified position in the array.
i | the index of the element in the array. |
Definition at line 225 of file mutable_array_base.hpp.
|
nodiscard |
Returns a constant reference to the element at the specified position in the array.
i | the index of the element in the array. |
Definition at line 114 of file array_base.hpp.
void sparrow::mutable_array_base< D >::pop_back | ( | ) |
Removes the last element of the array.
Definition at line 381 of file mutable_array_base.hpp.
void sparrow::mutable_array_base< D >::push_back | ( | const nullable< T > & | value | ) |
Appends a copy of value
to the end of the array.
value | The value o the element to append. |
Definition at line 372 of file mutable_array_base.hpp.
void sparrow::mutable_array_base< D >::resize | ( | size_type | new_length, |
const nullable< T > & | value ) |
Resizes the array to contain new_length
elements, does nothing if new_length == size()
.
If the current size is greater than new_length
, the array is reduced to its first new_length
elements. If the current size is less than new_length
, additional copies of values
are appended.
new_length | The new size of the array. |
value | The value to initialize the new elements with. |
Definition at line 260 of file mutable_array_base.hpp.
|
friend |
Definition at line 185 of file mutable_array_base.hpp.