psync::BloomFilter Class Reference

#include <bloom-filter.hpp>

Classes

class  Error
 

Public Member Functions

 BloomFilter ()
 
 BloomFilter (const BloomParameters &p)
 
 BloomFilter (unsigned int projected_element_count, double false_positive_probability)
 
 BloomFilter (unsigned int projected_element_count, double false_positive_probability, const ndn::name::Component &bfName)
 
void appendToName (ndn::Name &name) const
 Append our bloom filter to the given name. More...
 
void clear ()
 
bool contains (const std::string &key) const
 
BloomParameters getParameters (unsigned int projected_element_count, double false_positive_probability)
 
void insert (const std::string &key)
 
std::vector< cell_typetable () const
 

Protected Types

typedef uint32_t bloom_type
 
typedef uint8_t cell_type
 
typedef std::vector< cell_type >::iterator Iterator
 

Detailed Description

Definition at line 100 of file bloom-filter.hpp.

Member Typedef Documentation

◆ bloom_type

typedef uint32_t psync::BloomFilter::bloom_type
protected

Definition at line 103 of file bloom-filter.hpp.

◆ cell_type

typedef uint8_t psync::BloomFilter::cell_type
protected

Definition at line 104 of file bloom-filter.hpp.

◆ Iterator

typedef std::vector<cell_type>::iterator psync::BloomFilter::Iterator
protected

Definition at line 105 of file bloom-filter.hpp.

Constructor & Destructor Documentation

◆ BloomFilter() [1/4]

psync::BloomFilter::BloomFilter ( )

Definition at line 130 of file bloom-filter.cpp.

◆ BloomFilter() [2/4]

psync::BloomFilter::BloomFilter ( const BloomParameters p)
explicit

Definition at line 141 of file bloom-filter.cpp.

◆ BloomFilter() [3/4]

psync::BloomFilter::BloomFilter ( unsigned int  projected_element_count,
double  false_positive_probability 
)

Definition at line 156 of file bloom-filter.cpp.

◆ BloomFilter() [4/4]

psync::BloomFilter::BloomFilter ( unsigned int  projected_element_count,
double  false_positive_probability,
const ndn::name::Component &  bfName 
)

Definition at line 162 of file bloom-filter.cpp.

Member Function Documentation

◆ appendToName()

void psync::BloomFilter::appendToName ( ndn::Name &  name) const

Append our bloom filter to the given name.

Append the count and false positive probability along with the bloom filter so that producer (PartialProducer) can construct a copy.

Parameters
nameappend bloom filter to this name

Definition at line 192 of file bloom-filter.cpp.

◆ clear()

void psync::BloomFilter::clear ( )

Definition at line 200 of file bloom-filter.cpp.

◆ contains()

bool psync::BloomFilter::contains ( const std::string &  key) const

Definition at line 220 of file bloom-filter.cpp.

◆ getParameters()

BloomParameters psync::BloomFilter::getParameters ( unsigned int  projected_element_count,
double  false_positive_probability 
)

Definition at line 176 of file bloom-filter.cpp.

◆ insert()

void psync::BloomFilter::insert ( const std::string &  key)

Definition at line 207 of file bloom-filter.cpp.

◆ table()

std::vector< BloomFilter::cell_type > psync::BloomFilter::table ( ) const

Definition at line 237 of file bloom-filter.cpp.