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

bf::bitwise< Core > Class Template Reference

The bitwise Bloom filter. More...

#include <bloom_filter_bitwise.h>

Inheritance diagram for bf::bitwise< Core >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef Core core_type
typedef std::function
< unsigned(unsigned, unsigned)> 
growth_func_type

Public Member Functions

 bitwise (core_type &&core, unsigned min_size=128)
 Create a bitwise Bloom filter.
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.
unsigned levels () const
void clear ()
 Remove all items from the set.
std::string to_string () const
 Get a string representation of the Bloom filter.

Private Types

typedef std::vector< core_type > core_vector

Private Attributes

core_vector levels_
unsigned min_size_

Detailed Description

template<typename Core = core<>>
class bf::bitwise< Core >

The bitwise Bloom filter.

Definition at line 13 of file bloom_filter_bitwise.h.


Constructor & Destructor Documentation

template<typename Core = core<>>
bf::bitwise< Core >::bitwise ( core_type &&  core,
unsigned  min_size = 128 
) [inline]

Create a bitwise Bloom filter.

Parameters:
coreAn rvalue reference to the first core.
min_sizeThe minimum size of the Bloom filter that represents the most-significant bit.

Definition at line 26 of file bloom_filter_bitwise.h.


Member Function Documentation

template<typename Core = core<>>
template<typename T >
void bf::bitwise< Core >::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 from bf::bloom_filter< bitwise< Core > >.

Definition at line 34 of file bloom_filter_bitwise.h.

template<typename Core = core<>>
template<typename T >
unsigned bf::bitwise< Core >::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 from bf::bloom_filter< bitwise< Core > >.

Definition at line 46 of file bloom_filter_bitwise.h.

template<typename Core = core<>>
template<typename T >
void bf::bitwise< Core >::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 from bf::bloom_filter< bitwise< Core > >.

Definition at line 40 of file bloom_filter_bitwise.h.

template<typename Core = core<>>
std::string bf::bitwise< Core >::to_string ( ) const [inline]

Get a string representation of the Bloom filter.

Returns:
A string representing of the Bloom filter.

Reimplemented from bf::bloom_filter< bitwise< Core > >.

Definition at line 62 of file bloom_filter_bitwise.h.


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