sparrow 1.4.0
C++20 idiomatic APIs for the Apache Arrow Columnar Format
Loading...
Searching...
No Matches
sparrow::details::primitive_data_access< T, T2 > Class Template Reference

Provides access to primitive data stored in Arrow format buffers. More...

#include <primitive_data_access.hpp>

Public Types

using inner_value_type = T2
 
using inner_reference = T2&
 
using inner_const_reference = std::conditional_t<std::is_same_v<T2, bool>, T2, const T2&>
 
using inner_pointer = inner_value_type*
 
using inner_const_pointer = const inner_value_type*
 
using value_iterator = pointer_iterator<inner_pointer>
 
using const_value_iterator = pointer_iterator<inner_const_pointer>
 

Public Member Functions

 primitive_data_access (arrow_proxy &proxy, size_t data_buffer_index)
 Constructor for primitive_data_access.
 
 primitive_data_access (const primitive_data_access &)=delete
 
primitive_data_accessoperator= (const primitive_data_access &)=delete
 
 primitive_data_access (primitive_data_access &&)=delete
 
primitive_data_accessoperator= (primitive_data_access &&)=delete
 
constexpr inner_pointer data ()
 
constexpr inner_const_pointer data () const
 
constexpr inner_reference value (size_t i)
 
constexpr inner_const_reference value (size_t i) const
 
constexpr value_iterator value_begin ()
 
constexpr value_iterator value_end ()
 
constexpr const_value_iterator value_cbegin () const
 
constexpr const_value_iterator value_cend () const
 
constexpr void resize_values (size_t new_length, const T2 &value)
 
constexpr value_iterator insert_value (const_value_iterator pos, T2 value, size_t count)
 
constexpr value_iterator insert_value (size_t idx, T2 value, size_t count)
 
template<mpl::iterator_of_type< T2 > InputIt>
constexpr value_iterator insert_values (const_value_iterator pos, InputIt first, InputIt last)
 
template<mpl::iterator_of_type< T2 > InputIt>
constexpr value_iterator insert_values (size_t idx, InputIt first, InputIt last)
 
constexpr value_iterator erase_values (const_value_iterator pos, size_t count)
 
constexpr value_iterator erase_values (size_t idx, size_t count)
 
constexpr void reset_proxy (arrow_proxy &proxy)
 
template<mpl::iterator_of_type< T2 > InputIt>
constexpr auto insert_values (const_value_iterator pos, InputIt first, InputIt last) -> value_iterator
 
template<mpl::iterator_of_type< T2 > InputIt>
constexpr auto insert_values (size_t idx, InputIt first, InputIt last) -> value_iterator
 

Static Public Member Functions

template<std::ranges::input_range RANGE>
static constexpr u8_buffer< T2 > make_data_buffer (RANGE &&r)
 
static constexpr u8_buffer< T2 > make_data_buffer (size_t n, const T2 &value)
 

Detailed Description

template<trivial_copyable_type T, trivial_copyable_type T2 = T>
class sparrow::details::primitive_data_access< T, T2 >

Provides access to primitive data stored in Arrow format buffers.

This class template manages access to primitive data types stored in an Arrow proxy's data buffer. It provides a type-safe interface for accessing, modifying, and iterating over the underlying buffer data.

The class is designed to be used as a private member of array classes and enforces strict ownership semantics by deleting copy and move operations. This ensures that array classes explicitly manage their Arrow proxy relationships through constructor calls and reset_proxy() method.

Template Parameters
TThe outer value type (trivial copyable type)
T2The inner value type stored in the buffer (trivial copyable type, defaults to T)
Note
This class holds a pointer to an arrow_proxy and is not copyable or movable. Array classes using this must explicitly call the constructor with an arrow_proxy or use reset_proxy() for assignment operations.

Key features:

  • Direct access to underlying buffer data via data() methods
  • Element access through value() methods with bounds checking capabilities
  • Iterator support for range-based operations
  • Buffer manipulation operations (resize, insert, erase)
  • Static factory methods for buffer creation
See also
arrow_proxy
pointer_iterator
buffer_adaptor

Definition at line 63 of file primitive_data_access.hpp.

Member Typedef Documentation

◆ const_value_iterator

template<trivial_copyable_type T, trivial_copyable_type T2 = T>
using sparrow::details::primitive_data_access< T, T2 >::const_value_iterator = pointer_iterator<inner_const_pointer>

Definition at line 74 of file primitive_data_access.hpp.

◆ inner_const_pointer

template<trivial_copyable_type T, trivial_copyable_type T2 = T>
using sparrow::details::primitive_data_access< T, T2 >::inner_const_pointer = const inner_value_type*

