sparrow 2.4.0
C++20 idiomatic APIs for the Apache Arrow Columnar Format
Loading...
Searching...
No Matches
sparrow::decimal_array< T > Class Template Reference

Array implementation for decimal types. More...

#include <decimal_array.hpp>

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

Public Types

using self_type = decimal_array<T>
using base_type = mutable_array_bitmap_base<self_type>
using inner_types = array_inner_types<self_type>
using inner_value_type = typename inner_types::inner_value_type
using inner_reference = typename inner_types::inner_reference
using inner_const_reference = typename inner_types::inner_const_reference
using storage_type = typename T::integer_type
using bitmap_type = typename base_type::bitmap_type
using bitmap_const_reference = typename base_type::bitmap_const_reference
using const_bitmap_iterator = typename base_type::const_bitmap_iterator
using const_bitmap_range = typename base_type::const_bitmap_range
using value_type = nullable<inner_value_type>
using const_reference = nullable<inner_const_reference, bitmap_const_reference>
using size_type = typename base_type::size_type
using difference_type = typename base_type::difference_type
using iterator_tag = typename base_type::iterator_tag
using value_iterator = typename inner_types::value_iterator
using const_value_iterator = typename inner_types::const_value_iterator
Public Types inherited from sparrow::array_bitmap_base_impl< D, true >
using base_type
using size_type
using bitmap_type
using const_bitmap_type
using bitmap_iterator
using const_bitmap_iterator
using bitmap_const_reference
using difference_type
using const_bitmap_range
using iterator_tag

Public Member Functions

 decimal_array (arrow_proxy proxy)
 Constructs a decimal array from an arrow proxy.
 decimal_array (const decimal_array &rhs)
 Copy constructor.
decimal_arrayoperator= (const decimal_array &rhs)
 Copy assignment operator.
 decimal_array (decimal_array &&rhs) noexcept=default
 Move constructor.
decimal_arrayoperator= (decimal_array &&rhs) noexcept=default
 Move assignment operator.
template<class... Args>
requires (mpl::excludes_copy_and_move_ctor_v<decimal_array<T>, Args...>)
 decimal_array (Args &&... args)
 Constructs a decimal array with the given arguments.
constexpr inner_reference value (size_type i)
 Gets a mutable reference to the value at the specified index.
constexpr inner_const_reference value (size_type i) const
 Gets a constant reference to the value at the specified index.
Public Member Functions inherited from sparrow::array_bitmap_base_impl< D, true >
constexpr auto insert_bitmap (const_bitmap_iterator pos, InputIt first, InputIt last) -> bitmap_iterator is_mutable

Friends

class detail::layout_value_functor< self_type, inner_value_type >
class detail::layout_value_functor< const self_type, inner_value_type >
class decimal_reference< self_type >

Additional Inherited Members

Protected Member Functions inherited from sparrow::array_bitmap_base_impl< D, true >
 array_bitmap_base_impl (arrow_proxy proxy)
 Constructs array bitmap base from Arrow proxy.
constexpr array_bitmap_base_impl (const array_bitmap_base_impl &)
 Copy constructor.
constexpr array_bitmap_base_imploperator= (const array_bitmap_base_impl &)
 Copy assignment operator.
constexpr array_bitmap_base_impl (array_bitmap_base_impl &&) noexcept=default
constexpr array_bitmap_base_imploperator= (array_bitmap_base_impl &&) noexcept=default
constexpr bitmap_typeget_bitmap ()
 Gets mutable reference to the validity bitmap.
constexpr const const_bitmap_typeget_bitmap () const
 Gets const reference to the validity bitmap.
constexpr void resize_bitmap (size_type new_length, bool value)
 Resizes the validity bitmap to accommodate new array length.
constexpr bitmap_iterator insert_bitmap (const_bitmap_iterator pos, bool value, size_type count)
 Inserts validity bits at specified position.
constexpr bitmap_iterator insert_bitmap (const_bitmap_iterator pos, InputIt first, InputIt last)
 Inserts range of validity bits at specified position.
constexpr bitmap_iterator erase_bitmap (const_bitmap_iterator pos, size_type count)
 Erases validity bits starting at specified position.

Detailed Description

template<decimal_type T>
class sparrow::decimal_array< T >

Array implementation for decimal types.

Array implementation for decimal types with fixed precision and scale.

Template Parameters
TThe decimal type (e.g., decimal<int32_t>, decimal<int64_t>, etc.).

This class provides a container for decimal values with a specified precision and scale, stored as integer values with an associated scaling factor.

Template Parameters
TThe decimal type, must satisfy the decimal_type concept.

Definition at line 164 of file decimal_array.hpp.

Member Typedef Documentation

◆ base_type

template<decimal_type T>
using sparrow::decimal_array< T >::base_type = mutable_array_bitmap_base<self_type>

Definition at line 169 of file decimal_array.hpp.

◆ bitmap_const_reference

template<decimal_type T>
using sparrow::decimal_array< T >::bitmap_const_reference = typename base_type::bitmap_const_reference

Definition at line 185 of file decimal_array.hpp.

◆ bitmap_type

template<decimal_type T>
using sparrow::decimal_array< T >::bitmap_type = typename base_type::bitmap_type

Definition at line 184 of file decimal_array.hpp.

◆ const_bitmap_iterator

template<decimal_type T>
using sparrow::decimal_array< T >::const_bitmap_iterator = typename base_type::const_bitmap_iterator

Definition at line 186 of file decimal_array.hpp.

◆ const_bitmap_range

template<decimal_type T>
using sparrow::decimal_array< T >::const_bitmap_range = typename base_type::const_bitmap_range

Definition at line 187 of file decimal_array.hpp.

