StochHMM  v0.34
Flexible Hidden Markov Model C++ Library and Application
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Attributes
StochHMM::TrackFuncs Class Reference

Stores pointer to user functions used to create Real Number Tracks. More...

#include <userFunctions.h>

List of all members.

Public Member Functions

void assignFunction (std::string &, pt2TrackFunc)
pt2TrackFuncgetFunction (std::string &)

Private Attributes

std::map< std::string,
pt2TrackFunc
functions

Detailed Description

Stores pointer to user functions used to create Real Number Tracks.

Definition at line 109 of file userFunctions.h.


Member Function Documentation

void StochHMM::TrackFuncs::assignFunction ( std::string &  str,
pt2TrackFunc  ptrFunc 
)

Assign a function to the TrackFuncs class

Parameters:
strName of function
ptrFuncpt2TrackFunc to use for TrackFunc

Definition at line 284 of file userFunctions.cpp.

References functions.

{
if (functions.count(str)==0){
functions[str]=ptrFunc;
}
else{
std::cerr << "Function Name: " << str << " already exists. You need to choose a new function name that doesn't already exist. For reference here are a list of names already assigned as external functions\nAssigned Names:\n";
std::map<std::string,pt2TrackFunc>::iterator it;
for(it=functions.begin();it!=functions.end();it++){
std::cerr << "\t" << it->first <<std::endl;
}
}
};
pt2TrackFunc * StochHMM::TrackFuncs::getFunction ( std::string &  name)

Get pointer to function with given name

Parameters:
nameName of the function
Returns:
pt2TrackFunc*

Definition at line 305 of file userFunctions.cpp.

References functions.

{
if (functions.count(name)){
return &functions[name];
}
else{
std::cerr << "Function named: " << name << " was not initialized. " <<std::endl;
return NULL;
}
}

Member Data Documentation

std::map<std::string, pt2TrackFunc> StochHMM::TrackFuncs::functions
private

Definition at line 114 of file userFunctions.h.

Referenced by assignFunction(), and getFunction().


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