chunkedseq
container library for large in-memory data sets
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
bootchunkseq.cpp
Go to the documentation of this file.
1 #include <iostream>
2 #include "fixedcapacity.hpp"
3 #include "algebra.hpp"
4 #include "cachedmeasure.hpp"
5 #include "chunk.hpp"
6 #include "bootchunkedseq.hpp"
7 #include "itemsearch.hpp"
8 
9 using namespace pasl::data;
10 
11 
12 
13 !!!!!!!!
14 DEPRECATED
15 !!!!!!!!
16 
17 
18 
19 
20 
21 
22 
23 
24 
25 template <class Item, class Cache, int Chunk_capacity>
26 class bootchunkseq_deque_config {
27 public:
28 
29  using size_type = size_t;
30  using value_type = Item;
31 
32  using client_cache_type = Cache;
33  using cache_type = client_cache_type;
34 
35  using heap_allocator_type = fixedcapacity::inline_allocator<value_type, Chunk_capacity>;
36  template <class Ringbuffer_item>
37  using ringbuffer_type = fixedcapacity::ringbuffer_ptr<heap_allocator_type>;
38 
39  using chunk_annotation_type = struct { };
40 
41  template <class Chunk_item, class Chunk_cache>
42  using chunk_gen_type = chunk<ringbuffer_type<Chunk_item>, Chunk_cache, chunk_annotation_type>;
43 
44 };
45 
46 template <class Item, int Capacity>
47 using cdeque = bootchunkseq<bootchunkseq_deque_config<Item, cachedmeasure::trivial<Item, size_t>, Capacity>>;
48 
49 int main(int argc, const char * argv[])
50 {
51  using value_type = int;
52  using heap_allocator = fixedcapacity::heap_allocator<value_type, 4>;
53  using vector_type = fixedcapacity::stack<heap_allocator>;
54  using cache_type = cachedmeasure::size<value_type, size_t>;
55  using measure_type = typename cache_type::measure_type;
56  using annotation_type = struct { };
57  using chunk_type = chunk<vector_type, cache_type, annotation_type>;
58 
59  measure_type meas;
60 
61  chunk_type c;
62 
63  c.push_back(meas, 123);
64 
65  std::cout << c.cached << std::endl;
66 
67 
68  cdeque<int, 4> cd;
69  cd.clear();
70 
71  return 0;
72 }
73 
bootchunkseq< bootchunkseq_deque_config< Item, cachedmeasure::trivial< Item, size_t >, Capacity >> cdeque
int main(int argc, const char *argv[])
Representation of a chunk.
Fixed capacity vectors.
Definitions of a few cached-measurement policies.
Routines for finding an item in a container via binary search.
Representation of a chunk.
bytes_8 Item
Definition: do_fifo.cpp:107
Definitions of a few algebras.