16 #ifndef _PASL_DATA_TRIVBOOTCHUNKEDSEQ_H_
17 #define _PASL_DATA_TRIVBOOTCHUNKEDSEQ_H_
22 namespace bootchunkedseq {
27 template <
class Item,
int Chunk_capacity=32>
35 top_item_type(
const Item& value)
37 size_t get_cached()
const {
42 class sized_cached_measure {
54 return v->get_cached();
57 measured_type
operator()(
const value_type* lo,
const value_type* hi)
const {
59 for (
auto p = lo; p < hi; p++)
66 static void swap(measured_type& x, measured_type y) {
72 using measure_type =
typename sized_cached_measure::measure_type;
76 measure_type meas_fct;
96 return seq.get_cached();
100 top_item_type& x = seq.front();
105 top_item_type& x = seq.back();
110 seq.push_front(meas_fct,
new top_item_type(v));
114 seq.push_back(meas_fct,
new top_item_type(v));
118 top_item_type x = seq.pop_front();
125 top_item_type x = seq.pop_back();
138 seq.split(index, v, other.seq);
139 assert(
size() == index);
140 seq.push_back(meas_fct, v);
144 seq.concat(other.seq);
147 template <
class Body>
149 seq.for_each([&] (top_item_type* v) {
void split(size_type n, self_type &other)
void push_back(const value_type &v)
static value_type identity()
bootchunkseq< bootchunkseq_deque_config< Item, cachedmeasure::trivial< Item, size_t >, Capacity >> cdeque
measured_type operator()(const value_type &v) const
Representation of a chunk.
const value_type * const_pointer
Definitions of a few cached-measurement policies.
void concat(self_type &other)
static value_type combine(value_type x, value_type y)
measured_type operator()(const value_type *lo, const value_type *hi) const
void push_front(const value_type &v)
void for_each(const Body &f) const
const value_type & const_reference