COPASI API
4.40.278
|
#include <CCopasiMessage.h>
Public Types | |
enum | Type { RAW = 0 , TRACE = 1 , COMMANDLINE = 2 , WARNING = 3 , ERROR = 4 , EXCEPTION = 5 , RAW_FILTERED = 128 , TRACE_FILTERED = 129 , COMMANDLINE_FILTERED = 130 , WARNING_FILTERED = 131 , ERROR_FILTERED = 132 , EXCEPTION_FILTERED = 133 } |
Public Member Functions | |
CCopasiMessage () | |
CCopasiMessage (const CCopasiMessage &src) | |
CCopasiMessage (Type type, const char *format,...) | |
CCopasiMessage (Type type, size_t number,...) | |
const size_t & | getNumber () const |
const std::string & | getText () const |
const CCopasiMessage::Type & | getType () const |
CCopasiMessage & | operator= (const CCopasiMessage &RHS) |
~CCopasiMessage () | |
Static Public Member Functions | |
static bool | checkForMessage (const size_t &number) |
static void | clearDeque () |
static std::string | getAllMessageText (const bool &chronological=true) |
static CCopasiMessage | getFirstMessage () |
static CCopasiMessage::Type | getHighestSeverity () |
static CCopasiMessage | getLastMessage () |
static const CCopasiMessage & | peekFirstMessage () |
static const CCopasiMessage & | peekLastMessage () |
static void | setIsGUI (const bool &isGUI) |
static size_t | size () |
Private Member Functions | |
void | handler (const bool &_throw=false) |
void | lineBreak () |
Private Attributes | |
size_t | mNumber |
std::string | mText |
CCopasiMessage::Type | mType |
Static Private Attributes | |
static bool | IsGUI = false |
static std::deque< CCopasiMessage > | mMessageDeque |
enum CCopasiMessage::Type |
CCopasiMessage::CCopasiMessage | ( | void | ) |
Default constructor. This creates a default error messages, which actually does nothing.
Referenced by getAllMessageText(), getFirstMessage(), getLastMessage(), peekFirstMessage(), and peekLastMessage().
CCopasiMessage::CCopasiMessage | ( | const CCopasiMessage & | src | ) |
Copy constructor.
const | CCopasiMessage & src |
CCopasiMessage::CCopasiMessage | ( | CCopasiMessage::Type | type, |
const char * | format, | ||
... | |||
) |
Specified constructor. This creates a formated message.
CCopasiMessage::Type | type (RAW|TRACE|WARNING|ERROR) |
const | char * format (printf like format string) |
... | arguments like in printf |
References C_INT32, handler(), INITIALTEXTSIZE, mNumber, mText, and mType.
CCopasiMessage::CCopasiMessage | ( | CCopasiMessage::Type | type, |
size_t | number, | ||
... | |||
) |
Specified constructor. This creates a formated message.
CCopasiMessage::Type | type (RAW|TRACE|WARNING|ERROR) |
size_t | number (message number see message.h) |
... | arguments like in printf |
References C_INT32, fatalError, handler(), INITIALTEXTSIZE, Messages, mNumber, mText, and mType.
CCopasiMessage::~CCopasiMessage | ( | void | ) |
Destructor.
|
static |
Check whether a message with the given number is in the dequeue
const | size_t & number |
References mMessageDeque.
|
static |
This function clears the message stack.
References mMessageDeque.
Referenced by addMessagesToStream(), CDataModel::addModel(), CDataModel::exportCombineArchive(), CDataModel::exportMathModel(), CDataModel::exportSBML(), CDataModel::exportSBMLToString(), CDataModel::exportSEDML(), CDataModel::exportSEDMLToString(), CDataModel::exportShinyArchive(), CDataModel::importSBML(), CDataModel::importSBMLFromString(), CDataModel::importSEDML(), CDataModel::importSEDMLFromString(), CDataModel::loadModel(), CDataModel::saveModel(), and CDataModel::saveModelToString().
|
static |
Retrieve the text of all messages in the dequeue in chronological or reverse chronological order. If more than on message is in the dequeue the messages are separated by an empty line.
References CCopasiMessage(), getFirstMessage(), getLastMessage(), getText(), and mMessageDeque.
Referenced by addMessagesToStream(), CDataModel::exportSBML(), CDataModel::exportSBMLToString(), CDataModel::exportSEDML(), and CDataModel::exportSEDMLToString().
|
static |
This function retrieves the first message created in COPASI. Consecutive calls allow for the retrieval of all generated messages in chronological order. If no more messages are in the dequeue the message (MCCopasiMessage + 1, "Message (1): No more messages." is returned.
References CCopasiMessage(), MCCopasiMessage, mMessageDeque, and RAW.
Referenced by getAllMessageText().
|
static |
Retrieve highest severity of the messages in the dequeue.
References mMessageDeque, and RAW.
Referenced by addMessagesToStream(), and CFitProblem::initialize().
|
static |
This function retrieves the last message created in COPASI. Consecutive calls allow for the retrieval of all generated messages in reverse chronological order. If no more messages are in the dequeue the message (MCCopasiMessage + 1, "Message (1): No more messages." is returned.
References CCopasiMessage(), MCCopasiMessage, mMessageDeque, and RAW.
Referenced by COptProblem::calculate(), CScanMethod::calculate(), CFitProblem::calculate(), CFitProblem::calculateCrossValidation(), CDataModel::commonAfterLoad(), CModelParameter::compile(), CExpression::createInitialExpression(), getAllMessageText(), handler(), CMathDependencyGraph::hasCircularDependencies(), CFitProblem::initialize(), CAnnotation::isValidXML(), CFunctionDB::load(), CModel::load(), CCopasiXML::mergeUnitDefinitions(), CDataModel::openCombineArchive(), CMoietiesTask::process(), AssignmentHandler::processEnd(), CompartmentHandler::processEnd(), COPASIHandler::processEnd(), EventHandler::processEnd(), FunctionHandler::processEnd(), MetaboliteHandler::processEnd(), ModelHandler::processEnd(), ModelParameterHandler::processEnd(), ModelValueHandler::processEnd(), ReactionHandler::processEnd(), UnitDefinitionHandler::processEnd(), ModelHandler::processStart(), and CRDFGraphConverter::SBML2Copasi().
const size_t & CCopasiMessage::getNumber | ( | void | ) | const |
Retrieves the number of the message.
References mNumber.
Referenced by CModel::load().
const std::string & CCopasiMessage::getText | ( | void | ) | const |
Retrieves the text of the message.
References mText.
Referenced by SBMLImporter::createCModelFromSBMLDocument(), getAllMessageText(), SBMLImporter::importEvent(), SBMLImporter::importEvents(), SBMLImporter::importFunctionDefinitions(), SBMLImporter::importInitialAssignments(), and main().
const CCopasiMessage::Type & CCopasiMessage::getType | ( | void | ) | const |
|
private |
The actual constructor of a message.
const | bool & throw (default: false) |
text | message text |
References COMMANDLINE, COMMANDLINE_FILTERED, COptions::compareValue(), ERROR, ERROR_FILTERED, EXCEPTION, EXCEPTION_FILTERED, getLastMessage(), IsGUI, lineBreak(), LocalTimeStamp(), MCCopasiMessage, mMessageDeque, mNumber, mText, mType, RAW, RAW_FILTERED, TRACE, TRACE_FILTERED, WARNING, and WARNING_FILTERED.
Referenced by CCopasiMessage().
|
private |
CCopasiMessage & CCopasiMessage::operator= | ( | const CCopasiMessage & | RHS | ) |
|
static |
This function peeks at the first message created in COPASI. If no more messages are in the dequeue the message (MCCopasiMessage + 1, "Message (1): No more messages." is returned.
References CCopasiMessage(), MCCopasiMessage, mMessageDeque, and RAW.
|
static |
This function peeks at the last message created in COPASI. If no more messages are in the dequeue the message (MCCopasiMessage + 1, "Message (1): No more messages." is returned.
References CCopasiMessage(), MCCopasiMessage, mMessageDeque, and RAW.
Referenced by SBMLImporter::createCModelFromSBMLDocument(), SBMLImporter::importEvent(), SBMLImporter::importEvents(), SBMLImporter::importFunctionDefinitions(), SBMLImporter::importInitialAssignments(), CFitProblem::initialize(), and CFunctionDB::load().
|
static |
Set whether the messages are created from COPASI as GUI or commandline. This method is called from CRootContainer::init and there should be no need to call it otherwise.
const | bool & isGUI |
References IsGUI.
Referenced by CRootContainer::init().
|
static |
Retrieve the size of the dequeue
References mMessageDeque.
Referenced by addMessagesToStream(), CDataModel::commonAfterLoad(), CModelParameter::compile(), CExpression::createInitialExpression(), CMathDependencyGraph::hasCircularDependencies(), CAnnotation::isValidXML(), CModel::load(), CCopasiXML::mergeUnitDefinitions(), CDataModel::openCombineArchive(), CMoietiesTask::process(), AssignmentHandler::processEnd(), CompartmentHandler::processEnd(), COPASIHandler::processEnd(), EventHandler::processEnd(), FunctionHandler::processEnd(), MetaboliteHandler::processEnd(), ModelHandler::processEnd(), ModelParameterHandler::processEnd(), ModelValueHandler::processEnd(), ReactionHandler::processEnd(), UnitDefinitionHandler::processEnd(), ModelHandler::processStart(), and CRDFGraphConverter::SBML2Copasi().
|
staticprivate |
A flag indicating whether the COPASI is running as commandline or GUI
Referenced by handler(), and setIsGUI().
|
staticprivate |
The stack of messages. Each message created with one of the specific constructors is automatically added to the stack.
Referenced by checkForMessage(), clearDeque(), getAllMessageText(), getFirstMessage(), getHighestSeverity(), getLastMessage(), handler(), peekFirstMessage(), peekLastMessage(), and size().
|
private |
Message Number
Referenced by CCopasiMessage(), getNumber(), handler(), and operator=().
|
private |
Message text.
Referenced by CCopasiMessage(), getText(), handler(), lineBreak(), and operator=().
|
private |
Message type.
Referenced by CCopasiMessage(), getType(), handler(), and operator=().