COPASI API
4.16.103
|
#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
Definition at line 34 of file CReadConfig.h.
enum CReadConfig::Mode |
Enumerator | |
---|---|
NEXT | |
SEARCH | |
LOOP | |
ALL |
Definition at line 39 of file CReadConfig.h.
|
private |
Default constructor. This creates a configuration buffer for input assigning a filename. It is currently useless.
Definition at line 34 of file CReadConfig.cpp.
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. |
Definition at line 44 of file CReadConfig.cpp.
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 |
Definition at line 58 of file CReadConfig.cpp.
CReadConfig::~CReadConfig | ( | void | ) |
Destructor. The destructor calls the method free().
Definition at line 68 of file CReadConfig.cpp.
C_INT32 CReadConfig::fail | ( | ) |
Returns the failure status.
Definition at line 71 of file CReadConfig.cpp.
References mFail.
void CReadConfig::getDefaults | ( | ) |
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. |
Definition at line 81 of file CReadConfig.cpp.
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(), CReadConfig(), getVariable(), CFunctionDB::load(), CCompartment::load(), CReaction::load(), CSteadyStateProblem::load(), CMCAProblem::load(), CLNAProblem::load(), CNewtonMethod::load(), CLNATask::load(), CMCATask::load(), CFunctionParameter::load(), CMCAMethod::load(), CTrajectoryProblem::load(), CModel::load(), CFunction::load(), CTrajectoryTask::load(), CSteadyStateTask::load(), CNodeK::load(), CMetab::load(), CMetabOld::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. |
Definition at line 249 of file CReadConfig.cpp.
References CCopasiMessage::ERROR, getVariable(), MCReadConfig, and mFail.
std::string CReadConfig::getVersion | ( | ) |
Retrieves the version string of the configbuffer
Definition at line 76 of file CReadConfig.cpp.
References mVersion.
Referenced by CSteadyStateProblem::load(), CLNAProblem::load(), CMCAProblem::load(), CNewtonMethod::load(), CTrajectoryProblem::load(), and CCopasiDataModel::loadModel().
|
private |
Initializes the input buffer for reading.
Definition at line 282 of file CReadConfig.cpp.
References CCopasiMessage::ERROR, CLocaleString::fromUtf8(), MCReadConfig, mFail, mFileBuffer, mFilename, and mpBuffer.
Referenced by CReadConfig().
|
private |
Look ahead to find the next variable name
Definition at line 324 of file CReadConfig.cpp.
References mpBuffer.
Referenced by getVariable().
void CReadConfig::rewind | ( | ) |
Rewind the buffer
Definition at line 336 of file CReadConfig.cpp.
References mLineNumber, and mpBuffer.
Referenced by getVariable().
|
private |
Failure status: 0 = no error !0 = error
Definition at line 87 of file CReadConfig.h.
Referenced by fail(), getVariable(), and initFileBuffer().
|
private |
A buffer for reading the file.
Definition at line 102 of file CReadConfig.h.
Referenced by initFileBuffer().
|
private |
Name of the configuration file.
Definition at line 97 of file CReadConfig.h.
Referenced by getVariable(), and initFileBuffer().
|
private |
Current line number in the configuration file
Definition at line 75 of file CReadConfig.h.
Referenced by getVariable(), and rewind().
|
private |
Mode = CReadConfig::SEARCH
Definition at line 80 of file CReadConfig.h.
|
private |
A pointer to the input buffer
Definition at line 70 of file CReadConfig.h.
Referenced by getVariable(), initFileBuffer(), lookAhead(), and rewind().
|
private |
Definition at line 92 of file CReadConfig.h.
Referenced by CReadConfig(), getVariable(), and getVersion().