summaryrefslogtreecommitdiffstats
path: root/benchmarks/include/btree-util.h
blob: 571c0735d10f56845e36e17ea4bdaa1688256081 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#pragma once

#include <cstdlib>
#include "psu-ds/BTree.h"

struct btree_record {
    int64_t key;
    int64_t value;

   inline bool operator<(const btree_record& other) const {
        return key < other.key || (key == other.key && value < other.value);
    }

    inline bool operator==(const btree_record& other) const {
        return key == other.key && value == other.value;
    }
};

struct btree_key_extract {
    static const int64_t &get(const btree_record &v) {
        return v.key;
    }
};

typedef psudb::BTree<int64_t, btree_record, btree_key_extract> BenchBTree;