HOG2
Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
bloom_filter Class Reference

#include <BloomFilter.h>

Inheritance diagram for bloom_filter:
Inheritance graph
[legend]

Public Member Functions

 bloom_filter ()
 
 bloom_filter (const bloom_parameters &p)
 
 bloom_filter (const bloom_filter &filter)
 
bool operator== (const bloom_filter &f) const
 
bool operator!= (const bloom_filter &f) const
 
bloom_filteroperator= (const bloom_filter &f)
 
virtual ~bloom_filter ()
 
bool operator! () const
 
void clear ()
 
void insert (const unsigned char *key_begin, const std::size_t &length)
 
template<typename T >
void insert (const T &t)
 
void insert (const std::string &key)
 
void insert (const char *data, const std::size_t &length)
 
template<typename InputIterator >
void insert (const InputIterator begin, const InputIterator end)
 
virtual bool contains (const unsigned char *key_begin, const std::size_t length) const
 
template<typename T >
bool contains (const T &t) const
 
bool contains (const std::string &key) const
 
bool contains (const char *data, const std::size_t &length) const
 
template<typename InputIterator >
InputIterator contains_all (const InputIterator begin, const InputIterator end) const
 
template<typename InputIterator >
InputIterator contains_none (const InputIterator begin, const InputIterator end) const
 
virtual unsigned long long int size () const
 
std::size_t element_count () const
 
double effective_fpp () const
 
bloom_filteroperator&= (const bloom_filter &f)
 
bloom_filteroperator|= (const bloom_filter &f)
 
bloom_filteroperator^= (const bloom_filter &f)
 
const cell_typetable () const
 
std::size_t hash_count ()
 

Protected Types

typedef unsigned int bloom_type
 
typedef unsigned char cell_type
 

Protected Member Functions

virtual void compute_indices (const bloom_type &hash, std::size_t &bit_index, std::size_t &bit) const
 
void generate_unique_salt ()
 
bloom_type hash_ap (const unsigned char *begin, std::size_t remaining_length, bloom_type hash) const
 

Protected Attributes

std::vector< bloom_typesalt_
 
unsigned char * bit_table_
 
unsigned int salt_count_
 
unsigned long long int table_size_
 
unsigned long long int raw_table_size_
 
unsigned long long int projected_element_count_
 
unsigned int inserted_element_count_
 
unsigned long long int random_seed_
 
double desired_false_positive_probability_
 

Detailed Description

Definition at line 167 of file BloomFilter.h.

Member Typedef Documentation

◆ bloom_type

typedef unsigned int bloom_filter::bloom_type
protected

Definition at line 171 of file BloomFilter.h.

◆ cell_type

typedef unsigned char bloom_filter::cell_type
protected

Definition at line 172 of file BloomFilter.h.

Constructor & Destructor Documentation

◆ bloom_filter() [1/3]

bloom_filter::bloom_filter ( )
inline

Definition at line 176 of file BloomFilter.h.

◆ bloom_filter() [2/3]

bloom_filter::bloom_filter ( const bloom_parameters p)
inline

◆ bloom_filter() [3/3]

bloom_filter::bloom_filter ( const bloom_filter filter)
inline

Definition at line 202 of file BloomFilter.h.

References operator=().

◆ ~bloom_filter()

virtual bloom_filter::~bloom_filter ( )
inlinevirtual

Definition at line 250 of file BloomFilter.h.

References bit_table_.

Member Function Documentation

◆ clear()

void bloom_filter::clear ( )
inline

Definition at line 260 of file BloomFilter.h.

References bit_table_, inserted_element_count_, and raw_table_size_.

◆ compute_indices()

virtual void bloom_filter::compute_indices ( const bloom_type hash,
std::size_t &  bit_index,
std::size_t &  bit 
) const
inlineprotectedvirtual

Reimplemented in compressible_bloom_filter.

Definition at line 451 of file BloomFilter.h.

References bits_per_char, and table_size_.

Referenced by contains(), and insert().

◆ contains() [1/4]

bool bloom_filter::contains ( const char *  data,
const std::size_t &  length 
) const
inline

Definition at line 331 of file BloomFilter.h.

References contains().

◆ contains() [2/4]

bool bloom_filter::contains ( const std::string &  key) const
inline

Definition at line 326 of file BloomFilter.h.

References contains().

◆ contains() [3/4]

template<typename T >
bool bloom_filter::contains ( const T &  t) const
inline

Definition at line 321 of file BloomFilter.h.

References contains().

◆ contains() [4/4]

virtual bool bloom_filter::contains ( const unsigned char *  key_begin,
const std::size_t  length 
) const
inlinevirtual

Definition at line 305 of file BloomFilter.h.

References bit_mask, bit_table_, bits_per_char, compute_indices(), hash_ap(), and salt_.

Referenced by contains(), contains_all(), and contains_none().

◆ contains_all()

template<typename InputIterator >
InputIterator bloom_filter::contains_all ( const InputIterator  begin,
const InputIterator  end 
) const
inline

Definition at line 337 of file BloomFilter.h.

References contains().

