gatb.core-API-0.0.0
Algorithm Class Referenceabstract

Framework class for implementing algorithm. More...

#include <Algorithm.hpp>

Inheritance diagram for Algorithm:
Inheritance graph

Public Member Functions

 Algorithm (const std::string &name, int nbCores=-1, gatb::core::tools::misc::IProperties *input=0)
 
virtual ~Algorithm ()
 
std::string getName () const
 
void run ()
 
virtual void execute ()=0
 
virtual IPropertiesgetInput ()
 
virtual IPropertiesgetOutput ()
 
virtual IPropertiesgetInfo ()
 
virtual dp::IDispatchergetDispatcher ()
 
virtual TimeInfogetTimeInfo ()
 
virtual IPropertiesgetSystemInfo ()
 
template<typename Item >
dp::Iterator< Item > * createIterator (dp::Iterator< Item > *iter, size_t nbIterations=0, const char *message=0, dp::IteratorListener *listener=0)
 
virtual dp::IteratorListenercreateIteratorListener (size_t nbIterations, const char *message)
 
- Public Member Functions inherited from SmartPointer
void use ()
 
void forget ()
 
- Public Member Functions inherited from ISmartPointer
virtual ~ISmartPointer ()
 

Static Public Member Functions

template<template< size_t > class Functor>
static int mainloop (tools::misc::IOptionsParser *parser, int argc, char *argv[])
 

Protected Member Functions

std::string getUriByKey (const std::string &key)
 
std::string getUri (const std::string &str)
 
void setInput (IProperties *input)
 
- Protected Member Functions inherited from SmartPointer
 SmartPointer ()
 
virtual ~SmartPointer ()
 

Detailed Description

Framework class for implementing algorithm.

See also
Tool

Constructor & Destructor Documentation

Algorithm ( const std::string &  name,
int  nbCores = -1,
gatb::core::tools::misc::IProperties input = 0 
)

Constructor.

Parameters
[in]namename of the algorithm.
[in]nbCores: number of cores to be used for this algorithm.
[in]input: extra options for configuring the algorithm.
~Algorithm ( )
virtual

Destructor.

Member Function Documentation

dp::Iterator<Item>* createIterator ( dp::Iterator< Item > *  iter,
size_t  nbIterations = 0,
const char *  message = 0,
dp::IteratorListener listener = 0 
)
inline

Create an iterator for the given iterator. If the verbosity is enough, progress bar information can be displayed.

Parameters
[in]iter: object to be encapsulated by a potential progress information
[in]nbIterations: number of iterations to be done.
[in]message: message used if progress information has to be displayed
[in]listener: listener to be used; if null, a new one is created
Returns
the created iterator.
dp::IteratorListener * createIteratorListener ( size_t  nbIterations,
const char *  message 
)
virtual

Creates an iterator listener according to the verbosity level.

Parameters
[in]nbIterations: number of iterations to be done
[in]message: progression message
Returns
an iterator listener.
virtual void execute ( )
pure virtual
virtual dp::IDispatcher* getDispatcher ( )
inlinevirtual

Get an option parser configured with recognized options for the tool

Returns
the options parser instance
virtual IProperties* getInfo ( )
inlinevirtual

Get statistics information about the execution of the tool

Returns
the statistics
virtual IProperties* getInput ( )
inlinevirtual

Get the parsed options as a properties instance

Returns
the parsed options.
std::string getName ( ) const
inline

Get tool name

Returns
the algorithm name.
virtual IProperties* getOutput ( )
inlinevirtual

Get output results as a properties instance

Returns
the output results
virtual IProperties* getSystemInfo ( )
inlinevirtual

Get information about operating system resources used during the execution.

Returns
operating system information.
virtual TimeInfo& getTimeInfo ( )
inlinevirtual

Get a TimeInfo instance for the tool. This object can be used for gathering execution times of some parts of the execute method.

Returns
the time info instance.
std::string getUri ( const std::string &  str)
inlineprotected

Computes the uri from an uri (ie add a prefix if any).

std::string getUriByKey ( const std::string &  key)
inlineprotected

Computes the uri from an uri (ie add a prefix if any).

static int mainloop ( tools::misc::IOptionsParser parser,
int  argc,
char *  argv[] 
)
inlinestatic

Utility function for easily running a kmers based algorithms. It ensures that the correct instance of the provided functor is launched, according to the kmer size (known at runtime).

void run ( )

Run the algorithm, ie. call 'execute'.

void setInput ( IProperties input)
inlineprotected

Setters.


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