◆ const_reference

template<decimal_type T>
using sparrow::decimal_array< T >::const_reference = nullable<inner_const_reference, bitmap_const_reference>

Definition at line 190 of file decimal_array.hpp.

◆ const_value_iterator

template<decimal_type T>
using sparrow::decimal_array< T >::const_value_iterator = typename inner_types::const_value_iterator

Definition at line 197 of file decimal_array.hpp.

◆ difference_type

template<decimal_type T>
using sparrow::decimal_array< T >::difference_type = typename base_type::difference_type

Definition at line 193 of file decimal_array.hpp.

◆ inner_const_reference

template<decimal_type T>
using sparrow::decimal_array< T >::inner_const_reference = typename inner_types::inner_const_reference

Definition at line 174 of file decimal_array.hpp.

◆ inner_reference

template<decimal_type T>
using sparrow::decimal_array< T >::inner_reference = typename inner_types::inner_reference

Definition at line 173 of file decimal_array.hpp.

◆ inner_types

template<decimal_type T>
using sparrow::decimal_array< T >::inner_types = array_inner_types<self_type>

Definition at line 171 of file decimal_array.hpp.

◆ inner_value_type

template<decimal_type T>
using sparrow::decimal_array< T >::inner_value_type = typename inner_types::inner_value_type

Definition at line 172 of file decimal_array.hpp.

◆ iterator_tag

template<decimal_type T>
using sparrow::decimal_array< T >::iterator_tag = typename base_type::iterator_tag

Definition at line 194 of file decimal_array.hpp.

◆ self_type

template<decimal_type T>
using sparrow::decimal_array< T >::self_type = decimal_array<T>

Definition at line 168 of file decimal_array.hpp.

◆ size_type

template<decimal_type T>
using sparrow::decimal_array< T >::size_type = typename base_type::size_type

Definition at line 192 of file decimal_array.hpp.

◆ storage_type

template<decimal_type T>
using sparrow::decimal_array< T >::storage_type = typename T::integer_type

Definition at line 177 of file decimal_array.hpp.

◆ value_iterator

template<decimal_type T>
using sparrow::decimal_array< T >::value_iterator = typename inner_types::value_iterator

Definition at line 196 of file decimal_array.hpp.

◆ value_type

template<decimal_type T>
using sparrow::decimal_array< T >::value_type = nullable<inner_value_type>

Definition at line 189 of file decimal_array.hpp.

Constructor & Destructor Documentation

◆ decimal_array() [1/4]

template<decimal_type T>
sparrow::decimal_array< T >::decimal_array ( arrow_proxy proxy)
explicit

Constructs a decimal array from an arrow proxy.

Parameters
proxyThe arrow proxy containing the array data and schema.

Definition at line 551 of file decimal_array.hpp.

Here is the caller graph for this function:

◆ decimal_array() [2/4]

template<decimal_type T>
sparrow::decimal_array< T >::decimal_array ( const decimal_array< T > & rhs)

Copy constructor.

Parameters
rhsThe decimal array to copy from.

Definition at line 581 of file decimal_array.hpp.

Here is the call graph for this function:

◆ decimal_array() [3/4]

template<decimal_type T>
sparrow::decimal_array< T >::decimal_array ( decimal_array< T > && rhs)
defaultnoexcept

Move constructor.

Parameters
rhsThe decimal array to move from.

◆ decimal_array() [4/4]

template<decimal_type T>
template<class... Args>
requires (mpl::excludes_copy_and_move_ctor_v<decimal_array<T>, Args...>)
sparrow::decimal_array< T >::decimal_array ( Args &&... args)
inlineexplicit

Constructs a decimal array with the given arguments.

Template Parameters
ArgsThe argument types.
Parameters
argsArguments forwarded to create_proxy.

Definition at line 244 of file decimal_array.hpp.

Member Function Documentation

◆ operator=() [1/2]

template<decimal_type T>
decimal_array< T > & sparrow::decimal_array< T >::operator= ( const decimal_array< T > & rhs)

Copy assignment operator.

Parameters
rhsThe decimal array to assign from.
Returns
Reference to this array.

Definition at line 590 of file decimal_array.hpp.

Here is the call graph for this function:

◆ operator=() [2/2]

template<decimal_type T>
decimal_array & sparrow::decimal_array< T >::operator= ( decimal_array< T > && rhs)
defaultnoexcept

Move assignment operator.

Parameters
rhsThe decimal array to move assign from.
Returns
Reference to this array.

◆ value() [1/2]

template<decimal_type T>
auto sparrow::decimal_array< T >::value ( size_type i)
nodiscardconstexpr

Gets a mutable reference to the value at the specified index.

Parameters
iThe index of the element.
Returns
Mutable reference to the decimal value.

Definition at line 771 of file decimal_array.hpp.

◆ value() [2/2]

template<decimal_type T>
auto sparrow::decimal_array< T >::value ( size_type i) const
nodiscardconstexpr

Gets a constant reference to the value at the specified index.

Parameters
iThe index of the element.
Returns
Constant reference to the decimal value.

Definition at line 778 of file decimal_array.hpp.

◆ decimal_reference< self_type >

template<decimal_type T>
friend class decimal_reference< self_type >
friend

Definition at line 535 of file decimal_array.hpp.

◆ detail::layout_value_functor< const self_type, inner_value_type >

template<decimal_type T>
friend class detail::layout_value_functor< const self_type, inner_value_type >
friend

Definition at line 535 of file decimal_array.hpp.

◆ detail::layout_value_functor< self_type, inner_value_type >

template<decimal_type T>
friend class detail::layout_value_functor< self_type, inner_value_type >
friend

Definition at line 535 of file decimal_array.hpp.


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