BitShares-Core  4.0.0
BitShares blockchain implementation and command-line interface 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
 
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 ()
 

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 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_
 

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
 

Detailed Description

Definition at line 175 of file bloom_filter.hpp.

Member Typedef Documentation

typedef unsigned int fc::bloom_filter::bloom_type
protected

Definition at line 179 of file bloom_filter.hpp.

typedef unsigned char fc::bloom_filter::cell_type
protected

Definition at line 180 of file bloom_filter.hpp.

Constructor & Destructor Documentation

fc::bloom_filter::bloom_filter ( )
inline

Definition at line 184 of file bloom_filter.hpp.

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

Definition at line 194 of file bloom_filter.hpp.

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

Definition at line 210 of file bloom_filter.hpp.

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

Definition at line 257 of file bloom_filter.hpp.

Member Function Documentation

void fc::bloom_filter::clear ( )
inline

Definition at line 266 of file bloom_filter.hpp.

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 457 of file bloom_filter.hpp.

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

Definition at line 311 of file bloom_filter.hpp.

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

Definition at line 327 of file bloom_filter.hpp.

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

Definition at line 332 of file bloom_filter.hpp.

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

Definition at line 337 of file bloom_filter.hpp.

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

Definition at line 343 of file bloom_filter.hpp.

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

Definition at line 358 of file bloom_filter.hpp.

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

Definition at line 382 of file bloom_filter.hpp.

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

Definition at line 377 of file bloom_filter.hpp.

void fc::bloom_filter::generate_unique_salt ( )
inlineprotected

Definition at line 463 of file bloom_filter.hpp.

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

Definition at line 540 of file bloom_filter.hpp.

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

Definition at line 450 of file bloom_filter.hpp.

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

Definition at line 272 of file bloom_filter.hpp.

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

Definition at line 285 of file bloom_filter.hpp.

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

Definition at line 291 of file bloom_filter.hpp.

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

Definition at line 296 of file bloom_filter.hpp.

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

Definition at line 302 of file bloom_filter.hpp.

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

Definition at line 261 of file bloom_filter.hpp.

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

Definition at line 234 of file bloom_filter.hpp.

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

Definition at line 394 of file bloom_filter.hpp.

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

Definition at line 239 of file bloom_filter.hpp.

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

Definition at line 215 of file bloom_filter.hpp.

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

Definition at line 428 of file bloom_filter.hpp.

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

Definition at line 411 of file bloom_filter.hpp.

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

Definition at line 372 of file bloom_filter.hpp.

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

Definition at line 445 of file bloom_filter.hpp.

Member Data Documentation

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

Definition at line 586 of file bloom_filter.hpp.

double fc::bloom_filter::desired_false_positive_probability_

Definition at line 593 of file bloom_filter.hpp.

unsigned int fc::bloom_filter::inserted_element_count_

Definition at line 591 of file bloom_filter.hpp.

unsigned long long int fc::bloom_filter::projected_element_count_

Definition at line 590 of file bloom_filter.hpp.

unsigned long long int fc::bloom_filter::random_seed_

Definition at line 592 of file bloom_filter.hpp.

unsigned long long int fc::bloom_filter::raw_table_size_

Definition at line 589 of file bloom_filter.hpp.

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

Definition at line 585 of file bloom_filter.hpp.

unsigned int fc::bloom_filter::salt_count_

Definition at line 587 of file bloom_filter.hpp.

unsigned long long int fc::bloom_filter::table_size_

Definition at line 588 of file bloom_filter.hpp.


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