46 #ifndef PSYNC_DETAIL_IBLT_HPP
47 #define PSYNC_DETAIL_IBLT_HPP
51 #include <ndn-cxx/name.hpp>
83 class Error :
public std::runtime_error
86 using std::runtime_error::runtime_error;
105 initialize(
const ndn::name::Component& ibltName);
123 listEntries(std::set<uint32_t>& positive, std::set<uint32_t>& negative)
const;
128 const std::vector<HashTableEntry>&
155 std::vector<uint32_t>
160 update(
int plusOrMinus, uint32_t key);
163 std::vector<HashTableEntry> m_hashTable;
164 static constexpr
int INSERT = 1;
165 static constexpr
int ERASE = -1;
170 operator==(
const IBLT& iblt1,
const IBLT& iblt2);
173 operator!=(
const IBLT& iblt1,
const IBLT& iblt2);
176 operator<<(std::ostream& os,
const IBLT& iblt);
Invertible Bloom Lookup Table (Invertible Bloom Filter)
bool listEntries(std::set< uint32_t > &positive, std::set< uint32_t > &negative) const
List all the entries in the IBLT.
std::vector< uint32_t > extractValueFromName(const ndn::name::Component &ibltName) const
Extracts IBLT from name component.
IBLT operator-(const IBLT &other) const
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.
bool operator!=(const IBLT &iblt1, const IBLT &iblt2)
constexpr size_t N_HASHCHECK
std::ostream & operator<<(std::ostream &os, const IBLT &iblt)
bool operator==(const IBLT &iblt1, const IBLT &iblt2)