46 #ifndef PSYNC_IBLT_HPP 47 #define PSYNC_IBLT_HPP 51 #include <ndn-cxx/name.hpp> 74 extern const size_t N_HASH;
85 class Error :
public std::runtime_error
88 using std::runtime_error::runtime_error;
107 initialize(
const ndn::name::Component& ibltName);
110 insert(uint32_t key);
127 listEntries(std::set<uint32_t>& positive, std::set<uint32_t>& negative)
const;
130 operator-(
const IBLT& other)
const;
132 const std::vector<HashTableEntry>&
150 appendToName(ndn::Name& name)
const;
161 std::vector<uint32_t>
162 extractValueFromName(
const ndn::name::Component& ibltName)
const;
166 update(
int plusOrMinus, uint32_t key);
169 std::vector<HashTableEntry> m_hashTable;
170 static const int INSERT = 1;
171 static const int ERASE = -1;
186 #endif // PSYNC_IBLT_HPP
Invertible Bloom Lookup Table (Invertible Bloom Filter)
bool operator==(const BloomFilter &bf1, const BloomFilter &bf2)
const std::vector< HashTableEntry > & getHashTable() const
bool operator!=(const IBLT &iblt1, const IBLT &iblt2)
std::ostream & operator<<(std::ostream &out, const BloomFilter &bf)