SHORE API
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
shore::buffer_chain< T > Class Template Reference

Base class for data sources that support adding plugin objects. More...

Inheritance diagram for shore::buffer_chain< T >:
shore::dp_aligner_pipe< shore::shore::dna_iterator, shore::shore::dna_iterator, typename dp_traits< typename std::iterator_traits< shore::shore::dna_iterator >::value_type, typename std::iterator_traits< shore::shore::dna_iterator >::value_type >::scoring_type > shore::dp_multialigner_pipe< shore::shore::dna_iterator > shore::monolithic< S, T, Cmp >

Public Types

typedef plugin< T > plugin_type
 

Public Member Functions

 buffer_chain ()
 Constructor - initialize empty buffer chain.
 
 ~buffer_chain ()
 Destructor - free all buffers.
 
void add_plugin (plugin_type *const p)
 Add a plugin object.
 
void clear_plugins ()
 Remove all plugin objects.
 

Protected Member Functions

bool buffer_chain_ready () const
 Check if there is an element ready to be retrieved.
 
T & buffer_chain_push ()
 Get an empty buffer.
 
bool buffer_chain_prepare ()
 Apply plugins after having initialized a new buffer.
 
bool buffer_chain_flush (const bool undo_last_push)
 Indicate that no more data will be added. More...
 
const T & buffer_chain_front () const
 Get the contents of the first buffer.
 
bool buffer_chain_waiting () const
 Check that the buffer chain is neither ready nor flushed.
 
bool buffer_chain_pop ()
 Discard the buffer holding the first element.
 
void buffer_chain_reset ()
 Clear all data and reset the state of the buffer chain.
 
T * buffer_chain_swap (T *buf)
 Exchange the last pushed buffer with an external one. More...
 

Detailed Description

template<typename T>
class shore::buffer_chain< T >

Base class for data sources that support adding plugin objects.

Member Function Documentation

template<typename T>
bool shore::buffer_chain< T >::buffer_chain_flush ( const bool  undo_last_push)
inlineprotected

Indicate that no more data will be added.

Parameters
undo_last_pushThe last buffer pushed could not be initialized, discard it.
template<typename T>
T* shore::buffer_chain< T >::buffer_chain_swap ( T *  buf)
inlineprotected

Exchange the last pushed buffer with an external one.

Parameters
bufPointer to a T object allocated on the heap.

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