gatb.core-API-1.4.2
IBloom< Item > Class Template Referenceabstract

Bloom interface. More...

#include <Bloom.hpp>

Inheritance diagram for IBloom< Item >:
Inheritance graph

Public Member Functions

virtual ~IBloom ()
 
virtual u_int8_t *& getArray ()=0
 
virtual u_int64_t getSize ()=0
 
virtual u_int64_t getBitSize ()=0
 
virtual size_t getNbHash () const =0
 
virtual bool contains (const Item &item)=0
 
virtual std::bitset< 4 > contains4 (const Item &item, bool right)=0
 
virtual std::bitset< 8 > contains8 (const Item &item)=0
 
virtual std::string getName () const =0
 
virtual unsigned long weight ()=0
 
- 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 Item &item)=0
 
virtual void insert (const std::vector< Item > &items, size_t length=0)
 
virtual void insert (const Item *items, size_t length)
 
virtual void flush ()=0
 
- 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::IBloom< Item >

Bloom interface.

We define a Bloom filter has a container (something that tells whether an item is here or not) and a bag (something we can put items into).

This interface has a template argument corresponding to the type of items to be inserted in the filter. Note that implementations should provide hash functions supporting the template type.

As expected, there is no Iterable interface here because it is not possible to enumerate the items inserted in a Bloom filter only with the Bloom filter information.

Constructor & Destructor Documentation

virtual ~IBloom ( )
inlinevirtual

Destructor.

Member Function Documentation

virtual bool contains ( const Item &  item)
pure virtual

Tells whether an item is in the Bloom filter

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

Implements Container< Item >.

Implemented in BloomNeighborCoherent< Item >, BloomCacheCoherent< Item >, BloomNull< Item >, and BloomContainer< Item >.

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

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

Implemented in BloomExtendedNeighborCoherent< Item >, BloomNeighborCoherent< Item >, BloomNull< Item >, and BloomContainer< Item >.

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

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

Implemented in BloomNeighborCoherent< Item >, BloomNull< Item >, and BloomContainer< Item >.

virtual u_int8_t*& getArray ( )
pure virtual

Get the raw bit set of the Bloom filter.

Returns
Bloom filter's bit set.

Implemented in BloomNull< Item >, and BloomContainer< Item >.

virtual u_int64_t getBitSize ( )
pure virtual

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

Returns
the size of the bit set of the Bloom filter

Implemented in BloomExtendedNeighborCoherent< Item >, BloomNeighborCoherent< Item >, BloomCacheCoherent< Item >, BloomNull< Item >, and BloomContainer< Item >.

virtual std::string getName ( ) const
pure virtual
virtual size_t getNbHash ( ) const
pure virtual

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

Returns
the number of hash functions.

Implemented in BloomNull< Item >, and BloomContainer< Item >.

virtual u_int64_t getSize ( )
pure virtual

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

Returns
the size of the bit set of the Bloom filter

Implemented in BloomNull< Item >, and BloomContainer< Item >.

virtual unsigned long weight ( )
pure virtual

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

Returns
the weight of the Bloom filter

Implemented in BloomCacheCoherent< Item >, BloomNull< Item >, and Bloom< Item >.


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