]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/util/kv_map.h
1 // Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
2 // This source code is licensed under both the GPLv2 (found in the
3 // COPYING file in the root directory) and Apache 2.0 License
4 // (found in the LICENSE.Apache file in the root directory).
10 #include "rocksdb/comparator.h"
11 #include "rocksdb/slice.h"
12 #include "util/coding.h"
13 #include "util/murmurhash.h"
16 namespace stl_wrappers
{
18 struct LessOfComparator
{
19 explicit LessOfComparator(const Comparator
* c
= BytewiseComparator())
22 bool operator()(const std::string
& a
, const std::string
& b
) const {
23 return cmp
->Compare(Slice(a
), Slice(b
)) < 0;
25 bool operator()(const Slice
& a
, const Slice
& b
) const {
26 return cmp
->Compare(a
, b
) < 0;
29 const Comparator
* cmp
;
32 typedef std::map
<std::string
, std::string
, LessOfComparator
> KVMap
;