gatb.core-API-0.0.0
CountProcessorChain< span > Class Template Reference

#include <CountProcessorChain.hpp>

Inheritance diagram for CountProcessorChain< span >:
Inheritance graph

Public Member Functions

 CountProcessorChain (const std::vector< CountProcessor * > items, std::vector< bool > &solidVec)
 
 CountProcessorChain (CountProcessor *first,...)
 
virtual ~CountProcessorChain ()
 
void begin (const Configuration &config)
 
void end ()
 
CountProcessorAbstract< span > * clone ()
 
void finishClones (std::vector< ICountProcessor< span > * > &clones)
 
void beginPart (size_t passId, size_t partId, size_t cacheSize, const char *name)
 
void endPart (size_t passId, size_t partId)
 
bool process (size_t partId, const Type &kmer, const CountVector &count, CountNumber sum=0)
 
tools::misc::impl::Properties getProperties () const
 
std::vector< CountProcessor * > getInstances () const
 
- Public Member Functions inherited from CountProcessorAbstract< span >
 CountProcessorAbstract (const std::string &name="processor")
 
virtual ~CountProcessorAbstract ()
 
virtual void beginPass (size_t passId)
 
virtual void endPass (size_t passId)
 
virtual std::string getName () const
 
virtual void setName (const std::string &name)
 
- Public Member Functions inherited from ICountProcessor< span >
template<typename T >
T * get () const
 
- Public Member Functions inherited from SmartPointer
void use ()
 
void forget ()
 
- Public Member Functions inherited from ISmartPointer
virtual ~ISmartPointer ()
 

Protected Member Functions

CountNumber computeSum (const CountVector &count) const
 
- Protected Member Functions inherited from SmartPointer
 SmartPointer ()
 
virtual ~SmartPointer ()
 

Additional Inherited Members

- Public Types inherited from CountProcessorAbstract< span >
typedef Kmer< span >::Type Type
 
- Public Types inherited from ICountProcessor< span >
typedef kmer::impl::Kmer< span >::Type Type
 

Detailed Description

template<size_t span = KMER_DEFAULT_SPAN>
class gatb::core::kmer::impl::CountProcessorChain< span >

The CountProcessorChain implementation allows to link several instances of ICountProcessor. When such an instance is called via 'process', the first item of the list is called via 'process'; if it returns true, the next item in the list is called and so on; if it returns false, the chain is stopped. This class is used for the definition of the "DSK" count processor (histogram -> solidity -> dump)

Constructor & Destructor Documentation

CountProcessorChain ( const std::vector< CountProcessor * >  items,
std::vector< bool > &  solidVec 
)
inline

Constructor.

CountProcessorChain ( CountProcessor first,
  ... 
)
inline

Constructor.

virtual ~CountProcessorChain ( )
inlinevirtual

Destructor.

Member Function Documentation

void begin ( const Configuration &  config)
inlinevirtual

Called just before the mainloop of SortingCountAlgorithm.

Parameters
[in]config: configuration of the SortingCountAlgorithm.

Reimplemented from CountProcessorAbstract< span >.

void beginPart ( size_t  passId,
size_t  partId,
size_t  cacheSize,
const char *  name 
)
inlinevirtual

Called at the beginning of a new kmers partition processing.

Parameters
[in]passId: index of the current pass in the SortingCountAlgorithm.
[in]passId: index of the current kmers partition in the SortingCountAlgorithm.
[in]cacheSize: memory size used for the current kmers partition
[in]name: class name of the child PartitionsCommand class.

Reimplemented from CountProcessorAbstract< span >.

CountProcessorAbstract<span>* clone ( )
inlinevirtual

Clone the instance. An instance can be cloned N times in order to use the cloned instance in one thread.

Returns
the cloned instance.

Implements ICountProcessor< span >.

CountNumber computeSum ( const CountVector count) const
inlineprotected

void end ( )
inlinevirtual

Called just after the mainloop of SortingCountAlgorithm.

Reimplemented from CountProcessorAbstract< span >.

void endPart ( size_t  passId,
size_t  partId 
)
inlinevirtual

Called at the end of a new kmers partition processing.

Parameters
[in]passId: index of the current pass in the SortingCountAlgorithm.
[in]passId: index of the current kmers partition in the SortingCountAlgorithm.

Reimplemented from CountProcessorAbstract< span >.

void finishClones ( std::vector< ICountProcessor< span > * > &  clones)
inlinevirtual

Called when N partitions have been processed through N clones. This should be the last time these clones are available before being deleted. It can be the opportunity to the prototype instance to gather information from the clones.

Parameters
[in]clones: the N cloned instances

Reimplemented from CountProcessorAbstract< span >.

std::vector<CountProcessor*> getInstances ( ) const
inlinevirtual

Get a vector of instances in case of the current object is a composite.

Returns
a vector of ICountProcessor instance.

Reimplemented from CountProcessorAbstract< span >.

tools::misc::impl::Properties getProperties ( ) const
inlinevirtual

Get some properties about the count processor.

Returns
properties.

Reimplemented from CountProcessorAbstract< span >.

bool process ( size_t  partId,
const Type kmer,
const CountVector count,
CountNumber  sum = 0 
)
inlinevirtual

Notification that a [kmer,counts] is available and can be handled by the count processor.

Parameters
[in]partId: index of the current partition
[in]kmer: kmer for which we are receiving counts
[in]count: vector of counts of the kmer, one count per bank
[in]sum: sum of the occurrences for all bank.

Reimplemented from CountProcessorAbstract< span >.


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