|
COPASI API
4.40.278
|
#include <CReadConfig.h>
Public Types | |
| enum | Mode { NEXT = 0 , SEARCH , LOOP , ALL } |
Public Member Functions | |
| CReadConfig (const std::string &name) | |
| CReadConfig (std::istream &in) | |
| C_INT32 | fail () |
| void | getDefaults () |
| C_INT32 | getVariable (const std::string &name, const std::string &type, void *pout, CReadConfig::Mode mode=CReadConfig::NEXT) |
| C_INT32 | getVariable (const std::string &name, const std::string &type, void *pout1, void *pout2, CReadConfig::Mode mode=CReadConfig::NEXT) |
| std::string | getVersion () |
| void | rewind () |
| ~CReadConfig () | |
Private Member Functions | |
| CReadConfig () | |
| C_INT32 | initFileBuffer () |
| std::string | lookAhead () |
Private Attributes | |
| C_INT32 | mFail |
| std::stringstream | mFileBuffer |
| std::string | mFilename |
| C_INT32 | mLineNumber |
| CReadConfig::Mode | mMode |
| std::istream * | mpBuffer |
| std::string | mVersion |
CReadConfig class. A more elaborate class description. New Class based on pmutils read functionality
(C) Stefan Hoops 2001
| enum CReadConfig::Mode |
|
private |
Default constructor. This creates a configuration buffer for input assigning a filename. It is currently useless.
| CReadConfig::CReadConfig | ( | const std::string & | name | ) |
Specified constructor. This opens the configuration file using the filename specified as the argument.
| name | name of the configuration file. |
References getVariable(), initFileBuffer(), and mVersion.
| CReadConfig::CReadConfig | ( | std::istream & | in | ) |
Specified constructor. This opens the configuration file using the filename specified as the argument.
| std::istream | & in |
| CReadConfig::~CReadConfig | ( | void | ) |
Destructor. The destructor calls the method free().
| C_INT32 CReadConfig::fail | ( | ) |
| void CReadConfig::getDefaults | ( | ) |
Load various system wide default values
| C_INT32 CReadConfig::getVariable | ( | const std::string & | name, |
| const std::string & | type, | ||
| void * | pout, | ||
| CReadConfig::Mode | mode = CReadConfig::NEXT |
||
| ) |
Retrieves a variable from the input file.
| name | name of the variable to be retrieved. |
| type | type of the variable to be retrieved. |
| *pout | pointer to the location where the retrieved variable is stored. |
References ALL, C_FLOAT64, C_INT16, C_INT32, CCopasiMessage::ERROR, CCopasiMessage::EXCEPTION, lookAhead(), LOOP, MCReadConfig, mFail, mFilename, mLineNumber, mpBuffer, mVersion, rewind(), SEARCH, and strToDouble().
Referenced by CKinFunction::CKinFunction(), CDataModel::contentType(), CReadConfig(), getVariable(), CFunctionDB::load(), CNodeK::load(), CLNATask::load(), CCompartment::load(), CMetab::load(), CMetabOld::load(), CModel::load(), CReaction::load(), CMCAMethod::load(), CMCATask::load(), CSteadyStateTask::load(), CTrajectoryTask::load(), CFunctionParameter::load(), CLNAProblem::load(), CMCAProblem::load(), CSteadyStateProblem::load(), CTrajectoryProblem::load(), CFunction::load(), CNewtonMethod::load(), CReaction::loadOld(), and CReaction::loadOneRole().
| C_INT32 CReadConfig::getVariable | ( | const std::string & | name, |
| const std::string & | type, | ||
| void * | pout1, | ||
| void * | pout2, | ||
| CReadConfig::Mode | mode = CReadConfig::NEXT |
||
| ) |
Retrieves a variable from the input file.
| name | name of the variable to be retrieved. |
| type | type of the variable to be retrieved. |
| *pout1 | pointer to the location where the first part of the retrieved variable is stored. |
| *pout2 | pointer to the location where the second part of the retrieved variable is stored. |
References CCopasiMessage::ERROR, getVariable(), MCReadConfig, and mFail.
| std::string CReadConfig::getVersion | ( | ) |
Retrieves the version string of the configbuffer
References mVersion.
Referenced by CLNAProblem::load(), CMCAProblem::load(), CSteadyStateProblem::load(), CTrajectoryProblem::load(), CNewtonMethod::load(), and CDataModel::loadModel().
|
private |
Initializes the input buffer for reading.
References CCopasiMessage::ERROR, CLocaleString::fromUtf8(), MCReadConfig, mFail, mFileBuffer, mFilename, and mpBuffer.
Referenced by CReadConfig().
|
private |
| void CReadConfig::rewind | ( | ) |
|
private |
Failure status: 0 = no error !0 = error
Referenced by fail(), getVariable(), and initFileBuffer().
|
private |
A buffer for reading the file.
Referenced by initFileBuffer().
|
private |
Name of the configuration file.
Referenced by getVariable(), and initFileBuffer().
|
private |
Current line number in the configuration file
Referenced by getVariable(), and rewind().
|
private |
Mode = CReadConfig::SEARCH
|
private |
A pointer to the input buffer
Referenced by getVariable(), initFileBuffer(), lookAhead(), and rewind().
|
private |
Referenced by CReadConfig(), getVariable(), and getVersion().