MASA-Core
Public Member Functions | Protected Member Functions | Static Protected Member Functions | Private Attributes
AbstractAlignerParameters Class Reference

Detailed Description

The customized parameters of a MASA Extension, used for receiving, manipulating and customizing command line parameters.

The AbstractAlignerParameters class implements the basic operations of the IAlignerParameter. Extend this class to implement Aligner specific parameters.

See also:
IAlignerParameter
GNU getopt C library (External link)

Definition at line 39 of file AbstractAlignerParameters.hpp.

#include <AbstractAlignerParameters.hpp>

Inheritance diagram for AbstractAlignerParameters:
IAlignerParameters BlockAlignerParameters

List of all members.

Public Member Functions

 AbstractAlignerParameters ()
 Constructor.
virtual ~AbstractAlignerParameters ()
 Destructor.
virtual const char * getLastError () const
 Returns the last error defined by the AbstractAlignerParameters::setLastError method.
virtual int getForkId () const
 Returns the Id of the forked process.
virtual void setForkId (int forkId)
 Defines the Id of the forked process.

Protected Member Functions

void setForkCount (const int forkCount, const int *forkWeights=NULL)
 Defines the number of processes that may be forked using the "--fork" command line parameter.
void setLastError (const char *error)
 Defines the error during the execution of the AbstractAlignerParameters::processArgument method.

Static Protected Member Functions

static void printFormattedUsage (const char *header, const char *text)
 Prints the usage text in the command line.
static int callGetOpt (int argc, char **argv, option *arguments)
 Process the arguments using the optarg library.

Private Attributes

char lastError [500]
 The last error.
int forkId
 The Id of this forked process.
const option * arguments
 Arguments passed to the getopt library.

Constructor & Destructor Documentation

Constructor.

Initializes the inner structures of the object.

Definition at line 30 of file AbstractAlignerParameters.cpp.

Destructor.

Destruct the allocated structures.

Definition at line 37 of file AbstractAlignerParameters.cpp.


Member Function Documentation

int AbstractAlignerParameters::callGetOpt ( int  argc,
char **  argv,
option *  arguments 
) [static, protected]

Process the arguments using the optarg library.

Definition at line 58 of file AbstractAlignerParameters.cpp.

int AbstractAlignerParameters::getForkId ( ) const [virtual]

Returns the Id of the forked process.

Returns:
the Id of the forked process, from 0 to n-1 (where n is the number of forked process), or NOT_FORKED_INSTANCE (-1) if no process was forked.

Implements IAlignerParameters.

Definition at line 72 of file AbstractAlignerParameters.cpp.

const char * AbstractAlignerParameters::getLastError ( ) const [virtual]

Returns the last error defined by the AbstractAlignerParameters::setLastError method.

Returns:
the last error string.

Implements IAlignerParameters.

Definition at line 43 of file AbstractAlignerParameters.cpp.

void AbstractAlignerParameters::printFormattedUsage ( const char *  header,
const char *  text 
) [static, protected]

Prints the usage text in the command line.

Parameters:
headerThe highlighted header of the help section that will contain the customized usage string.
textThe string containing the help text that will be shown to the user.

Definition at line 50 of file AbstractAlignerParameters.cpp.

void AbstractAlignerParameters::setForkCount ( const int  forkCount,
const int *  forkWeights = NULL 
) [protected]

Defines the number of processes that may be forked using the "--fork" command line parameter.

Parameters:
forkCountthe maximum number of forked processes.
forkWeightsThe weight of each processed used in the split procedure. set to NULL to consider equal weights.
void AbstractAlignerParameters::setForkId ( int  forkId) [virtual]

Defines the Id of the forked process.

Parameters:
forkIdthe unique Id of this forked process.

Implements IAlignerParameters.

Definition at line 79 of file AbstractAlignerParameters.cpp.

void AbstractAlignerParameters::setLastError ( const char *  error) [protected]

Defines the error during the execution of the AbstractAlignerParameters::processArgument method.

Parameters:
errorThe string containing the argument error.

Definition at line 86 of file AbstractAlignerParameters.cpp.


Member Data Documentation

const option* AbstractAlignerParameters::arguments [private]

Arguments passed to the getopt library.

Definition at line 99 of file AbstractAlignerParameters.hpp.

The Id of this forked process.

Definition at line 96 of file AbstractAlignerParameters.hpp.

The last error.

Definition at line 93 of file AbstractAlignerParameters.hpp.


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