46 #ifndef PSYNC_DETAIL_IBLT_HPP
47 #define PSYNC_DETAIL_IBLT_HPP
51 #include <ndn-cxx/name.hpp>
53 #include <boost/operators.hpp>
77 return lhs.count == rhs.count && lhs.keySum == rhs.keySum && lhs.keyCheck == rhs.keyCheck;
94 class IBLT :
private boost::equality_comparable<IBLT>
97 class Error :
public std::runtime_error
100 using std::runtime_error::runtime_error;
119 initialize(
const ndn::name::Component& ibltName);
127 const std::vector<HashTableEntry>&
153 return lhs.m_hashTable == rhs.m_hashTable;
157 std::vector<HashTableEntry> m_hashTable;
162 operator<<(std::ostream& os,
const IBLT& iblt);
friend bool operator==(const HashTableEntry &lhs, const HashTableEntry &rhs) noexcept
Invertible Bloom Lookup Table (Invertible Bloom Filter)
friend bool operator==(const IBLT &lhs, const IBLT &rhs)
IBLT(size_t expectedNumEntries, CompressionScheme scheme)
constructor
void insert(uint32_t key)
const std::vector< HashTableEntry > & getHashTable() const
void initialize(const ndn::name::Component &ibltName)
Populate the hash table using the vector representation of IBLT.
void appendToName(ndn::Name &name) const
Appends self to name.
constexpr size_t N_HASHCHECK
std::ostream & operator<<(std::ostream &os, const IBLT &iblt)
IBLTDiff operator-(const IBLT &lhs, const IBLT &rhs)
Compute the difference between two IBLTs.
Represent the difference between two IBLTs,.
std::set< uint32_t > negative
Entries in rhs but not lhs.
bool canDecode
Whether decoding completed successfully.
std::set< uint32_t > positive
Entries in lhs but not rhs.