]> git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/memtable/stl_wrappers.h
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / rocksdb / memtable / stl_wrappers.h
1 // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
2 // This source code is licensed under the BSD-style license found in the
3 // LICENSE file in the root directory of this source tree. An additional grant
4 // of patent rights can be found in the PATENTS file in the same directory.
5 #pragma once
6
7 #include <map>
8 #include <string>
9
10 #include "rocksdb/comparator.h"
11 #include "rocksdb/memtablerep.h"
12 #include "rocksdb/slice.h"
13 #include "util/coding.h"
14 #include "util/murmurhash.h"
15
16 namespace rocksdb {
17 namespace stl_wrappers {
18
19 class Base {
20 protected:
21 const MemTableRep::KeyComparator& compare_;
22 explicit Base(const MemTableRep::KeyComparator& compare)
23 : compare_(compare) {}
24 };
25
26 struct Compare : private Base {
27 explicit Compare(const MemTableRep::KeyComparator& compare) : Base(compare) {}
28 inline bool operator()(const char* a, const char* b) const {
29 return compare_(a, b) < 0;
30 }
31 };
32
33 }
34 }