|
sparrow 2.6.0
C++20 idiomatic APIs for the Apache Arrow Columnar Format
|
#include <nullable.hpp>
Public Types | |
| using | stored_value_type = T |
| using | self_type = nullable<T, B> |
| using | value_traits = nullable_traits<T> |
| using | value_type = typename value_traits::value_type |
| using | reference = typename value_traits::reference |
| using | const_reference = typename value_traits::const_reference |
| using | rvalue_reference = typename value_traits::rvalue_reference |
| using | const_rvalue_reference = typename value_traits::const_rvalue_reference |
| using | flag_traits = nullable_traits<B> |
| using | flag_type = typename flag_traits::value_type |
| using | flag_reference = typename flag_traits::reference |
| using | flag_const_reference = typename flag_traits::const_reference |
| using | flag_rvalue_reference = typename flag_traits::rvalue_reference |
| using | flag_const_rvalue_reference = typename flag_traits::const_rvalue_reference |
Public Member Functions | |
| template<std::default_initializable U = T, std::default_initializable BB = B> | |
| constexpr | nullable () noexcept |
| Default constructor creating a null nullable. | |
| template<std::default_initializable U = T, std::default_initializable BB = B> | |
| constexpr | nullable (nullval_t) noexcept |
| Constructor from nullval_t creating a null nullable. | |
| template<class U> requires (not std::same_as<self_type, std::decay_t<U>> and std::constructible_from<T, U &&>) | |
| explicit (not std::convertible_to< U &&, T >) const expr nullable(U &&value) noexcept(noexcept(T(std::declval< U >()))) | |
| Constructor from a value creating a non-null nullable. | |
| constexpr | nullable (const self_type &rhs)=default |
| Default copy constructor. | |
| template<class TO, mpl::boolean_like BO> requires (impl::both_constructible_from_cref<T, TO, B, BO> and not impl::initializable_from_refs<T, nullable<TO, BO>>) | |
| explicit (not impl::both_convertible_from_cref< T, TO, B, BO >) SPARROW_CONSTEXPR nullable(const nullable< TO | |
| Converting copy constructor from different nullable types. | |
| BO | m_null_flag (rhs.null_flag()) |
| constexpr | nullable (self_type &&rhs) noexcept=default |
| Default move constructor. | |
| template<class TO, mpl::boolean_like BO> requires (impl::both_constructible_from_cond_ref<T, TO, B, BO> and not impl::initializable_from_refs<T, nullable<TO, BO>>) | |
| explicit (not impl::both_convertible_from_cond_ref< T, TO, B, BO >) SPARROW_CONSTEXPR nullable(nullable< TO | |
| Converting move constructor from different nullable types. | |
| BO | m_null_flag (std::move(rhs).null_flag()) |
| constexpr | nullable (value_type &&value, flag_type &&null_flag) |
| Constructor from value and flag. | |
| constexpr | nullable (std::add_lvalue_reference_t< T > value, std::add_lvalue_reference_t< B > null_flag) |
| Constructor from lvalue references (for reference semantics). | |
| constexpr | nullable (value_type &&value, std::add_lvalue_reference_t< B > null_flag) |
| Constructor from moved value and flag reference. | |
| constexpr | nullable (std::add_lvalue_reference_t< T > value, flag_type &&null_flag) |
| Constructor from value reference and moved flag. | |
| template<class U, class V> requires (std::same_as<std::remove_cvref_t<U>, T> && std::same_as<std::remove_cvref_t<V>, B> && std::is_const_v <std::remove_reference_t<U>> && not std::is_const_v<std::remove_reference_t<V>> && not std::is_reference_v<T> && not std::is_reference_v<B> && std::is_lvalue_reference_v<U &&> && std::is_lvalue_reference_v<V &&>) | |
| constexpr | nullable (U &value, V &null_flag) |
| Constructor from const value and non-const flag reference (for non-reference types only). | |
| template<class U, class V> requires (std::same_as<std::remove_cvref_t<U>, T> && std::same_as<std::remove_cvref_t<V>, B> && not std::is_reference_v<T> && not std::is_reference_v<B> && (std::is_const_v<std::remove_reference_t<U>> || std::is_const_v<std::remove_reference_t<V>>) ) | |
| constexpr | nullable (U &&value, V &&null_flag) |
| Constructor from two forwarding references (for value types with const qualifiers). | |
| constexpr self_type & | operator= (nullval_t) noexcept |
| Assignment from nullval_t, setting nullable to null state. | |
| template<class TO> requires (not std::same_as<self_type, TO> and std::assignable_from<std::add_lvalue_reference_t<T>, TO>) | |
| constexpr self_type & | operator= (TO &&rhs) noexcept(std::is_nothrow_assignable_v< std::add_lvalue_reference_t< T >, TO > &&std::is_nothrow_assignable_v< std::add_lvalue_reference_t< B >, bool >) |
| Assignment from a value, setting nullable to non-null state. | |
| constexpr self_type & | operator= (const self_type &rhs) noexcept(std::is_nothrow_assignable_v< std::add_lvalue_reference_t< T >, const_reference > &&std::is_nothrow_assignable_v< std::add_lvalue_reference_t< B >, flag_const_reference >) |
| Default copy assignment operator. | |
| template<class TO, mpl::boolean_like BO> requires ( impl::both_assignable_from_cref<T, TO, B, BO> and not impl::initializable_from_refs<T, nullable<TO, BO>> and not impl::assignable_from_refs<T, nullable<TO, BO>> ) | |
| constexpr self_type & | operator= (const nullable< TO, BO > &rhs) noexcept(std::is_nothrow_assignable_v< std::add_lvalue_reference_t< T >, typename nullable< TO, BO >::const_reference > &&std::is_nothrow_assignable_v< std::add_lvalue_reference_t< B >, typename nullable< TO, BO >::flag_const_reference >) |
| Converting assignment operator from different nullable types. | |
| constexpr self_type & | operator= (self_type &&rhs) noexcept(std::is_nothrow_assignable_v< std::add_lvalue_reference_t< T >, rvalue_reference > &&std::is_nothrow_assignable_v< std::add_lvalue_reference_t< B >, flag_rvalue_reference >) |
| Default move assignment operator. | |
| template<class TO, mpl::boolean_like BO> requires ( impl::both_assignable_from_cond_ref<T, TO, B, BO> and not impl::initializable_from_refs<T, nullable<TO, BO>> and not impl::assignable_from_refs<T, nullable<TO, BO>> ) | |
| constexpr self_type & | operator= (nullable< TO, BO > &&rhs) noexcept(std::is_nothrow_assignable_v< std::add_lvalue_reference_t< T >, typename nullable< TO, BO >::rvalue_reference > &&std::is_nothrow_assignable_v< std::add_lvalue_reference_t< B >, typename nullable< TO, BO >::flag_rvalue_reference >) |
| Converting move assignment operator from different nullable types. | |
| constexpr | operator bool () const noexcept |
| Conversion to bool indicating non-null state. | |
| constexpr bool | has_value () const noexcept |
| Checks whether the nullable contains a valid value. | |
| constexpr flag_reference | null_flag () &noexcept |
| Gets mutable reference to the validity flag. | |
| constexpr flag_const_reference | null_flag () const &noexcept |
| Gets const reference to the validity flag. | |
| constexpr flag_rvalue_reference | null_flag () &&noexcept |
| Gets rvalue reference to the validity flag. | |
| constexpr flag_const_rvalue_reference | null_flag () const &&noexcept |
| Gets const rvalue reference to the validity flag. | |
| constexpr reference | get () &noexcept |
| Gets mutable reference to the stored value. | |
| constexpr const_reference | get () const &noexcept |
| Gets const reference to the stored value. | |
| constexpr rvalue_reference | get () &&noexcept |
| Gets rvalue reference to the stored value. | |
| constexpr const_rvalue_reference | get () const &&noexcept |
| Gets const rvalue reference to the stored value. | |
| constexpr reference | value () & |
| Gets mutable reference to the value with null checking. | |
| constexpr const_reference | value () const & |
| Gets const reference to the value with null checking. | |
| constexpr rvalue_reference | value () && |
| Gets rvalue reference to the value with null checking. | |
| constexpr const_rvalue_reference | value () const && |
| Gets const rvalue reference to the value with null checking. | |
| template<class U> | |
| constexpr value_type | value_or (U &&default_value) const & |
| Gets the value or a default if null (const version). | |
| template<class U> | |
| constexpr value_type | value_or (U &&default_value) && |
| Gets the value or a default if null (rvalue version). | |
| void | swap (self_type &other) noexcept |
| Swaps this nullable with another. | |
| void | reset () noexcept |
| Resets the nullable to null state. | |
| template<class U> | |
| constexpr auto | value_or (U &&default_value) const &-> value_type |
| template<class U> | |
| constexpr auto | value_or (U &&default_value) &&-> value_type |
Public Attributes | |
| BO & | rhs: m_value(rhs.get()) |
| BO && | rhs: m_value(std::move(rhs).get()) |
Friends | |
| template<class TO, mpl::boolean_like BO> | |
| class | nullable |
Definition at line 395 of file nullable.hpp.
| using sparrow::nullable< T, B >::const_reference = typename value_traits::const_reference |
Definition at line 404 of file nullable.hpp.
| using sparrow::nullable< T, B >::const_rvalue_reference = typename value_traits::const_rvalue_reference |
Definition at line 406 of file nullable.hpp.
| using sparrow::nullable< T, B >::flag_const_reference = typename flag_traits::const_reference |
Definition at line 410 of file nullable.hpp.
| using sparrow::nullable< T, B >::flag_const_rvalue_reference = typename flag_traits::const_rvalue_reference |
Definition at line 412 of file nullable.hpp.
| using sparrow::nullable< T, B >::flag_reference = typename flag_traits::reference |
Definition at line 409 of file nullable.hpp.
| using sparrow::nullable< T, B >::flag_rvalue_reference = typename flag_traits::rvalue_reference |
Definition at line 411 of file nullable.hpp.
| using sparrow::nullable< T, B >::flag_traits = nullable_traits<B> |
Definition at line 407 of file nullable.hpp.
| using sparrow::nullable< T, B >::flag_type = typename flag_traits::value_type |
Definition at line 408 of file nullable.hpp.
| using sparrow::nullable< T, B >::reference = typename value_traits::reference |
Definition at line 403 of file nullable.hpp.
| using sparrow::nullable< T, B >::rvalue_reference = typename value_traits::rvalue_reference |
Definition at line 405 of file nullable.hpp.
| using sparrow::nullable< T, B >::self_type = nullable<T, B> |
Definition at line 400 of file nullable.hpp.
| using sparrow::nullable< T, B >::stored_value_type = T |
Definition at line 399 of file nullable.hpp.
| using sparrow::nullable< T, B >::value_traits = nullable_traits<T> |
Definition at line 401 of file nullable.hpp.
| using sparrow::nullable< T, B >::value_type = typename value_traits::value_type |
Definition at line 402 of file nullable.hpp.
|
inlineconstexprnoexcept |
Default constructor creating a null nullable.
| U | Value type (deduced, must be default constructible) |
| BB | Flag type (deduced, must be default constructible) |
Definition at line 426 of file nullable.hpp.
|
inlineconstexprnoexcept |
Constructor from nullval_t creating a null nullable.
| U | Value type (deduced, must be default constructible) |
| BB | Flag type (deduced, must be default constructible) |
Definition at line 444 of file nullable.hpp.
|
constexprdefault |
Default copy constructor.
| rhs | Source nullable to copy from |
|
constexprdefaultnoexcept |
Default move constructor.
| rhs | Source nullable to move from |
|
inlineconstexpr |
Constructor from value and flag.
| value | Value to move and store |
| null_flag | Flag to move and store |
Definition at line 622 of file nullable.hpp.
|
inlineconstexpr |
Constructor from lvalue references (for reference semantics).
| value | Reference to value to store |
| null_flag | Reference to flag to store |
Definition at line 638 of file nullable.hpp.
|
inlineconstexpr |
Constructor from moved value and flag reference.
| value | Value to move and store |
| null_flag | Reference to flag to store |
Definition at line 653 of file nullable.hpp.
|
inlineconstexpr |
Constructor from value reference and moved flag.
| value | Reference to value to store |
| null_flag | Flag to move and store |
Definition at line 668 of file nullable.hpp.
|
inlineconstexpr |
Constructor from const value and non-const flag reference (for non-reference types only).
| value | Const reference to value to store |
| null_flag | Reference to flag to store |
Definition at line 689 of file nullable.hpp.
|
inlineconstexpr |
Constructor from two forwarding references (for value types with const qualifiers).
This handles the special case where values are passed with const qualifiers that don't match T and B exactly. Occurs with arrays like bool8_array where inner_const_reference is bool but dereferencing returns const-qualified values.
| value | Value to forward and store |
| null_flag | Flag to forward and store |
Definition at line 713 of file nullable.hpp.
| sparrow::nullable< T, B >::explicit | ( | not impl::both_convertible_from_cond_ref< T, TO, B, BO > | ) |
Converting move constructor from different nullable types.
| TO | Source value type |
| BO | Source flag type |
| rhs | Source nullable to move from |
| sparrow::nullable< T, B >::explicit | ( | not impl::both_convertible_from_cref< T, TO, B, BO > | ) | const |
Converting copy constructor from different nullable types.
| TO | Source value type |
| BO | Source flag type |
| rhs | Source nullable to copy from |
|
inlinenoexcept |
Constructor from a value creating a non-null nullable.
| U | Type of the input value (must be constructible to T) |
| value | Value to store |
Definition at line 464 of file nullable.hpp.
|
nodiscardconstexprnoexcept |
Gets rvalue reference to the stored value.
Definition at line 1436 of file nullable.hpp.
|
nodiscardconstexprnoexcept |
Gets mutable reference to the stored value.
Definition at line 1424 of file nullable.hpp.
|
nodiscardconstexprnoexcept |
Gets const rvalue reference to the stored value.
Definition at line 1449 of file nullable.hpp.
|
nodiscardconstexprnoexcept |
Gets const reference to the stored value.
Definition at line 1430 of file nullable.hpp.
|
nodiscardconstexprnoexcept |
Checks whether the nullable contains a valid value.
Definition at line 1380 of file nullable.hpp.
|
inline |
Definition at line 505 of file nullable.hpp.
|
inline |
Definition at line 574 of file nullable.hpp.
|
nodiscardconstexprnoexcept |
Gets rvalue reference to the validity flag.
Definition at line 1398 of file nullable.hpp.
|
nodiscardconstexprnoexcept |
Gets mutable reference to the validity flag.
Definition at line 1386 of file nullable.hpp.
|
nodiscardconstexprnoexcept |
Gets const rvalue reference to the validity flag.
Definition at line 1411 of file nullable.hpp.
|
nodiscardconstexprnoexcept |
Gets const reference to the validity flag.
Definition at line 1392 of file nullable.hpp.
|
explicitconstexprnoexcept |
Conversion to bool indicating non-null state.
Definition at line 1374 of file nullable.hpp.
|
inlineconstexprnoexcept |
Converting assignment operator from different nullable types.
| TO | Source value type |
| BO | Source flag type |
| rhs | Source nullable to copy from |
Definition at line 802 of file nullable.hpp.
|
inlineconstexprnoexcept |
Default copy assignment operator.
| rhs | Source nullable to copy from |
Definition at line 771 of file nullable.hpp.
|
inlineconstexprnoexcept |
Converting move assignment operator from different nullable types.
| TO | Source value type |
| BO | Source flag type |
| rhs | Source nullable to move from |
Definition at line 854 of file nullable.hpp.
|
inlineconstexprnoexcept |
Assignment from nullval_t, setting nullable to null state.
| nullval_t | nullval sentinel value |
Definition at line 729 of file nullable.hpp.
|
inlineconstexprnoexcept |
Default move assignment operator.
| rhs | Source nullable to move from |
Definition at line 823 of file nullable.hpp.
|
inlineconstexprnoexcept |
Assignment from a value, setting nullable to non-null state.
| TO | Type of the assigned value |
| rhs | Value to assign |
Definition at line 750 of file nullable.hpp.
|
noexcept |
Resets the nullable to null state.
Definition at line 1512 of file nullable.hpp.
|
noexcept |
Swaps this nullable with another.
| other | Nullable to swap with |
Definition at line 1504 of file nullable.hpp.
|
nodiscardconstexpr |
Gets mutable reference to the value with null checking.
| bad_nullable_access | if has_value() is false |
Definition at line 1462 of file nullable.hpp.
|
nodiscardconstexpr |
Gets rvalue reference to the value with null checking.
| bad_nullable_access | if has_value() is false |
Definition at line 1476 of file nullable.hpp.
|
nodiscardconstexpr |
Gets const reference to the value with null checking.
| bad_nullable_access | if has_value() is false |
Definition at line 1469 of file nullable.hpp.
|
nodiscardconstexpr |
Gets const rvalue reference to the value with null checking.
| bad_nullable_access | if has_value() is false |
Definition at line 1483 of file nullable.hpp.
|
nodiscardconstexpr |
Gets the value or a default if null (rvalue version).
| U | Type of the default value |
| default_value | Value to return if nullable is null |
|
constexpr |
Definition at line 1498 of file nullable.hpp.
|
nodiscardconstexpr |
Gets the value or a default if null (const version).
| U | Type of the default value |
| default_value | Value to return if nullable is null |
|
constexpr |
Definition at line 1491 of file nullable.hpp.
|
friend |
Definition at line 1073 of file nullable.hpp.
| BO&& sparrow::nullable< T, B >::rhs |
Definition at line 571 of file nullable.hpp.
| BO& sparrow::nullable< T, B >::rhs |
Definition at line 502 of file nullable.hpp.