8 #ifndef INCLUDED_ORCUS_SPREADSHEET_PIVOT_HPP
9 #define INCLUDED_ORCUS_SPREADSHEET_PIVOT_HPP
11 #include "orcus/env.hpp"
12 #include "orcus/pstring.hpp"
13 #include "orcus/types.hpp"
14 #include "orcus/spreadsheet/types.hpp"
20 #include <boost/optional.hpp>
32 namespace spreadsheet {
36 using pivot_cache_indices_t = std::vector<size_t>;
81 size_t shared_item_index;
96 using pivot_cache_record_t = std::vector<pivot_cache_record_value_t>;
102 unknown = 0, boolean, date_time, character, numeric, blank, error
156 using pivot_cache_items_t = std::vector<pivot_cache_item_t>;
165 pivot_cache_group_by_t group_by = pivot_cache_group_by_t::range;
167 bool auto_start =
true;
168 bool auto_end =
true;
172 double interval = 1.0;
186 boost::optional<range_grouping_type> range_grouping;
211 pivot_cache_items_t items;
213 boost::optional<double> min_value;
214 boost::optional<double> max_value;
216 boost::optional<date_time_t> min_date;
217 boost::optional<date_time_t> max_date;
219 std::unique_ptr<pivot_cache_group_data_t> group_data;
230 std::unique_ptr<impl> mp_impl;
233 using fields_type = std::vector<pivot_cache_field_t>;
234 using records_type = std::vector<pivot_cache_record_t>;
247 void insert_records(records_type record);
249 size_t get_field_count()
const;
261 pivot_cache_id_t get_id()
const;
263 const records_type& get_all_records()
const;
269 std::unique_ptr<impl> mp_impl;
283 const pstring& sheet_name,
const ixion::abs_range_t& range, std::unique_ptr<pivot_cache>&& cache);
293 const pstring& sheet_name,
const ixion::abs_range_t& range)
const;
297 const pivot_cache* get_cache(pivot_cache_id_t cache_id)
const;