gatb.core-API-0.0.0
BankDelegate Class Reference

Bank implementation that delegates work to a referred bank. More...

#include <BankHelpers.hpp>

Inheritance diagram for BankDelegate:
Inheritance graph

Public Member Functions

 BankDelegate (IBank *ref)
 
 ~BankDelegate ()
 
std::string getId ()
 
std::string getIdNb (int i)
 
tools::dp::Iterator< Sequence > * iterator ()
 
int64_t getNbItems ()
 
void insert (const Sequence &item)
 
void flush ()
 
u_int64_t getSize ()
 
void estimate (u_int64_t &number, u_int64_t &totalSize, u_int64_t &maxSize)
 
int64_t estimateNbItems ()
 
int64_t estimateNbItemsBanki (int i)
 
u_int64_t estimateSequencesSize ()
 
u_int64_t getEstimateThreshold ()
 
void setEstimateThreshold (u_int64_t nbSeq)
 
- Public Member Functions inherited from AbstractBank
 AbstractBank ()
 
const std::vector< IBank * > getBanks () const
 
void remove ()
 
void finalize ()
 
size_t getCompositionNb ()
 
- Public Member Functions inherited from Iterable< Sequence >
void iterate (Functor f)
 
virtual Sequence * getItems (Sequence *&buffer)
 
virtual size_t getItems (Sequence *&buffer, size_t start, size_t nb)
 
- Public Member Functions inherited from ISmartPointer
virtual ~ISmartPointer ()
 
- Public Member Functions inherited from Bag< Sequence >
virtual void insert (const Sequence &item)=0
 
virtual void insert (const std::vector< Sequence > &items, size_t length=0)
 
virtual void insert (const Sequence *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

Bank implementation that delegates work to a referred bank.

Implementation of the Proxy design pattern for the IBank interface.

This class is not intended to be used by end users; it is rather used for being subclassed.

Constructor & Destructor Documentation

BankDelegate ( IBank ref)
inline

Constructor.

Parameters
[in]ref: referred bank.
~BankDelegate ( )
inline

Destructor.

Member Function Documentation

void estimate ( u_int64_t &  number,
u_int64_t &  totalSize,
u_int64_t &  maxSize 
)
inlinevirtual

Give an estimation of sequences information in the bank.

Parameters
[out]number: sequences number
[out]totalSize: sequences size (in bytes)
[out]maxSize: max size size (in bytes)

Implements IBank.

int64_t estimateNbItems ( )
inlinevirtual

Shortcut to 'estimate' method.

Returns
estimation of the number of sequences

Reimplemented from AbstractBank.

int64_t estimateNbItemsBanki ( int  i)
inlinevirtual

Shortcut to 'estimate' method.

Returns
estimation of the number of sequences

Reimplemented from AbstractBank.

u_int64_t estimateSequencesSize ( )
inlinevirtual

Shortcut to 'estimate' method.

Returns
estimation of the size of sequences

Reimplemented from AbstractBank.

void flush ( )
inlinevirtual

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

Implements Bag< Sequence >.

u_int64_t getEstimateThreshold ( )
inlinevirtual

Returns
the number of sequences read from the bank for computing estimated information

Reimplemented from AbstractBank.

std::string getId ( )
inlinevirtual

Get an unique identifier for the bank (could be the URI of a FASTA file for instance).

Returns
the identifier

Implements IBank.

std::string getIdNb ( int  i)
inlinevirtual

In case of a composite bank, return the id of bank i

Returns
id of sub bank i

Reimplemented from AbstractBank.

int64_t getNbItems ( )
inlinevirtual

Return the number of items. If a specific implementation doesn't know the value, it should return -1 by convention.

Returns
the number of items if known, -1 otherwise.

Implements Iterable< Sequence >.

u_int64_t getSize ( )
inlinevirtual

Return the size of the bank (comments + data)

The returned value may be an approximation in some case. For instance, if we use a zipped bank, an implementation may be not able to give accurate answer to the size of the original file.

Returns
the bank size in bytes.

Implements IBank.

void insert ( const Sequence item)
inlinevirtual

Insert an item into the bag.

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

Implements IBank.

tools::dp::Iterator<Sequence>* iterator ( )
inlinevirtual

Create an iterator for the given Iterable instance.

Returns
the new iterator.

Implements IBank.

Reimplemented in BankFiltered< Filter >.

void setEstimateThreshold ( u_int64_t  nbSeq)
inlinevirtual

Set the number of sequences read from the bank for computing estimated information

Parameters
[in]nbSeq: the number of sequences to be read.

Reimplemented from AbstractBank.


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