libBf 0.1
Public Types | Public Member Functions | Private Types | Private Attributes

bf::stable< Core, Generator > Class Template Reference

The stable Bloom filter. More...

#include <bloom_filter_stable.h>

Inheritance diagram for bf::stable< Core, Generator >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef base::core_type core_type

Public Member Functions

 stable (core_type &&core, const generator_type &generator, unsigned d)
 Create a spectral Bloom filter.
template<typename T >
void add (const T &x)
 Add an item to the stable Bloom filter.
template<typename T >
void remove (const T &x)
 Remove an item from the set.

Private Types

typedef Generator generator_type
typedef basic< Core > base

Private Attributes

generator_type generator_
 Generates randomness out of thin air.
unsigned d_
 Number of cells to decrement at add.

Detailed Description

template<typename Core = core<>, typename Generator = std::mt19937>
class bf::stable< Core, Generator >

The stable Bloom filter.

Definition at line 13 of file bloom_filter_stable.h.


Constructor & Destructor Documentation

template<typename Core = core<>, typename Generator = std::mt19937>
bf::stable< Core, Generator >::stable ( core_type &&  core,
const generator_type &  generator,
unsigned  d 
) [inline]

Create a spectral Bloom filter.

Parameters:
coreAn rvalue reference to a core.
generatorAn lvalue reference to a randomness generator.
dThe number of cells to decrement at each insert

Definition at line 25 of file bloom_filter_stable.h.


Member Function Documentation

template<typename Core = core<>, typename Generator = std::mt19937>
template<typename T >
void bf::stable< Core, Generator >::add ( const T &  x) [inline]

Add an item to the stable Bloom filter.

This invovles (i) decrementing k positions uniformly at random and (ii) setting the counter of the value x to its maximum value, i.e., all 1's.

Reimplemented from bf::basic< Core >.

Definition at line 37 of file bloom_filter_stable.h.

References bf::stable< Core, Generator >::d_, and bf::stable< Core, Generator >::generator_.

template<typename Core = core<>, typename Generator = std::mt19937>
template<typename T >
void bf::stable< Core, Generator >::remove ( const T &  x)

Remove an item from the set.

Template Parameters:
TThe type of the item to delete.
Parameters:
xAn instance of type T.

Reimplemented from bf::basic< Core >.


The documentation for this class was generated from the following file:
 All Classes Functions Variables