46 #ifndef PSYNC_IBLT_HPP 47 #define PSYNC_IBLT_HPP 49 #include <ndn-cxx/name.hpp> 72 extern const size_t N_HASH;
83 class Error :
public std::runtime_error
86 using std::runtime_error::runtime_error;
94 explicit IBLT(
size_t expectedNumEntries);
103 initialize(
const ndn::name::Component& ibltName);
106 insert(uint32_t key);
123 listEntries(std::set<uint32_t>& positive, std::set<uint32_t>& negative)
const;
126 operator-(
const IBLT& other)
const;
128 std::vector<HashTableEntry>
146 appendToName(ndn::Name& name)
const;
157 std::vector<uint32_t>
158 extractValueFromName(
const ndn::name::Component& ibltName)
const;
162 update(
int plusOrMinus, uint32_t key);
165 std::vector<HashTableEntry> m_hashTable;
166 static const int INSERT = 1;
167 static const int ERASE = -1;
181 #endif // PSYNC_IBLT_HPP
std::vector< HashTableEntry > getHashTable() const
Invertible Bloom Lookup Table (Invertible Bloom Filter)
bool operator==(const BloomFilter &bf1, const BloomFilter &bf2)
bool operator!=(const IBLT &iblt1, const IBLT &iblt2)
std::ostream & operator<<(std::ostream &out, const BloomFilter &bf)