Definition at line 71 of file primitive_data_access.hpp.

◆ inner_const_reference

template<trivial_copyable_type T, trivial_copyable_type T2 = T>
using sparrow::details::primitive_data_access< T, T2 >::inner_const_reference = std::conditional_t<std::is_same_v<T2, bool>, T2, const T2&>

Definition at line 69 of file primitive_data_access.hpp.

◆ inner_pointer

template<trivial_copyable_type T, trivial_copyable_type T2 = T>
using sparrow::details::primitive_data_access< T, T2 >::inner_pointer = inner_value_type*

Definition at line 70 of file primitive_data_access.hpp.

◆ inner_reference

template<trivial_copyable_type T, trivial_copyable_type T2 = T>
using sparrow::details::primitive_data_access< T, T2 >::inner_reference = T2&

Definition at line 68 of file primitive_data_access.hpp.

◆ inner_value_type

template<trivial_copyable_type T, trivial_copyable_type T2 = T>
using sparrow::details::primitive_data_access< T, T2 >::inner_value_type = T2

Definition at line 67 of file primitive_data_access.hpp.

◆ value_iterator

template<trivial_copyable_type T, trivial_copyable_type T2 = T>
using sparrow::details::primitive_data_access< T, T2 >::value_iterator = pointer_iterator<inner_pointer>

Definition at line 73 of file primitive_data_access.hpp.

Constructor & Destructor Documentation

◆ primitive_data_access() [1/3]

template<trivial_copyable_type T, trivial_copyable_type T2>
sparrow::details::primitive_data_access< T, T2 >::primitive_data_access ( arrow_proxy & proxy,
size_t data_buffer_index )

Constructor for primitive_data_access.

Parameters
proxyArrow proxy object that holds the data buffer.
data_buffer_indexIndex of the data buffer.

Definition at line 231 of file primitive_data_access.hpp.

◆ primitive_data_access() [2/3]

template<trivial_copyable_type T, trivial_copyable_type T2 = T>
sparrow::details::primitive_data_access< T, T2 >::primitive_data_access ( const primitive_data_access< T, T2 > & )
delete

◆ primitive_data_access() [3/3]

template<trivial_copyable_type T, trivial_copyable_type T2 = T>
sparrow::details::primitive_data_access< T, T2 >::primitive_data_access ( primitive_data_access< T, T2 > && )
delete

Member Function Documentation

◆ data() [1/2]

template<trivial_copyable_type T, trivial_copyable_type T2>
auto sparrow::details::primitive_data_access< T, T2 >::data ( )
nodiscardconstexpr

Definition at line 238 of file primitive_data_access.hpp.

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

◆ data() [2/2]

template<trivial_copyable_type T, trivial_copyable_type T2>
auto sparrow::details::primitive_data_access< T, T2 >::data ( ) const
nodiscardconstexpr

Definition at line 245 of file primitive_data_access.hpp.

Here is the call graph for this function:

◆ erase_values() [1/2]

template<trivial_copyable_type T, trivial_copyable_type T2>
auto sparrow::details::primitive_data_access< T, T2 >::erase_values ( const_value_iterator pos,
size_t count )
constexpr

Definition at line 351 of file primitive_data_access.hpp.

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

◆ erase_values() [2/2]

template<trivial_copyable_type T, trivial_copyable_type T2>
auto sparrow::details::primitive_data_access< T, T2 >::erase_values ( size_t idx,
size_t count )
constexpr

Definition at line 370 of file primitive_data_access.hpp.

Here is the call graph for this function:

◆ insert_value() [1/2]

template<trivial_copyable_type T, trivial_copyable_type T2>
auto sparrow::details::primitive_data_access< T, T2 >::insert_value ( const_value_iterator pos,
T2 value,
size_t count )
constexpr

Definition at line 299 of file primitive_data_access.hpp.

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

◆ insert_value() [2/2]

template<trivial_copyable_type T, trivial_copyable_type T2>
auto sparrow::details::primitive_data_access< T, T2 >::insert_value ( size_t idx,
T2 value,
size_t count )
constexpr

Definition at line 313 of file primitive_data_access.hpp.

Here is the call graph for this function:

◆ insert_values() [1/4]

template<trivial_copyable_type T, trivial_copyable_type T2 = T>
template<mpl::iterator_of_type< T2 > InputIt>
value_iterator sparrow::details::primitive_data_access< T, T2 >::insert_values ( const_value_iterator pos,
InputIt first,
InputIt last )
constexpr

◆ insert_values() [2/4]

