ParameterSetManager Class Reference

Class that manages a list of parameter sets. More...

#include <ParameterSetManager.h>

Collaboration diagram for ParameterSetManager:
Collaboration graph
[legend]

List of all members.

Public Member Functions

ParameterSetgetParameterSet (const int seq1Len, const int seq2Len)
 Gets the appropriate parameter set for the given sequence lengths.
int getMaxFrameSize ()
 Gets the maximum possible frame size over all parameter sets.
void addParameterSet (ParameterSet *p)
 Adds a parameter set to the parameter set manager.
virtual ~ParameterSetManager ()
 The destructor.

Static Public Member Functions

static ParameterSetManagergetParameterSetManager ()
 Get a pointer to the instance of the parameter set manager.
static void setupParameters (int t1=20, int u1=4, int ws1=4, int t2=30, int u2=6, int ws2=8, int t3=40, int u3=8, int ws3=8)
 Set up the parameter set manager.

Private Member Functions

 ParameterSetManager ()
 The constructor.

Private Attributes

std::vector< ParameterSet * > parameterSets
 The vector containing the list of parameter sets.

Static Private Attributes

static ParameterSetManagerptrInstance = NULL
 The pointer to the singleton instance of this class.

Detailed Description

Class that manages a list of parameter sets.

This class represents a list of parameter sets that analyzers and heuristics can access to obtain appropriate parameters for analysis of sequences with varying characteristics, typically length. The class initializes the appropriate parameter sets and provides the necessary parameter values when requested.

Definition at line 49 of file ParameterSetManager.h.


Constructor & Destructor Documentation

ParameterSetManager::~ParameterSetManager (  )  [virtual]

The destructor.

The destructor frees up all the parameter sets added to this parameter set manager.

Definition at line 70 of file ParameterSetManager.cpp.

References parameterSets.

ParameterSetManager::ParameterSetManager (  )  [private]

The constructor.

This is made private because the parameter set manager is a singleton, and should only be instantiated from the getParameterSetManager() static method.

Definition at line 66 of file ParameterSetManager.cpp.


Member Function Documentation

void ParameterSetManager::addParameterSet ( ParameterSet p  ) 

Adds a parameter set to the parameter set manager.

Definition at line 62 of file ParameterSetManager.cpp.

References parameterSets.

Referenced by setupParameters().

int ParameterSetManager::getMaxFrameSize (  ) 

Gets the maximum possible frame size over all parameter sets.

Returns:
the maximum possible frame size, an integer

Definition at line 98 of file ParameterSetManager.cpp.

References parameterSets.

Referenced by TwoPassD2::initialize(), and TVHeuristic::initialize().

ParameterSet * ParameterSetManager::getParameterSet ( const int  seq1Len,
const int  seq2Len 
)

Gets the appropriate parameter set for the given sequence lengths.

Returns:
The parameter set that should be used; NULL if the sequence lengths are too different to be compared.

Definition at line 78 of file ParameterSetManager.cpp.

References parameterSets.

Referenced by TwoPassD2::updateParameters(), and TVHeuristic::updateParameters().

static ParameterSetManager* ParameterSetManager::getParameterSetManager (  )  [inline, static]

Get a pointer to the instance of the parameter set manager.

Since this class is a singleton, the constructor is private and the only way to obtain an instance of the class is through this method. The parameter set manager is available only after the setupParameters method (that is invoked from main right after command line arguments are validated) has successfully completed its operation. Until such time this method simply returns NULL.

Returns:
The process-wide unique pointer to the parameter set manager.

Definition at line 81 of file ParameterSetManager.h.

References ptrInstance.

Referenced by TwoPassD2::initialize(), TVHeuristic::initialize(), TwoPassD2::updateParameters(), and TVHeuristic::updateParameters().

void ParameterSetManager::setupParameters ( int  t1 = 20,
int  u1 = 4,
int  ws1 = 4,
int  t2 = 30,
int  u2 = 6,
int  ws2 = 8,
int  t3 = 40,
int  u3 = 8,
int  ws3 = 8 
) [static]

Set up the parameter set manager.

Initializes the parameter set list to default values. The default is for 3 parameter sets, one for each of the following "classes" of sequences: Short - 0 to 150 bases (but in practice it is 50 to 150, as the LengthFilter will filter out sequences of fewer than 50 bases length) Medium - 150 to 400 bases Long - 400 to (no limit) bases

In the future this class should incorporate command-line arguments and customizability for the parameter sets.

Definition at line 44 of file ParameterSetManager.cpp.

References addParameterSet(), ASSERT, and ptrInstance.

Referenced by main().


Member Data Documentation

The vector containing the list of parameter sets.

Definition at line 124 of file ParameterSetManager.h.

Referenced by addParameterSet(), getMaxFrameSize(), getParameterSet(), and ~ParameterSetManager().

The pointer to the singleton instance of this class.

Again, this is made private so that only methods of this class can access it. The getParameterSetManager() method in this class must be used to obtain an instance of this class.

Definition at line 132 of file ParameterSetManager.h.

Referenced by getParameterSetManager(), and setupParameters().


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

Generated on 19 Mar 2010 for PEACE by  doxygen 1.6.1