8 #ifndef INCLUDED_ORCUS_SPREADSHEET_PIVOT_HPP
9 #define INCLUDED_ORCUS_SPREADSHEET_PIVOT_HPP
12 #include "../types.hpp"
31 namespace spreadsheet {
35 using pivot_cache_indices_t = std::vector<size_t>;
39 using value_type = std::variant<bool, double, std::size_t, std::string_view, date_time_t>;
41 enum class record_type
65 using pivot_cache_record_t = std::vector<pivot_cache_record_value_t>;
69 using value_type = std::variant<bool, double, std::string_view, date_time_t, error_value_t>;
73 unknown = 0, boolean, date_time, character, numeric, blank, error
97 using pivot_cache_items_t = std::vector<pivot_cache_item_t>;
106 pivot_cache_group_by_t group_by = pivot_cache_group_by_t::range;
108 bool auto_start =
true;
109 bool auto_end =
true;
113 double interval = 1.0;
127 std::optional<range_grouping_type> range_grouping;
152 pivot_cache_items_t items;
154 std::optional<double> min_value;
155 std::optional<double> max_value;
157 std::optional<date_time_t> min_date;
158 std::optional<date_time_t> max_date;
160 std::unique_ptr<pivot_cache_group_data_t> group_data;
171 std::unique_ptr<impl> mp_impl;
174 using fields_type = std::vector<pivot_cache_field_t>;
175 using records_type = std::vector<pivot_cache_record_t>;
188 void insert_records(records_type record);
190 size_t get_field_count()
const;
202 pivot_cache_id_t get_id()
const;
204 const records_type& get_all_records()
const;
210 std::unique_ptr<impl> mp_impl;
225 std::string_view sheet_name,
const ixion::abs_range_t& range, std::unique_ptr<pivot_cache>&& cache);
243 std::string_view sheet_name,
const ixion::abs_range_t& range)
const;
247 const pivot_cache* get_cache(pivot_cache_id_t cache_id)
const;
Definition: document.hpp:54
Definition: pivot.hpp:169
void insert_fields(fields_type fields)
const pivot_cache_field_t * get_field(size_t index) const
Definition: pivot.hpp:208
void insert_worksheet_cache(std::string_view sheet_name, const ixion::abs_range_t &range, std::unique_ptr< pivot_cache > &&cache)
size_t get_cache_count() const
void insert_worksheet_cache(std::string_view table_name, std::unique_ptr< pivot_cache > &&cache)
Definition: string_pool.hpp:26
Definition: types.hpp:527
Definition: pivot.hpp:145
std::string_view name
Definition: pivot.hpp:150
Definition: pivot.hpp:105
Definition: pivot.hpp:103
pivot_cache_indices_t base_to_group_indices
Definition: pivot.hpp:125
pivot_cache_items_t items
Definition: pivot.hpp:132
size_t base_field
Definition: pivot.hpp:135