sparrow 0.3.0
Loading...
Searching...
No Matches
sparrow::timestamp_array< T > Class Template Reference

Array of timestamps. More...

#include <timestamp_array.hpp>

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

Public Types

using self_type = timestamp_array
 
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 bitmap_type = typename base_type::bitmap_type
 
using bitmap_reference = typename base_type::bitmap_reference
 
using bitmap_const_reference = typename base_type::bitmap_const_reference
 
using bitmap_iterator = typename base_type::bitmap_iterator
 
using const_bitmap_iterator = typename base_type::const_bitmap_iterator
 
using bitmap_range = typename base_type::bitmap_range
 
using const_bitmap_range = typename base_type::const_bitmap_range
 
using value_type = nullable<inner_value_type>
 
using reference = nullable<inner_reference, bitmap_reference>
 
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 base_type::value_iterator
 
using const_value_iterator = typename base_type::const_value_iterator
 
using iterator = typename base_type::iterator
 
using const_iterator = typename base_type::const_iterator
 
using functor_type = typename inner_types::functor_type
 
using const_functor_type = typename inner_types::const_functor_type
 
using inner_value_type_duration = inner_value_type::duration
 
using buffer_inner_value_type = inner_value_type_duration::rep
 
using buffer_inner_value_iterator = pointer_iterator<buffer_inner_value_type*>
 
using buffer_inner_const_value_iterator = pointer_iterator<const buffer_inner_value_type*>
 
- Public Types inherited from sparrow::array_bitmap_base_impl< D, true >
using base_type
 
using size_type
 
using 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

 timestamp_array (arrow_proxy)
 
template<class... Args>
requires (mpl::excludes_copy_and_move_ctor_v<timestamp_array, Args...>)
 timestamp_array (Args &&... args)
 Construct a timestamp array with the passed range of values and an optional bitmap.
 
 timestamp_array (const date::time_zone *timezone, std::initializer_list< inner_value_type > init, std::optional< std::string_view > name=std::nullopt, std::optional< std::string_view > metadata=std::nullopt)
 
- Public Member Functions inherited from sparrow::array_bitmap_base_impl< D, true >
auto insert_bitmap (const_bitmap_iterator pos, InputIt first, InputIt last) -> bitmap_iterator is_mutable
 
auto insert_bitmap (const_bitmap_iterator pos, InputIt first, InputIt last) -> bitmap_iterator is_mutable
 

Friends

class timestamp_reference< self_type >
 

Additional Inherited Members

- Protected Member Functions inherited from sparrow::array_bitmap_base_impl< D, true >
 array_bitmap_base_impl (arrow_proxy)
 
 array_bitmap_base_impl (const array_bitmap_base_impl &)
 
array_bitmap_base_imploperator= (const array_bitmap_base_impl &)
 
 array_bitmap_base_impl (array_bitmap_base_impl &&) noexcept=default
 
array_bitmap_base_imploperator= (array_bitmap_base_impl &&) noexcept=default
 
bitmap_typeget_bitmap ()
 
const bitmap_typeget_bitmap () const
 
void resize_bitmap (size_type new_length, bool value)
 
bitmap_iterator insert_bitmap (const_bitmap_iterator pos, bool value, size_type count)
 
bitmap_iterator insert_bitmap (const_bitmap_iterator pos, InputIt first, InputIt last) is_mutable
 
bitmap_iterator erase_bitmap (const_bitmap_iterator pos, size_type count)
 
void update ()
 
non_owning_dynamic_bitset< uint8_t > get_non_owning_dynamic_bitset ()
 
bitmap_type make_bitmap ()
 
 array_bitmap_base_impl (arrow_proxy)
 
 array_bitmap_base_impl (const array_bitmap_base_impl &)
 
 array_bitmap_base_impl (array_bitmap_base_impl &&) noexcept=default
 
array_bitmap_base_imploperator= (const array_bitmap_base_impl &)
 
array_bitmap_base_imploperator= (array_bitmap_base_impl &&) noexcept=default
 
bitmap_typeget_bitmap ()
 
const bitmap_typeget_bitmap () const
 
void resize_bitmap (size_type new_length, bool value)
 
bitmap_iterator insert_bitmap (const_bitmap_iterator pos, bool value, size_type count)
 
bitmap_iterator insert_bitmap (const_bitmap_iterator pos, InputIt first, InputIt last) is_mutable
 
