benchmark silo added
[c11concurrency-benchmarks.git] / silo / new-benchmarks / abstract_ordered_index.h
1 #ifndef _ABSTRACT_ORDERED_INDEX_H_
2 #define _ABSTRACT_ORDERED_INDEX_H_
3
4 #include <stdint.h>
5 #include <string>
6 #include <utility>
7 #include <map>
8
9 #include "../macros.h"
10 #include "../str_arena.h"
11
12 class abstract_ordered_index {
13 public:
14
15   virtual ~abstract_ordered_index() {}
16
17   // virtual interface
18
19   /**
20    * Only an estimate, not transactional!
21    */
22   virtual size_t size() const = 0;
23
24   /**
25    * Not thread safe for now
26    */
27   virtual std::map<std::string, uint64_t> clear() = 0;
28
29   // templated interface
30
31   // typedef [unspecified] key_type;
32   // typedef [unspecified] value_type;
33
34   // struct search_range_callback {
35   // public:
36   //   virtual bool invoke(const key_type &, const value_type &);
37   // };
38
39   // struct bytes_search_range_callback {
40   // public:
41   //   virtual bool invoke(const std::string &, const std::string &);
42   // };
43
44   //template <typename FieldsMask>
45   //bool search(
46   //    /* [unspecified] */ &t, const key_type &k, value_type &v,
47   //    FieldsMask fm);
48
49   //template <typename FieldsMask>
50   //void search_range_call(
51   //    /* [unspecified] */ &t, const key_type &lower, const key_type *upper,
52   //    search_range_callback &callback,
53   //    bool no_key_results, /* skip decoding of keys? */
54   //    FieldsMask fm);
55
56   //void bytes_search_range_call(
57   //    /* [unspecified] */ &t, const key_type &lower, const key_type *upper,
58   //    bytes_search_range_callback &callback,
59   //    size_t value_fields_prefix);
60
61   //template <typename FieldsMask>
62   //void put(
63   //    /* [unspecified] */ &t, const key_type &k, const value_type &v,
64   //    FieldsMask fm);
65
66   //template <typename Traits>
67   //void insert(
68   //    /* [unspecified] */ &t, const key_type &k, const value_type &v);
69
70   //template <typename Traits>
71   //void remove(
72   //    /* [unspecified] */ &t, const key_type &k);
73 };
74
75 #endif /* _ABSTRACT_ORDERED_INDEX_H_ */