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

bf::bloom_filter< Derived > Class Template Reference

The Bloom filter interface. More...

#include <bloom_filter.h>

Inheritance diagram for bf::bloom_filter< Derived >:
Inheritance graph
[legend]

List of all members.

Public Member Functions

template<typename T >
void add (const T &x)
 Add an item to the set.
template<typename T >
void remove (const T &x)
 Remove an item from the set.
template<typename T >
unsigned count (const T &x) const
 Get the count of an item.
void clear ()
 Remove all items from the set.
unsigned long n () const
 Get the number of items in the set, counted via add and remove.
std::string to_string () const
 Get a string representation of the Bloom filter.

Protected Attributes

unsigned long n_
 The (multi)set cardinality.

Private Member Functions

template<typename D >
D & derived () const
template<typename D >
const D & derived () const

Detailed Description

template<typename Derived>
class bf::bloom_filter< Derived >

The Bloom filter interface.

Template Parameters:
DerivedThe type of the child class that implements a Bloom filter.

Definition at line 11 of file bloom_filter.h.


Member Function Documentation

template<typename Derived>
template<typename T >
void bf::bloom_filter< Derived >::add ( const T &  x) [inline]

Add an item to the set.

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

Reimplemented in bf::a2< Core >, bf::basic< Core >, bf::bitwise< Core >, bf::spectral_mi< Core >, bf::spectral_rm< Core1, Core2 >, and bf::stable< Core, Generator >.

Definition at line 18 of file bloom_filter.h.

template<typename Derived>
template<typename T >
unsigned bf::bloom_filter< Derived >::count ( const T &  x) const [inline]

Get the count of an item.

Template Parameters:
TThe type of the item to query.
Parameters:
xAn instance of type T.
Returns:
A frequency estimate for x.

Reimplemented in bf::a2< Core >, bf::basic< Core >, bf::bitwise< Core >, and bf::spectral_rm< Core1, Core2 >.

Definition at line 39 of file bloom_filter.h.

template<typename Derived>
unsigned long bf::bloom_filter< Derived >::n ( ) const [inline]

Get the number of items in the set, counted via add and remove.

Returns:
The number of items.

Definition at line 53 of file bloom_filter.h.

template<typename Derived>
template<typename T >
void bf::bloom_filter< Derived >::remove ( const T &  x) [inline]

Remove an item from the set.

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

Reimplemented in bf::a2< Core >, bf::basic< Core >, bf::bitwise< Core >, bf::spectral_mi< Core >, bf::spectral_rm< Core1, Core2 >, and bf::stable< Core, Generator >.

Definition at line 28 of file bloom_filter.h.

template<typename Derived>
std::string bf::bloom_filter< Derived >::to_string ( ) const [inline]

Get a string representation of the Bloom filter.

Returns:
A string representing of the Bloom filter.

Reimplemented in bf::a2< Core >, bf::basic< Core >, bf::bitwise< Core >, and bf::spectral_rm< Core1, Core2 >.

Definition at line 60 of file bloom_filter.h.


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