gatb.core-API-0.0.0
Iterable< Item > Class Template Referenceabstract

Iterable interface. More...

#include <Iterable.hpp>

Inheritance diagram for Iterable< Item >:
Inheritance graph

Public Member Functions

virtual dp::Iterator< Item > * iterator ()=0
 
template<typename Functor >
void iterate (Functor f)
 
virtual int64_t getNbItems ()=0
 
virtual int64_t estimateNbItems ()=0
 
virtual Item * getItems (Item *&buffer)
 
virtual size_t getItems (Item *&buffer, size_t start, size_t nb)
 
- Public Member Functions inherited from ISmartPointer
virtual ~ISmartPointer ()
 
virtual void use ()=0
 
virtual void forget ()=0
 

Detailed Description

template<class Item>
class gatb::core::tools::collections::Iterable< Item >

Iterable interface.

The Iterable interface provides an operation that creates an iterator. It also provides other methods that give the exact number (or an estimation) of items.

Note that one Iterable instance can create several iterators.

Member Function Documentation

virtual int64_t estimateNbItems ( )
pure virtual

Return the (approximate) 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.

Implemented in Partition< Type >, Partition< gatb::core::kmer::impl::Kmer::Count >, IterableFile< Item >, IBank, IterableAdaptor< T1, T2, Adaptor >, BankDelegate, CollectionAbstract< Item >, and AbstractBank.

virtual Item* getItems ( Item *&  buffer)
inlinevirtual

Return a buffer of items.

Parameters
[out]buffer: the buffer
Returns
the buffer

Reimplemented in IterableFile< Item >, IterableAdaptor< T1, T2, Adaptor >, and CollectionAbstract< Item >.

virtual size_t getItems ( Item *&  buffer,
size_t  start,
size_t  nb 
)
inlinevirtual

Return a buffer of items.

Parameters
[out]buffer: the buffer
[in]start: index where to start in the buffer
[in]nb: number of items to be retrieved
Returns
the number of items retrieved

Reimplemented in IterableFile< Item >, IterableAdaptor< T1, T2, Adaptor >, and CollectionAbstract< Item >.

virtual int64_t getNbItems ( )
pure virtual

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.

Implemented in Partition< Type >, Partition< gatb::core::kmer::impl::Kmer::Count >, IterableFile< Item >, BankComposite, IterableAdaptor< T1, T2, Adaptor >, BankDelegate, BankBinary, BankFasta, BankStrings, CollectionAbstract< Item >, BankSplitter, BankRandom, and BankKmers.

void iterate ( Functor  f)
inline

Direct iteration through a functor.

Parameters
[in]f: the functor to be applied on each sequence of the bank.

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