37struct ORCUS_SPM_DLLPUBLIC pivot_cache_record_value_t
39 using value_type = std::variant<bool, double, std::size_t, std::string_view, date_time_t>;
41 enum class record_type
56 pivot_cache_record_value_t();
57 pivot_cache_record_value_t(std::string_view s);
58 pivot_cache_record_value_t(
double v);
59 pivot_cache_record_value_t(
size_t index);
61 bool operator== (
const pivot_cache_record_value_t& other)
const;
62 bool operator!= (
const pivot_cache_record_value_t& other)
const;
67struct ORCUS_SPM_DLLPUBLIC pivot_cache_item_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
80 pivot_cache_item_t(std::string_view s);
81 pivot_cache_item_t(
double numeric);
82 pivot_cache_item_t(
bool boolean);
84 pivot_cache_item_t(error_value_t error);
86 pivot_cache_item_t(
const pivot_cache_item_t& other);
87 pivot_cache_item_t(pivot_cache_item_t&& other);
89 bool operator< (
const pivot_cache_item_t& other)
const;
90 bool operator== (
const pivot_cache_item_t& other)
const;
92 pivot_cache_item_t& operator= (pivot_cache_item_t other);
94 void swap(pivot_cache_item_t& other);
102struct ORCUS_SPM_DLLPUBLIC pivot_cache_group_data_t
104 struct ORCUS_SPM_DLLPUBLIC range_grouping_type
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;
118 range_grouping_type() =
default;
119 range_grouping_type(
const range_grouping_type& other) =
default;
127 std::optional<range_grouping_type> range_grouping;
137 pivot_cache_group_data_t(
size_t _base_field);
138 pivot_cache_group_data_t(
const pivot_cache_group_data_t& other);
139 pivot_cache_group_data_t(pivot_cache_group_data_t&& other);
141 pivot_cache_group_data_t() =
delete;
144struct ORCUS_SPM_DLLPUBLIC pivot_cache_field_t
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;
162 pivot_cache_field_t();
163 pivot_cache_field_t(std::string_view _name);
164 pivot_cache_field_t(
const pivot_cache_field_t& other);
165 pivot_cache_field_t(pivot_cache_field_t&& other);
168class ORCUS_SPM_DLLPUBLIC pivot_cache
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>;
177 pivot_cache(pivot_cache_id_t cache_id,
string_pool& sp);
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;
207class ORCUS_SPM_DLLPUBLIC pivot_collection
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;