◆ contains_none()

template<typename InputIterator >
InputIterator bloom_filter::contains_none ( const InputIterator  begin,
const InputIterator  end 
) const
inline

Definition at line 352 of file BloomFilter.h.

References contains().

◆ effective_fpp()

double bloom_filter::effective_fpp ( ) const
inline

Definition at line 376 of file BloomFilter.h.

References inserted_element_count_, salt_, and size().

Referenced by compressible_bloom_filter::compress().

◆ element_count()

std::size_t bloom_filter::element_count ( ) const
inline

Definition at line 371 of file BloomFilter.h.

References inserted_element_count_.

◆ generate_unique_salt()

void bloom_filter::generate_unique_salt ( )
inlineprotected

Definition at line 457 of file BloomFilter.h.

References random_seed_, salt_, and salt_count_.

Referenced by bloom_filter().

◆ hash_ap()

bloom_type bloom_filter::hash_ap ( const unsigned char *  begin,
std::size_t  remaining_length,
bloom_type  hash 
) const
inlineprotected

Definition at line 534 of file BloomFilter.h.

Referenced by contains(), and insert().

◆ hash_count()

std::size_t bloom_filter::hash_count ( )
inline

Definition at line 444 of file BloomFilter.h.

References salt_.

◆ insert() [1/5]

void bloom_filter::insert ( const char *  data,
const std::size_t &  length 
)
inline

Definition at line 290 of file BloomFilter.h.

References insert().

◆ insert() [2/5]

template<typename InputIterator >
void bloom_filter::insert ( const InputIterator  begin,
const InputIterator  end 
)
inline

Definition at line 296 of file BloomFilter.h.

References insert().

◆ insert() [3/5]

void bloom_filter::insert ( const std::string &  key)
inline

Definition at line 285 of file BloomFilter.h.

References insert().

◆ insert() [4/5]

template<typename T >
void bloom_filter::insert ( const T &  t)
inline

Definition at line 279 of file BloomFilter.h.

References insert().

◆ insert() [5/5]

void bloom_filter::insert ( const unsigned char *  key_begin,
const std::size_t &  length 
)
inline

Definition at line 266 of file BloomFilter.h.

References bit_mask, bit_table_, bits_per_char, compute_indices(), hash_ap(), inserted_element_count_, and salt_.

Referenced by insert().

◆ operator!()

bool bloom_filter::operator! ( ) const
inline

Definition at line 255 of file BloomFilter.h.

References table_size_.

◆ operator!=()

bool bloom_filter::operator!= ( const bloom_filter f) const
inline

Definition at line 226 of file BloomFilter.h.

References operator==().

◆ operator&=()

bloom_filter& bloom_filter::operator&= ( const bloom_filter f)
inline

Definition at line 388 of file BloomFilter.h.

References bit_table_, random_seed_, raw_table_size_, salt_count_, and table_size_.

◆ operator=()

bloom_filter& bloom_filter::operator= ( const bloom_filter f)
inline

◆ operator==()

bool bloom_filter::operator== ( const bloom_filter f) const
inline

◆ operator^=()

bloom_filter& bloom_filter::operator^= ( const bloom_filter f)
inline

Definition at line 422 of file BloomFilter.h.

References bit_table_, random_seed_, raw_table_size_, salt_count_, and table_size_.

◆ operator|=()

bloom_filter& bloom_filter::operator|= ( const bloom_filter f)
inline

Definition at line 405 of file BloomFilter.h.

References bit_table_, random_seed_, raw_table_size_, salt_count_, and table_size_.

◆ size()

virtual unsigned long long int bloom_filter::size ( ) const
inlinevirtual

Reimplemented in compressible_bloom_filter.

Definition at line 366 of file BloomFilter.h.

References table_size_.

Referenced by effective_fpp().

◆ table()

const cell_type* bloom_filter::table ( ) const
inline

Definition at line 439 of file BloomFilter.h.

References bit_table_.

Member Data Documentation

◆ bit_table_

unsigned char* bloom_filter::bit_table_
protected

◆ desired_false_positive_probability_

double bloom_filter::desired_false_positive_probability_
protected

Definition at line 586 of file BloomFilter.h.

Referenced by compressible_bloom_filter::compress(), operator=(), and operator==().

◆ inserted_element_count_

unsigned int bloom_filter::inserted_element_count_
protected

Definition at line 584 of file BloomFilter.h.

Referenced by clear(), effective_fpp(), element_count(), insert(), operator=(), and operator==().

◆ projected_element_count_

unsigned long long int bloom_filter::projected_element_count_
protected

Definition at line 583 of file BloomFilter.h.

Referenced by operator=(), and operator==().

◆ random_seed_

unsigned long long int bloom_filter::random_seed_
protected

◆ raw_table_size_

unsigned long long int bloom_filter::raw_table_size_
protected

◆ salt_

std::vector<bloom_type> bloom_filter::salt_
protected

◆ salt_count_

unsigned int bloom_filter::salt_count_
protected

◆ table_size_

unsigned long long int bloom_filter::table_size_
protected

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