libmoost
moost::container::bit_filter< itemT, hashT > Class Template Reference

#include <bit_filter.hpp>

List of all members.

Public Types

typedef itemT item_type
typedef hashT hash_type
typedef bit_filter< item_type,
hash_type
this_type
typedef
bit_filter_types::serial_buffer_t 
serial_buffer_t

Public Member Functions

 bit_filter (size_t const size, hash_type const &ht=hash_type())
template<typename inputIteratorT >
 bit_filter (size_t const size, inputIteratorT beg, inputIteratorT end, bool boptimise=false, hash_type const &ht=hash_type())
 bit_filter (bit_filter const &rhs)
bit_filteroperator= (bit_filter const &rhs)
void insert (item_type const &t, bool boptimise=false)
template<typename inputIteratorT >
void insert (inputIteratorT beg, inputIteratorT end, bool boptimise=false)
template<typename inputIteratorT >
void replace (inputIteratorT beg, inputIteratorT end)
void clear ()
size_t size () const
bool find (item_type const &t) const
template<typename inputIteratorT >
size_t find (inputIteratorT beg, inputIteratorT end) const
template<typename inputIteratorT , typename outputIteratorT >
size_t find (inputIteratorT beg, inputIteratorT end, outputIteratorT out) const
bool find (this_type const &rhs) const
void optimize ()
size_t serialize (serial_buffer_t &buf, bool boptimise=true)
void deserialize (serial_buffer_t const &buf, bool bclear=true)
bool operator== (this_type const &rhs) const
bool operator!= (this_type const &rhs) const
size_t memory () const
size_t count () const

Private Attributes

size_t size_
bm::bvector bv_
hash_type ht_

Detailed Description

template<typename itemT, typename hashT = bit_filter_types::default_hash>
class moost::container::bit_filter< itemT, hashT >

Definition at line 64 of file bit_filter.hpp.


Member Typedef Documentation

template<typename itemT, typename hashT = bit_filter_types::default_hash>
typedef hashT moost::container::bit_filter< itemT, hashT >::hash_type

Definition at line 68 of file bit_filter.hpp.

template<typename itemT, typename hashT = bit_filter_types::default_hash>
typedef itemT moost::container::bit_filter< itemT, hashT >::item_type

Definition at line 67 of file bit_filter.hpp.

template<typename itemT, typename hashT = bit_filter_types::default_hash>
typedef bit_filter_types::serial_buffer_t moost::container::bit_filter< itemT, hashT >::serial_buffer_t

Definition at line 70 of file bit_filter.hpp.

template<typename itemT, typename hashT = bit_filter_types::default_hash>
typedef bit_filter<item_type, hash_type> moost::container::bit_filter< itemT, hashT >::this_type

Definition at line 69 of file bit_filter.hpp.


Constructor & Destructor Documentation

template<typename itemT, typename hashT = bit_filter_types::default_hash>
moost::container::bit_filter< itemT, hashT >::bit_filter ( size_t const  size,
hash_type const &  ht = hash_type() 
) [inline]

c_tor

Definition at line 75 of file bit_filter.hpp.

template<typename itemT, typename hashT = bit_filter_types::default_hash>
template<typename inputIteratorT >
moost::container::bit_filter< itemT, hashT >::bit_filter ( size_t const  size,
inputIteratorT  beg,
inputIteratorT  end,
bool  boptimise = false,
hash_type const &  ht = hash_type() 
) [inline]

c_tor

Definition at line 86 of file bit_filter.hpp.

Here is the call graph for this function:

template<typename itemT, typename hashT = bit_filter_types::default_hash>
moost::container::bit_filter< itemT, hashT >::bit_filter ( bit_filter< itemT, hashT > const &  rhs) [inline]

cc_tor

Definition at line 100 of file bit_filter.hpp.


Member Function Documentation

template<typename itemT, typename hashT = bit_filter_types::default_hash>
void moost::container::bit_filter< itemT, hashT >::clear ( ) [inline]

Unset all the bits in the filter

Definition at line 161 of file bit_filter.hpp.

Here is the caller graph for this function:

template<typename itemT, typename hashT = bit_filter_types::default_hash>
size_t moost::container::bit_filter< itemT, hashT >::count ( ) const [inline]

Gets the count of the number of bits actually set.

Definition at line 317 of file bit_filter.hpp.

template<typename itemT, typename hashT = bit_filter_types::default_hash>
void moost::container::bit_filter< itemT, hashT >::deserialize ( serial_buffer_t const &  buf,
bool  bclear = true 
) [inline]

Deserialise the bit filter from a vector of bytes. Optionally, once serialised the filter is cleared.

Definition at line 278 of file bit_filter.hpp.

Here is the caller graph for this function:

template<typename itemT, typename hashT = bit_filter_types::default_hash>
bool moost::container::bit_filter< itemT, hashT >::find ( item_type const &  t) const [inline]

Checks for the findance of a single item

Definition at line 177 of file bit_filter.hpp.

Here is the caller graph for this function:

