Fabcoin Core  0.16.2
P2P Digital Currency
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
dev::shh::TopicBloomFilterBase< N > Class Template Reference

#include <BloomFilter.h>

Inheritance diagram for dev::shh::TopicBloomFilterBase< N >:
[legend]
Collaboration diagram for dev::shh::TopicBloomFilterBase< N >:
[legend]

Public Member Functions

 TopicBloomFilterBase ()
 
 TopicBloomFilterBase (FixedHash< N > const &_h)
 
void addBloom (AbridgedTopic const &_h)
 
void removeBloom (AbridgedTopic const &_h)
 
bool containsBloom (AbridgedTopic const &_h) const
 
void addRaw (FixedHash< N > const &_h)
 
void removeRaw (FixedHash< N > const &_h)
 
bool containsRaw (FixedHash< N > const &_h) const
 
- Public Member Functions inherited from dev::FixedHash< N >
 FixedHash ()
 Construct an empty hash. More...
 
template<unsigned M>
 FixedHash (FixedHash< M > const &_h, ConstructFromHashType _t=AlignLeft)
 Construct from another hash, filling with zeroes or cropping as necessary. More...
 
 FixedHash (Arith const &_arith)
 Convert from the corresponding arithmetic type. More...
 
 FixedHash (unsigned _u)
 Convert from unsigned. More...
 
 FixedHash (bytes const &_b, ConstructFromHashType _t=FailIfDifferent)
 Explicitly construct, copying from a byte array. More...
 
 FixedHash (bytesConstRef _b, ConstructFromHashType _t=FailIfDifferent)
 Explicitly construct, copying from a byte array. More...
 
 FixedHash (byte const *_bs, ConstructFromPointerType)
 Explicitly construct, copying from a bytes in memory with given pointer. More...
 
 FixedHash (std::string const &_s, ConstructFromStringType _t=FromHex, ConstructFromHashType _ht=FailIfDifferent)
 Explicitly construct, copying from a string. More...
 
 operator Arith () const
 Convert to arithmetic type. More...
 
 operator bool () const
 
bool operator== (FixedHash const &_c) const
 
bool operator!= (FixedHash const &_c) const
 
bool operator< (FixedHash const &_c) const
 
bool operator>= (FixedHash const &_c) const
 
bool operator<= (FixedHash const &_c) const
 
bool operator> (FixedHash const &_c) const
 
FixedHashoperator^= (FixedHash const &_c)
 
FixedHash operator^ (FixedHash const &_c) const
 
FixedHashoperator|= (FixedHash const &_c)
 
FixedHash operator| (FixedHash const &_c) const
 
FixedHashoperator&= (FixedHash const &_c)
 
FixedHash operator& (FixedHash const &_c) const
 
FixedHash operator~ () const
 
FixedHashoperator++ ()
 
bool contains (FixedHash const &_c) const
 
byteoperator[] (unsigned _i)
 
byte operator[] (unsigned _i) const
 
std::string abridged () const
 
std::string abridgedMiddle () const
 
std::string hex () const
 
bytesRef ref ()
 
bytesConstRef ref () const
 
bytedata ()
 
byte const * data () const
 
bytes asBytes () const
 
std::array< byte, N > & asArray ()
 
std::array< byte, N > const & asArray () const
 
template<class Engine >
void randomize (Engine &_eng)
 Populate with random data. More...
 
template<unsigned P, unsigned M>
FixedHashshiftBloom (FixedHash< M > const &_h)
 
template<unsigned P, unsigned M>
bool containsBloom (FixedHash< M > const &_h)
 
template<unsigned P, unsigned M>
FixedHash< M > bloomPart () const
 
unsigned firstBitSet () const
 Returns the index of the first bit set to one, or size() * 8 if no bits are set. More...
 
void clear ()
 
template<>
bool operator== (FixedHash< 32 > const &_other) const
 Fast equality operator for h256. More...
 

Static Public Member Functions

static FixedHash< N > bloom (AbridgedTopic const &_h)
 
static void setBit (FixedHash< N > &_h, unsigned index)
 
static bool isBitSet (FixedHash< N > const &_h, unsigned _index)
 
