OpenCBDC Transaction Processor
Loading...
Searching...
No Matches
index_comparator.hpp
Go to the documentation of this file.
1// Copyright (c) 2021 MIT Digital Currency Initiative,
2// Federal Reserve Bank of Boston
3// Distributed under the MIT software license, see the accompanying
4// file COPYING or http://www.opensource.org/licenses/mit-license.php.
5
6#ifndef OPENCBDC_TX_SRC_RAFT_INDEX_COMPARATOR_H_
7#define OPENCBDC_TX_SRC_RAFT_INDEX_COMPARATOR_H_
8
9#include <leveldb/comparator.h>
10
11namespace cbdc::raft {
13 class index_comparator : public leveldb::Comparator {
14 public:
20 [[nodiscard]] auto Compare(const leveldb::Slice& a,
21 const leveldb::Slice& b) const
22 -> int override;
23
26 [[nodiscard]] auto Name() const -> const char* override;
27
30 std::string* /* start */,
31 const leveldb::Slice& /* limit */) const override;
32
34 void FindShortSuccessor(std::string* /* key */) const override;
35 };
36}
37
38#endif // OPENCBDC_TX_SRC_RAFT_INDEX_COMPARATOR_H_
LevelDB comparator for ordering NuRaft log indices.
void FindShortestSeparator(std::string *, const leveldb::Slice &) const override
Not implemented.
void FindShortSuccessor(std::string *) const override
Not implemented.
auto Compare(const leveldb::Slice &a, const leveldb::Slice &b) const -> int override
Compare the order of the two given LevelDB keys when converted to uint64_t.
auto Name() const -> const char *override
Return the comparator name.