template<trivial_copyable_type T, trivial_copyable_type T2 = T>
template<mpl::iterator_of_type< T2 > InputIt>
auto sparrow::details::primitive_data_access< T, T2 >::insert_values ( const_value_iterator pos,
InputIt first,
InputIt last ) -> value_iterator
constexpr

Definition at line 326 of file primitive_data_access.hpp.

◆ insert_values() [3/4]

template<trivial_copyable_type T, trivial_copyable_type T2 = T>
template<mpl::iterator_of_type< T2 > InputIt>
value_iterator sparrow::details::primitive_data_access< T, T2 >::insert_values ( size_t idx,
InputIt first,
InputIt last )
constexpr

◆ insert_values() [4/4]

template<trivial_copyable_type T, trivial_copyable_type T2 = T>
template<mpl::iterator_of_type< T2 > InputIt>
auto sparrow::details::primitive_data_access< T, T2 >::insert_values ( size_t idx,
InputIt first,
InputIt last ) -> value_iterator
constexpr

Definition at line 341 of file primitive_data_access.hpp.

◆ make_data_buffer() [1/2]

template<trivial_copyable_type T, trivial_copyable_type T2>
template<std::ranges::input_range RANGE>
u8_buffer< T2 > sparrow::details::primitive_data_access< T, T2 >::make_data_buffer ( RANGE && r)
staticnodiscardconstexpr
Examples
/home/runner/work/sparrow/sparrow/include/sparrow/layout/primitive_array_impl.hpp.

Definition at line 387 of file primitive_data_access.hpp.

Here is the caller graph for this function:

◆ make_data_buffer() [2/2]

template<trivial_copyable_type T, trivial_copyable_type T2>
u8_buffer< T2 > sparrow::details::primitive_data_access< T, T2 >::make_data_buffer ( size_t n,
const T2 & value )
staticnodiscardconstexpr

Definition at line 394 of file primitive_data_access.hpp.

Here is the call graph for this function:

◆ operator=() [1/2]

template<trivial_copyable_type T, trivial_copyable_type T2 = T>
primitive_data_access & sparrow::details::primitive_data_access< T, T2 >::operator= ( const primitive_data_access< T, T2 > & )
delete

◆ operator=() [2/2]

template<trivial_copyable_type T, trivial_copyable_type T2 = T>
primitive_data_access & sparrow::details::primitive_data_access< T, T2 >::operator= ( primitive_data_access< T, T2 > && )
delete

◆ reset_proxy()

template<trivial_copyable_type T, trivial_copyable_type T2>
void sparrow::details::primitive_data_access< T, T2 >::reset_proxy ( arrow_proxy & proxy)
constexpr

Definition at line 380 of file primitive_data_access.hpp.

◆ resize_values()

template<trivial_copyable_type T, trivial_copyable_type T2>
void sparrow::details::primitive_data_access< T, T2 >::resize_values ( size_t new_length,
const T2 & value )
constexpr

Definition at line 291 of file primitive_data_access.hpp.

Here is the call graph for this function:

◆ value() [1/2]

template<trivial_copyable_type T, trivial_copyable_type T2>
auto sparrow::details::primitive_data_access< T, T2 >::value ( size_t i)
nodiscardconstexpr

Definition at line 252 of file primitive_data_access.hpp.

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

◆ value() [2/2]

template<trivial_copyable_type T, trivial_copyable_type T2>
auto sparrow::details::primitive_data_access< T, T2 >::value ( size_t i) const
nodiscardconstexpr

Definition at line 259 of file primitive_data_access.hpp.

Here is the call graph for this function:

◆ value_begin()

template<trivial_copyable_type T, trivial_copyable_type T2>
auto sparrow::details::primitive_data_access< T, T2 >::value_begin ( )
nodiscardconstexpr

Definition at line 267 of file primitive_data_access.hpp.

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

◆ value_cbegin()

template<trivial_copyable_type T, trivial_copyable_type T2>
auto sparrow::details::primitive_data_access< T, T2 >::value_cbegin ( ) const
nodiscardconstexpr

Definition at line 279 of file primitive_data_access.hpp.

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

◆ value_cend()

template<trivial_copyable_type T, trivial_copyable_type T2>
auto sparrow::details::primitive_data_access< T, T2 >::value_cend ( ) const
nodiscardconstexpr

Definition at line 285 of file primitive_data_access.hpp.

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

◆ value_end()

template<trivial_copyable_type T, trivial_copyable_type T2>
auto sparrow::details::primitive_data_access< T, T2 >::value_end ( )
nodiscardconstexpr

Definition at line 273 of file primitive_data_access.hpp.

Here is the call graph for this function:

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