bitmap_iterator erase_bitmap (const_bitmap_iterator pos, size_type count)
 
void update ()
 
non_owning_dynamic_bitset< uint8_t > get_non_owning_dynamic_bitset ()
 
bitmap_type make_bitmap ()
 

Detailed Description

template<timestamp_type T>
class sparrow::timestamp_array< T >

Array of timestamps.

The type of the values in the array are timestamp, whose duration/representation is known at compile time. The current implementation supports types whose size is known at compile time only.

As the other arrays in sparrow, timestamp_array<T> provides an API as if it was holding nullable<T> values instead of T values.

Internally, the array contains a validity bitmap and a contiguous memory buffer holding the values.

Template Parameters
Tthe type of the values in the array. Must be one of these values:
See also
https://arrow.apache.org/docs/dev/format/Columnar.html#fixed-size-primitive-layout
Examples
timestamp_example.cpp.

Definition at line 103 of file timestamp_array.hpp.

Member Typedef Documentation

◆ base_type

template<timestamp_type T>
using sparrow::timestamp_array< T >::base_type = mutable_array_bitmap_base<self_type>

Definition at line 108 of file timestamp_array.hpp.

◆ bitmap_const_reference

template<timestamp_type T>
using sparrow::timestamp_array< T >::bitmap_const_reference = typename base_type::bitmap_const_reference

Definition at line 117 of file timestamp_array.hpp.

◆ bitmap_iterator

template<timestamp_type T>
using sparrow::timestamp_array< T >::bitmap_iterator = typename base_type::bitmap_iterator

Definition at line 118 of file timestamp_array.hpp.

◆ bitmap_range

template<timestamp_type T>
using sparrow::timestamp_array< T >::bitmap_range = typename base_type::bitmap_range

Definition at line 120 of file timestamp_array.hpp.

◆ bitmap_reference

template<timestamp_type T>
using sparrow::timestamp_array< T >::bitmap_reference = typename base_type::bitmap_reference

Definition at line 116 of file timestamp_array.hpp.

◆ bitmap_type

template<timestamp_type T>
using sparrow::timestamp_array< T >::bitmap_type = typename base_type::bitmap_type

Definition at line 115 of file timestamp_array.hpp.

◆ buffer_inner_const_value_iterator

template<timestamp_type T>
using sparrow::timestamp_array< T >::buffer_inner_const_value_iterator = pointer_iterator<const buffer_inner_value_type*>

Definition at line 143 of file timestamp_array.hpp.

◆ buffer_inner_value_iterator

template<timestamp_type T>
using sparrow::timestamp_array< T >::buffer_inner_value_iterator = pointer_iterator<buffer_inner_value_type*>

Definition at line 142 of file timestamp_array.hpp.

◆ buffer_inner_value_type

template<timestamp_type T>
using sparrow::timestamp_array< T >::buffer_inner_value_type = inner_value_type_duration::rep

Definition at line 141 of file timestamp_array.hpp.

◆ const_bitmap_iterator

template<timestamp_type T>
using sparrow::timestamp_array< T >::const_bitmap_iterator = typename base_type::const_bitmap_iterator

Definition at line 119 of file timestamp_array.hpp.

◆ const_bitmap_range

template<timestamp_type T>
using sparrow::timestamp_array< T >::const_bitmap_range = typename base_type::const_bitmap_range

Definition at line 121 of file timestamp_array.hpp.

◆ const_functor_type

template<timestamp_type T>
using sparrow::timestamp_array< T >::const_functor_type = typename inner_types::const_functor_type

Definition at line 138 of file timestamp_array.hpp.

◆ const_iterator

template<timestamp_type T>
using sparrow::timestamp_array< T >::const_iterator = typename base_type::const_iterator

Definition at line 135 of file timestamp_array.hpp.

◆ const_reference

template<timestamp_type T>
using sparrow::timestamp_array< T >::const_reference = nullable<inner_const_reference, bitmap_const_reference>

Definition at line 125 of file timestamp_array.hpp.

◆ const_value_iterator

template<timestamp_type T>
using sparrow::timestamp_array< T >::const_value_iterator = typename base_type::const_value_iterator

Definition at line 132 of file timestamp_array.hpp.

◆ difference_type

template<timestamp_type T>
using sparrow::timestamp_array< T >::difference_type = typename base_type::difference_type

Definition at line 128 of file timestamp_array.hpp.

◆ functor_type

