2013-10-16 21:59:46 +00:00
|
|
|
// Copyright (c) 2013, Facebook, Inc. All rights reserved.
|
|
|
|
// This source code is licensed under the BSD-style license found in the
|
|
|
|
// LICENSE file in the root directory of this source tree. An additional grant
|
|
|
|
// of patent rights can be found in the PATENTS file in the same directory.
|
|
|
|
//
|
2013-10-05 05:32:05 +00:00
|
|
|
#pragma once
|
2013-08-23 06:10:02 +00:00
|
|
|
|
|
|
|
#include "util/murmurhash.h"
|
|
|
|
#include "util/coding.h"
|
|
|
|
|
2013-08-23 15:38:13 +00:00
|
|
|
#include "rocksdb/memtablerep.h"
|
|
|
|
#include "rocksdb/slice.h"
|
2013-08-23 06:10:02 +00:00
|
|
|
|
2013-10-04 04:49:15 +00:00
|
|
|
namespace rocksdb {
|
2013-08-23 06:10:02 +00:00
|
|
|
namespace stl_wrappers {
|
|
|
|
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;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|