Entropy Piano Tuner  1.1.3 (documentation not yet complete)
An open-source experimental software for piano tuning by entropy minimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
CalculationManager Class Reference

Calculation-Manager. More...

#include <calculationmanager.h>

Public Member Functions

virtual ~CalculationManager ()
 
void start (const std::string &algorithmName, const Piano &piano)
 Start the calculation thread. By calling this function, the current piano is passed by reference and copied to the local mPiano member variable. More...
 
void stop ()
 Stop the calculation thread. More...
 
void registerFactory (const std::string &name, AlgorithmFactoryBase *factory)
 
const std::map< std::string,
AlgorithmFactoryBase * > & 
getAlgorithms () const
 
AlgorithmFactoryDescriptiongetAlgorithmDescription (const std::string &algorithmName) const
 
std::shared_ptr< const
AlgorithmInformation
loadAlgorithmInformation (const std::string &algorithmName) const
 
bool hasAlgorithm (const std::string &id) const
 
std::string getDefaultAlgorithmId () const
 

Static Public Member Functions

static CalculationManagergetSingleton ()
 

Private Member Functions

 CalculationManager ()
 Constructor, resets member variables. More...
 

Private Attributes

std::map< std::string,
AlgorithmFactoryBase * > 
mAlgorithms
 
std::unique_ptr< AlgorithmmCurrentAlgorithm
 

Detailed Description

Calculation-Manager.

This class coordinates the calculation process. The calculation process runs in an independent thread. By calling start, a local copy of the entire piano is instantated. The calculation process manipulates the local copy but it does not return it directly. Instead the whole communication with the tuner is realized in terms of messages. In particular, each change of the tuning curve is communicated by a message.

The calculation manager is a singleton class.

Definition at line 52 of file calculationmanager.h.

Constructor & Destructor Documentation

CalculationManager::CalculationManager ( )
private

Constructor, resets member variables.

Definition at line 46 of file calculationmanager.cpp.

CalculationManager::~CalculationManager ( )
virtual

Definition at line 50 of file calculationmanager.cpp.

+ Here is the call graph for this function:

Member Function Documentation

AlgorithmFactoryDescription & CalculationManager::getAlgorithmDescription ( const std::string &  algorithmName) const

Definition at line 118 of file calculationmanager.cpp.

+ Here is the call graph for this function:

const std::map<std::string, AlgorithmFactoryBase*>& CalculationManager::getAlgorithms ( ) const
inline

Definition at line 67 of file calculationmanager.h.

std::string CalculationManager::getDefaultAlgorithmId ( ) const

Definition at line 138 of file calculationmanager.cpp.

+ Here is the call graph for this function:

CalculationManager & CalculationManager::getSingleton ( )
static

Definition at line 56 of file calculationmanager.cpp.

bool CalculationManager::hasAlgorithm ( const std::string &  id) const

Definition at line 134 of file calculationmanager.cpp.

std::shared_ptr< const AlgorithmInformation > CalculationManager::loadAlgorithmInformation ( const std::string &  algorithmName) const

Definition at line 127 of file calculationmanager.cpp.

+ Here is the call graph for this function:

void CalculationManager::registerFactory ( const std::string &  name,
AlgorithmFactoryBase factory 
)

Definition at line 102 of file calculationmanager.cpp.

void CalculationManager::start ( const std::string &  algorithmName,
const Piano piano 
)

Start the calculation thread. By calling this function, the current piano is passed by reference and copied to the local mPiano member variable.

Parameters
piano: Reference to the piano instance.

Definition at line 71 of file calculationmanager.cpp.

+ Here is the call graph for this function:

void CalculationManager::stop ( )

Stop the calculation thread.

Definition at line 94 of file calculationmanager.cpp.

Member Data Documentation

std::map<std::string, AlgorithmFactoryBase*> CalculationManager::mAlgorithms
private

Definition at line 74 of file calculationmanager.h.

std::unique_ptr<Algorithm> CalculationManager::mCurrentAlgorithm
private

Definition at line 75 of file calculationmanager.h.


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