template<timestamp_type T>
using sparrow::timestamp_array< T >::functor_type = typename inner_types::functor_type

Definition at line 137 of file timestamp_array.hpp.

◆ inner_const_reference

template<timestamp_type T>
using sparrow::timestamp_array< T >::inner_const_reference = typename inner_types::inner_const_reference

Definition at line 113 of file timestamp_array.hpp.

◆ inner_reference

template<timestamp_type T>
using sparrow::timestamp_array< T >::inner_reference = typename inner_types::inner_reference

Definition at line 112 of file timestamp_array.hpp.

◆ inner_types

template<timestamp_type T>
using sparrow::timestamp_array< T >::inner_types = array_inner_types<self_type>

Definition at line 110 of file timestamp_array.hpp.

◆ inner_value_type

template<timestamp_type T>
using sparrow::timestamp_array< T >::inner_value_type = typename inner_types::inner_value_type

Definition at line 111 of file timestamp_array.hpp.

◆ inner_value_type_duration

template<timestamp_type T>
using sparrow::timestamp_array< T >::inner_value_type_duration = inner_value_type::duration

Definition at line 140 of file timestamp_array.hpp.

◆ iterator

template<timestamp_type T>
using sparrow::timestamp_array< T >::iterator = typename base_type::iterator

Definition at line 134 of file timestamp_array.hpp.

◆ iterator_tag

template<timestamp_type T>
using sparrow::timestamp_array< T >::iterator_tag = typename base_type::iterator_tag

Definition at line 129 of file timestamp_array.hpp.

◆ reference

template<timestamp_type T>
using sparrow::timestamp_array< T >::reference = nullable<inner_reference, bitmap_reference>

Definition at line 124 of file timestamp_array.hpp.

◆ self_type

template<timestamp_type T>
using sparrow::timestamp_array< T >::self_type = timestamp_array

Definition at line 107 of file timestamp_array.hpp.

◆ size_type

template<timestamp_type T>
using sparrow::timestamp_array< T >::size_type = typename base_type::size_type

Definition at line 127 of file timestamp_array.hpp.

◆ value_iterator

template<timestamp_type T>
using sparrow::timestamp_array< T >::value_iterator = typename base_type::value_iterator

Definition at line 131 of file timestamp_array.hpp.

◆ value_type

template<timestamp_type T>
using sparrow::timestamp_array< T >::value_type = nullable<inner_value_type>

Definition at line 123 of file timestamp_array.hpp.

Constructor & Destructor Documentation

◆ timestamp_array() [1/3]

template<timestamp_type T>
sparrow::timestamp_array< T >::timestamp_array ( arrow_proxy proxy)
explicit

Definition at line 312 of file timestamp_array.hpp.

◆ timestamp_array() [2/3]

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

Construct a timestamp array with the passed range of values and an optional bitmap.

The first argument is const date::time_zone*. It is the timezone of the timestamps. The second argument can be any range of values as long as its value type is convertible to T . The third argument can be:

  • a bitmap range, i.e. a range of boolean-like values indicating the non-missing values. The bitmap range and the value range must have the same size.
    std::vector<sparrow::timestamp<std::chrono::seconds>> input_values;
    ***fill input_values ***
    std::vector<bool> a_bitmap(input_values.size(), true);
    a_bitmap[3] = false;
    const date::time_zone* newyork_tz = date::locate_zone("America/New_York");
    primitive_array<int> pr(input_values, a_bitmap);
    array_trivial_copyable< T > primitive_array
    Array of values of whose type has fixed binary size.
  • a range of indices indicating the missing values.
    std::vector<std::size_t> false_pos { 3, 8 };
    primitive_array<int> pr(input_values, a_bitmap);
  • omitted: this is equivalent as passing a bitmap range full of true.
    primitive_array<int> pr(input_values);

Definition at line 176 of file timestamp_array.hpp.

◆ timestamp_array() [3/3]

template<timestamp_type T>
sparrow::timestamp_array< T >::timestamp_array ( const date::time_zone * timezone,
std::initializer_list< inner_value_type > init,
std::optional< std::string_view > name = std::nullopt,
std::optional< std::string_view > metadata = std::nullopt )
inline

Definition at line 183 of file timestamp_array.hpp.

Friends And Related Symbol Documentation

◆ timestamp_reference< self_type >

template<timestamp_type T>
friend class timestamp_reference< self_type >
friend

Definition at line 295 of file timestamp_array.hpp.


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