libbf  0.1
 All Classes Functions Typedefs Friends Pages
Public Member Functions | Private Member Functions | Private Attributes | List of all members
bf::bitwise_bloom_filter Class Reference

The bitwise Bloom filter. More...

#include <bitwise.h>

Inheritance diagram for bf::bitwise_bloom_filter:
Inheritance graph

Public Member Functions

 bitwise_bloom_filter (size_t k, size_t cells, size_t seed=0)
 Constructs a bitwise Bloom filter. More...
 
virtual void add (object const &o) override
 Adds an element to the Bloom filter. More...
 
virtual size_t lookup (object const &o) const override
 Retrieves the count of an element. More...
 
virtual void clear () override
 Removes all items from the Bloom filter.
 
- Public Member Functions inherited from bf::bloom_filter
template<typename T >
void add (T const &x)
 Adds an element to the Bloom filter. More...
 
template<typename T >
size_t lookup (T const &x) const
 Retrieves the count of an element. More...
 

Private Member Functions

void grow ()
 Appends a new level. More...
 

Private Attributes

size_t k_
 
size_t cells_
 
size_t seed_
 
std::vector< basic_bloom_filterlevels_
 

Detailed Description

The bitwise Bloom filter.

Definition at line 9 of file bitwise.h.

Constructor & Destructor Documentation

bf::bitwise_bloom_filter::bitwise_bloom_filter ( size_t  k,
size_t  cells,
size_t  seed = 0 
)

Constructs a bitwise Bloom filter.

Parameters
kThe number of hash functions in the first level.
cells0The number of cells in the the first level.
seed0The seed for the first level.

Definition at line 5 of file bitwise.cc.

References grow().

Here is the call graph for this function:

Member Function Documentation

void bf::bitwise_bloom_filter::add ( object const &  o)
overridevirtual

Adds an element to the Bloom filter.

Parameters
oA wrapped object.

Implements bf::bloom_filter.

Definition at line 11 of file bitwise.cc.

References grow(), and lookup().

Here is the call graph for this function:

void bf::bitwise_bloom_filter::grow ( )
private

Appends a new level.

Postcondition
levels_.size() += 1

Definition at line 44 of file bitwise.cc.

Referenced by add(), bitwise_bloom_filter(), and clear().

Here is the caller graph for this function:

size_t bf::bitwise_bloom_filter::lookup ( object const &  o) const
overridevirtual

Retrieves the count of an element.

Parameters
oA wrapped object.
Returns
A frequency estimate for o.

Implements bf::bloom_filter.

Definition at line 30 of file bitwise.cc.

Referenced by add().

Here is the caller graph for this function:


The documentation for this class was generated from the following files: