BitShares-Core  7.0.2
BitShares blockchain node software and command-line wallet software
Public Member Functions | Public Attributes | Protected Types | Protected Member Functions | List of all members
fc::bloom_filter Class Reference

#include <bloom_filter.hpp>

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
 
unsigned long long int 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 ()
 

Public Attributes

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

Protected Types

typedef unsigned int bloom_type
 
typedef unsigned char cell_type
 
typedef std::vector< unsigned char > table_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
 

Detailed Description

Definition at line 179 of file bloom_filter.hpp.

Member Typedef Documentation

◆ bloom_type

typedef unsigned int fc::bloom_filter::bloom_type
protected

Definition at line 183 of file bloom_filter.hpp.

◆ cell_type

typedef unsigned char fc::bloom_filter::cell_type
protected

Definition at line 184 of file bloom_filter.hpp.

◆ table_type

typedef std::vector<unsigned char> fc::bloom_filter::table_type
protected

Definition at line 185 of file bloom_filter.hpp.

Constructor & Destructor Documentation

◆ bloom_filter() [1/3]

fc::bloom_filter::bloom_filter ( )
inline

Definition at line 189 of file bloom_filter.hpp.

◆ bloom_filter() [2/3]

fc::bloom_filter::bloom_filter ( const bloom_parameters p)
inline

Definition at line 198 of file bloom_filter.hpp.

◆ bloom_filter() [3/3]

fc::bloom_filter::bloom_filter ( const bloom_filter filter)
inline

Definition at line 212 of file bloom_filter.hpp.

◆ ~bloom_filter()

virtual fc::bloom_filter::~bloom_filter ( )
inlinevirtual

Definition at line 261 of file bloom_filter.hpp.

Member Function Documentation

◆ clear()

void fc::bloom_filter::clear ( )
inline

Definition at line 269 of file bloom_filter.hpp.

◆ compute_indices()

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

Definition at line 476 of file bloom_filter.hpp.

◆ contains() [1/4]

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

Definition at line 347 of file bloom_filter.hpp.

◆ contains() [2/4]

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

Definition at line 342 of file bloom_filter.hpp.

◆ contains() [3/4]

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

Definition at line 337 of file bloom_filter.hpp.

◆ contains() [4/4]

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

Definition at line 318 of file bloom_filter.hpp.

◆ contains_all()

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

Definition at line 353 of file bloom_filter.hpp.

◆ contains_none()

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

Definition at line 371 of file bloom_filter.hpp.

◆ effective_fpp()

double fc::bloom_filter::effective_fpp ( ) const
inline

Definition at line 398 of file bloom_filter.hpp.

◆ element_count()

unsigned long long int fc::bloom_filter::element_count ( ) const
inline

Definition at line 393 of file bloom_filter.hpp.

◆ generate_unique_salt()

void fc::bloom_filter::generate_unique_salt ( )
inlineprotected

Definition at line 482 of file bloom_filter.hpp.

◆ hash_ap()

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

Definition at line 566 of file bloom_filter.hpp.

◆ hash_count()

std::size_t fc::bloom_filter::hash_count ( )
inline

Definition at line 469 of file bloom_filter.hpp.

◆ insert() [1/5]

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

Definition at line 302 of file bloom_filter.hpp.

◆ insert() [2/5]

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

Definition at line 308 of file bloom_filter.hpp.

◆ insert() [3/5]

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

Definition at line 297 of file bloom_filter.hpp.

◆ insert() [4/5]

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

Definition at line 291 of file bloom_filter.hpp.

◆ insert() [5/5]

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

Definition at line 275 of file bloom_filter.hpp.

◆ operator!()

bool fc::bloom_filter::operator! ( ) const
inline

Definition at line 264 of file bloom_filter.hpp.

◆ operator!=()

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

Definition at line 236 of file bloom_filter.hpp.

◆ operator&=()

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

Definition at line 410 of file bloom_filter.hpp.

◆ operator=()

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

Definition at line 241 of file bloom_filter.hpp.

◆ operator==()

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

Definition at line 217 of file bloom_filter.hpp.

◆ operator^=()

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

Definition at line 446 of file bloom_filter.hpp.

◆ operator|=()

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

Definition at line 428 of file bloom_filter.hpp.

◆ size()

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

Definition at line 388 of file bloom_filter.hpp.

◆ table()

const cell_type* fc::bloom_filter::table ( ) const
inline

Definition at line 464 of file bloom_filter.hpp.

Member Data Documentation

◆ bit_table_

std::vector<unsigned char> fc::bloom_filter::bit_table_

Definition at line 627 of file bloom_filter.hpp.

◆ desired_false_positive_probability_

double fc::bloom_filter::desired_false_positive_probability_

Definition at line 633 of file bloom_filter.hpp.

◆ inserted_element_count_

unsigned long long int fc::bloom_filter::inserted_element_count_

Definition at line 631 of file bloom_filter.hpp.

◆ projected_element_count_

unsigned long long int fc::bloom_filter::projected_element_count_

Definition at line 630 of file bloom_filter.hpp.

◆ random_seed_

unsigned long long int fc::bloom_filter::random_seed_

Definition at line 632 of file bloom_filter.hpp.

◆ salt_

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

Definition at line 626 of file bloom_filter.hpp.

◆ salt_count_

unsigned int fc::bloom_filter::salt_count_

Definition at line 628 of file bloom_filter.hpp.

◆ table_size_

unsigned long long int fc::bloom_filter::table_size_

Definition at line 629 of file bloom_filter.hpp.


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