template<typename itemT, typename hashT = bit_filter_types::default_hash>
template<typename inputIteratorT >
size_t moost::container::bit_filter< itemT, hashT >::find ( inputIteratorT  beg,
inputIteratorT  end 
) const [inline]

Checks for the findance of multiple items in a container, returning a count of the number of items that match

Definition at line 187 of file bit_filter.hpp.

Here is the call graph for this function:

template<typename itemT, typename hashT = bit_filter_types::default_hash>
template<typename inputIteratorT , typename outputIteratorT >
size_t moost::container::bit_filter< itemT, hashT >::find ( inputIteratorT  beg,
inputIteratorT  end,
outputIteratorT  out 
) const [inline]

Checks for the findance of multiple items in a container, returning a count of the number of items that match as well as adding all matching items to an output container using the output iterator

Definition at line 209 of file bit_filter.hpp.

Here is the call graph for this function:

template<typename itemT, typename hashT = bit_filter_types::default_hash>
bool moost::container::bit_filter< itemT, hashT >::find ( this_type const &  rhs) const [inline]

Checks if any bits in rhs match

Definition at line 230 of file bit_filter.hpp.

template<typename itemT, typename hashT = bit_filter_types::default_hash>
void moost::container::bit_filter< itemT, hashT >::insert ( item_type const &  t,
bool  boptimise = false 
) [inline]

Insert an item in to the filter

Definition at line 123 of file bit_filter.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename itemT, typename hashT = bit_filter_types::default_hash>
template<typename inputIteratorT >
void moost::container::bit_filter< itemT, hashT >::insert ( inputIteratorT  beg,
inputIteratorT  end,
bool  boptimise = false 
) [inline]

Insert items in to the filter using iterators of a container, finding items are preserved

Definition at line 137 of file bit_filter.hpp.

Here is the call graph for this function:

template<typename itemT, typename hashT = bit_filter_types::default_hash>
size_t moost::container::bit_filter< itemT, hashT >::memory ( ) const [inline]

The amount of memory being used by the internal filter (in bytes). Note that a call to optimise is likely to improve memory usage.

Definition at line 307 of file bit_filter.hpp.

template<typename itemT, typename hashT = bit_filter_types::default_hash>
bool moost::container::bit_filter< itemT, hashT >::operator!= ( this_type const &  rhs) const [inline]

Inequality operator for the bit filter

Definition at line 298 of file bit_filter.hpp.

template<typename itemT, typename hashT = bit_filter_types::default_hash>
bit_filter& moost::container::bit_filter< itemT, hashT >::operator= ( bit_filter< itemT, hashT > const &  rhs) [inline]

Assignment

Definition at line 108 of file bit_filter.hpp.

template<typename itemT, typename hashT = bit_filter_types::default_hash>
bool moost::container::bit_filter< itemT, hashT >::operator== ( this_type const &  rhs) const [inline]

Equality operator for the bit filter

Definition at line 290 of file bit_filter.hpp.

template<typename itemT, typename hashT = bit_filter_types::default_hash>
void moost::container::bit_filter< itemT, hashT >::optimize ( ) [inline]

If possible will optimize the internal representation of the bitset, saving memory

Definition at line 238 of file bit_filter.hpp.

Here is the caller graph for this function:

template<typename itemT, typename hashT = bit_filter_types::default_hash>
template<typename inputIteratorT >
void moost::container::bit_filter< itemT, hashT >::replace ( inputIteratorT  beg,
inputIteratorT  end 
) [inline]

Insert items in to the filter using iterators of a container, finding items are cleared first

Definition at line 152 of file bit_filter.hpp.

Here is the call graph for this function:

template<typename itemT, typename hashT = bit_filter_types::default_hash>
size_t moost::container::bit_filter< itemT, hashT >::serialize ( serial_buffer_t buf,
bool  boptimise = true 
) [inline]

Serialise the bit filter to a vector of bytes. Optionally, optimize before serialisation. Returns the number of bytes used by serialisation.

Definition at line 248 of file bit_filter.hpp.

Here is the call graph for this function:

Here is the caller graph for this function:

template<typename itemT, typename hashT = bit_filter_types::default_hash>
size_t moost::container::bit_filter< itemT, hashT >::size ( ) const [inline]

The size (number of bits) of the filter

Definition at line 169 of file bit_filter.hpp.

Here is the caller graph for this function:


Member Data Documentation

template<typename itemT, typename hashT = bit_filter_types::default_hash>
bm::bvector moost::container::bit_filter< itemT, hashT >::bv_ [private]

Definition at line 324 of file bit_filter.hpp.

template<typename itemT, typename hashT = bit_filter_types::default_hash>
hash_type moost::container::bit_filter< itemT, hashT >::ht_ [private]

Definition at line 325 of file bit_filter.hpp.

template<typename itemT, typename hashT = bit_filter_types::default_hash>
size_t moost::container::bit_filter< itemT, hashT >::size_ [private]

Definition at line 323 of file bit_filter.hpp.


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