2016-02-09 15:12:00 -08:00
|
|
|
// Copyright (c) 2011-present, Facebook, Inc. All rights reserved.
|
2017-07-15 16:03:42 -07:00
|
|
|
// This source code is licensed under both the GPLv2 (found in the
|
|
|
|
// COPYING file in the root directory) and Apache 2.0 License
|
|
|
|
// (found in the LICENSE.Apache file in the root directory).
|
2013-10-04 22:32:05 -07:00
|
|
|
#pragma once
|
2013-08-22 23:10:02 -07:00
|
|
|
|
2015-09-02 13:58:22 -07:00
|
|
|
#include <map>
|
|
|
|
#include <string>
|
2013-08-22 23:10:02 -07:00
|
|
|
|
2015-09-02 13:58:22 -07:00
|
|
|
#include "rocksdb/comparator.h"
|
2013-08-23 08:38:13 -07:00
|
|
|
#include "rocksdb/memtablerep.h"
|
|
|
|
#include "rocksdb/slice.h"
|
2015-09-02 13:58:22 -07:00
|
|
|
#include "util/coding.h"
|
2013-08-22 23:10:02 -07:00
|
|
|
|
2020-02-20 12:07:53 -08:00
|
|
|
namespace ROCKSDB_NAMESPACE {
|
2013-08-22 23:10:02 -07:00
|
|
|
namespace stl_wrappers {
|
|
|
|
|
2015-09-02 13:58:22 -07:00
|
|
|
class Base {
|
|
|
|
protected:
|
|
|
|
const MemTableRep::KeyComparator& compare_;
|
|
|
|
explicit Base(const MemTableRep::KeyComparator& compare)
|
|
|
|
: compare_(compare) {}
|
|
|
|
};
|
|
|
|
|
|
|
|
struct Compare : private Base {
|
|
|
|
explicit Compare(const MemTableRep::KeyComparator& compare) : Base(compare) {}
|
|
|
|
inline bool operator()(const char* a, const char* b) const {
|
|
|
|
return compare_(a, b) < 0;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2013-08-22 23:10:02 -07:00
|
|
|
}
|
2020-02-20 12:07:53 -08:00
|
|
|
} // namespace ROCKSDB_NAMESPACE
|