2 * Eddie Kohler, Yandong Mao, Robert Morris
3 * Copyright (c) 2012-2014 President and Fellows of Harvard College
4 * Copyright (c) 2012-2014 Massachusetts Institute of Technology
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the "Software"),
8 * to deal in the Software without restriction, subject to the conditions
9 * listed in the Masstree LICENSE file. These conditions include: you must
10 * preserve this copyright notice, and you cannot mention the copyright
11 * holders in advertising related to the Software without their permission.
12 * The Software is provided WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED. This
13 * notice is a summary of the Masstree LICENSE file; the license in that file
16 #ifndef QUERY_MASSTREE_HH
17 #define QUERY_MASSTREE_HH 1
18 #include "masstree.hh"
21 namespace lcdf { class Json; }
29 typedef node_base<P> node_type;
30 typedef typename P::threadinfo_type threadinfo;
31 typedef unlocked_tcursor<P> unlocked_cursor_type;
32 typedef tcursor<P> cursor_type;
37 const basic_table<P>& table() const {
40 basic_table<P>& table() {
44 void initialize(threadinfo& ti) {
45 table_.initialize(ti);
47 void destroy(threadinfo& ti) {
51 void findpivots(Str* pv, int npv) const;
54 void json_stats(lcdf::Json& j, threadinfo& ti);
55 inline lcdf::Json json_stats(threadinfo& ti) {
61 void print(FILE* f, int indent) const;
63 static void test(threadinfo& ti);
65 static const char* name() {
70 basic_table<P> table_;
73 struct default_query_table_params : public nodeparams<15, 15> {
74 typedef row_type* value_type;
75 typedef value_print<value_type> value_print_type;
76 typedef ::threadinfo threadinfo_type;
79 typedef query_table<default_query_table_params> default_table;
81 } // namespace Masstree