gatb.core-API-1.4.2
BloomNull< Item > Class Template Reference

Bloom filter null implementation. More...

#include <Bloom.hpp>

Inheritance diagram for BloomNull< Item >:
Inheritance graph

Public Member Functions

virtual ~BloomNull ()
 
u_int8_t *& getArray ()
 
u_int64_t getSize ()
 
u_int64_t getBitSize ()
 
size_t getNbHash () const
 
virtual std::string getName () const
 
std::bitset< 4 > contains4 (const Item &item, bool right)
 
std::bitset< 8 > contains8 (const Item &item)
 
bool contains (const Item &item)
 
void insert (const Item &item)
 
void flush ()
 
unsigned long weight ()
 
- Public Member Functions inherited from IBloom< Item >
virtual ~IBloom ()
 
- Public Member Functions inherited from Container< Item >
virtual ~Container ()
 
- Public Member Functions inherited from ISmartPointer
virtual ~ISmartPointer ()
 
- Public Member Functions inherited from Bag< Item >
virtual void insert (const std::vector< Item > &items, size_t length=0)
 
virtual void insert (const Item *items, size_t length)
 
- Public Member Functions inherited from SmartPointer
void use ()
 
void forget ()
 

Additional Inherited Members

- Protected Member Functions inherited from SmartPointer
 SmartPointer ()
 
virtual ~SmartPointer ()
 

Detailed Description

template<typename Item>
class gatb::core::tools::collections::impl::BloomNull< Item >

Bloom filter null implementation.

This is a "null" implementation of the IBloom interface. It means that all the contains-like requests will return false.

Constructor & Destructor Documentation

virtual ~BloomNull ( )
inlinevirtual

Destructor.

Member Function Documentation

bool contains ( const Item &  item)
inlinevirtual

Tells whether an item is in the Bloom filter

Parameters
[in]item: item to test.
Returns
the presence or not of the item

Implements IBloom< Item >.

std::bitset<4> contains4 ( const Item &  item,
bool  right 
)
inlinevirtual

Tells whether the 4 neighbors of the given item are in the Bloom filter. The 4 neighbors are computed from the given item by adding successively nucleotides 'A', 'C', 'T' and 'G' Note: some implementation may not provide this service.

Parameters
[in]item: starting item from which neighbors are computed.
[in]right: if true, successors are computed, otherwise predecessors are computed.
Returns
a bitset with a boolean for the 'contains' status of each neighbor

Implements IBloom< Item >.

std::bitset<8> contains8 ( const Item &  item)
inlinevirtual

Tells whether the 8 neighbors of the given item are in the Bloom filter. A default implementation may be two calls to contains4 with right==true and right==left and by concatenating the two bitsets. Note: some implementation may not provide this service.

Parameters
[in]item: starting item from which neighbors are computed.
Returns
a bitset with a boolean for the 'contains' status of each neighbor

Implements IBloom< Item >.

void flush ( )
inlinevirtual

Flush the current content. May be useful for implementation that uses a cache.

Implements Bag< Item >.

u_int8_t*& getArray ( )
inlinevirtual

Get the raw bit set of the Bloom filter.

Returns
Bloom filter's bit set.

Implements IBloom< Item >.

u_int64_t getBitSize ( )
inlinevirtual

Get the size of the Bloom filter (in bits).

Returns
the size of the bit set of the Bloom filter

Implements IBloom< Item >.

virtual std::string getName ( ) const
inlinevirtual

Get the name of the implementation class.

Returns
the class name.

Implements IBloom< Item >.

size_t getNbHash ( ) const
inlinevirtual

Get the number of hash functions used for the Bloom filter.

Returns
the number of hash functions.

Implements IBloom< Item >.

u_int64_t getSize ( )
inlinevirtual

Get the size of the Bloom filter (in bytes).

Returns
the size of the bit set of the Bloom filter

Implements IBloom< Item >.

void insert ( const Item &  item)
inlinevirtual

Insert an item into the bag.

Parameters
[in]item: the item to be inserted.

Implements Bag< Item >.

unsigned long weight ( )
inlinevirtual

Return the number of 1's in the Bloom (nibble by nibble)

Returns
the weight of the Bloom filter

Implements IBloom< Item >.


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