- Static Public Member Functions inherited from dev::FixedHash< N >
static FixedHash random ()
 

Private Member Functions

void init ()
 

Private Attributes

std::array< uint16_t, CounterSizem_refCounter
 

Static Private Attributes

static const unsigned CounterSize = N * 8
 

Additional Inherited Members

- Public Types inherited from dev::FixedHash< N >
enum  { size = N }
 The size of the container. More...
 
enum  ConstructFromPointerType { ConstructFromPointer }
 A dummy flag to avoid accidental construction from pointer. More...
 
enum  ConstructFromStringType { FromHex, FromBinary }
 Method to convert from a string. More...
 
enum  ConstructFromHashType { AlignLeft, AlignRight, FailIfDifferent }
 Method to convert from a string. More...
 
using Arith = boost::multiprecision::number< boost::multiprecision::cpp_int_backend< N *8, N *8, boost::multiprecision::unsigned_magnitude, boost::multiprecision::unchecked, void >>
 The corresponding arithmetic type. More...
 

Detailed Description

template<unsigned N>
class dev::shh::TopicBloomFilterBase< N >

Definition at line 32 of file BloomFilter.h.

Constructor & Destructor Documentation

template<unsigned N>
dev::shh::TopicBloomFilterBase< N >::TopicBloomFilterBase ( )
inline

Definition at line 35 of file BloomFilter.h.

template<unsigned N>
dev::shh::TopicBloomFilterBase< N >::TopicBloomFilterBase ( FixedHash< N > const &  _h)
inline

Definition at line 36 of file BloomFilter.h.

Member Function Documentation

template<unsigned N>
void dev::shh::TopicBloomFilterBase< N >::addBloom ( AbridgedTopic const &  _h)
inline

Definition at line 38 of file BloomFilter.h.

Here is the caller graph for this function:

template<unsigned N>
void dev::shh::TopicBloomFilterBase< N >::addRaw ( FixedHash< N > const &  _h)

Definition at line 60 of file BloomFilter.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<unsigned N>
FixedHash< N > dev::shh::TopicBloomFilterBase< N >::bloom ( AbridgedTopic const &  _h)
static

Definition at line 104 of file BloomFilter.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<unsigned N>
bool dev::shh::TopicBloomFilterBase< N >::containsBloom ( AbridgedTopic const &  _h) const
inline

Definition at line 40 of file BloomFilter.h.

Here is the caller graph for this function:

template<unsigned N>
bool dev::shh::TopicBloomFilterBase< N >::containsRaw ( FixedHash< N > const &  _h) const
inline

Definition at line 44 of file BloomFilter.h.

Here is the caller graph for this function:

template<unsigned N>
void dev::shh::TopicBloomFilterBase< N >::init ( )
inlineprivate

Definition at line 51 of file BloomFilter.h.

Here is the caller graph for this function:

template<unsigned N>
bool dev::shh::TopicBloomFilterBase< N >::isBitSet ( FixedHash< N > const &  _h,
unsigned  _index 
)
static

Definition at line 88 of file BloomFilter.h.

Here is the caller graph for this function:

template<unsigned N>
void dev::shh::TopicBloomFilterBase< N >::removeBloom ( AbridgedTopic const &  _h)
inline

Definition at line 39 of file BloomFilter.h.

Here is the caller graph for this function:

template<unsigned N>
void dev::shh::TopicBloomFilterBase< N >::removeRaw ( FixedHash< N > const &  _h)

Definition at line 74 of file BloomFilter.h.

Here is the call graph for this function:

Here is the caller graph for this function:

template<unsigned N>
void dev::shh::TopicBloomFilterBase< N >::setBit ( FixedHash< N > &  _h,
unsigned  index 
)
static

Definition at line 96 of file BloomFilter.h.

Here is the caller graph for this function:

Member Data Documentation

template<unsigned N>
const unsigned dev::shh::TopicBloomFilterBase< N >::CounterSize = N * 8
staticprivate

Definition at line 53 of file BloomFilter.h.

template<unsigned N>
std::array<uint16_t, CounterSize> dev::shh::TopicBloomFilterBase< N >::m_refCounter
private

Definition at line 54 of file BloomFilter.h.


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