BitShares-Core  5.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
 
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

typedef unsigned int fc::bloom_filter::bloom_type
protected

Definition at line 183 of file bloom_filter.hpp.

typedef unsigned char fc::bloom_filter::cell_type
protected

Definition at line 184 of file bloom_filter.hpp.

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

Definition at line 185 of file bloom_filter.hpp.

Constructor & Destructor Documentation

fc::bloom_filter::bloom_filter ( )
inline

Definition at line 189 of file bloom_filter.hpp.

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

Definition at line 198 of file bloom_filter.hpp.

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

Definition at line 212 of file bloom_filter.hpp.

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

Definition at line 261 of file bloom_filter.hpp.

Member Function Documentation

void fc::bloom_filter::clear ( )
inline

Definition at line 269 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 476 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 318 of file bloom_filter.hpp.

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

Definition at line 337 of file bloom_filter.hpp.

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

Definition at line 342 of file bloom_filter.hpp.

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

Definition at line 347 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 353 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 371 of file bloom_filter.hpp.

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

Definition at line 398 of file bloom_filter.hpp.

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

Definition at line 393 of file bloom_filter.hpp.

void fc::bloom_filter::generate_unique_salt ( )
inlineprotected

Definition at line 482 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 566 of file bloom_filter.hpp.

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

Definition at line 469 of file bloom_filter.hpp.

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.

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

Definition at line 291 of file bloom_filter.hpp.

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

Definition at line 297 of file bloom_filter.hpp.

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

Definition at line 302 of file bloom_filter.hpp.

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

Definition at line 308 of file bloom_filter.hpp.

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

Definition at line 264 of file bloom_filter.hpp.

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

Definition at line 236 of file bloom_filter.hpp.

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

Definition at line 410 of file bloom_filter.hpp.

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

Definition at line 241 of file bloom_filter.hpp.

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

Definition at line 217 of file bloom_filter.hpp.

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

Definition at line 446 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.

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

Definition at line 388 of file bloom_filter.hpp.

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

Definition at line 464 of file bloom_filter.hpp.

Member Data Documentation

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

Definition at line 627 of file bloom_filter.hpp.

double fc::bloom_filter::desired_false_positive_probability_

Definition at line 633 of file bloom_filter.hpp.

unsigned long long int fc::bloom_filter::inserted_element_count_

Definition at line 631 of file bloom_filter.hpp.

unsigned long long int fc::bloom_filter::projected_element_count_

Definition at line 630 of file bloom_filter.hpp.

unsigned long long int fc::bloom_filter::random_seed_

Definition at line 632 of file bloom_filter.hpp.

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

Definition at line 626 of file bloom_filter.hpp.

unsigned int fc::bloom_filter::salt_count_

Definition at line 628 of file bloom_filter.hpp.

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: