Cantera  2.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Protected Attributes | List of all members
Application::Messages Class Reference

Class to carry out messages. More...

#include <application.h>

Collaboration diagram for Application::Messages:
[legend]

Public Member Functions

 Messages ()
 Constructor for the Messages class. More...
 
 Messages (const Messages &r)
 
Messagesoperator= (const Messages &r)
 
void addError (const std::string &r, const std::string &msg)
 Set an error condition in the application class without throwing an exception. More...
 
int getErrorCount ()
 Return the number of errors that have been encountered so far. More...
 
void popError ()
 Discard the last error message. More...
 
std::string lastErrorMessage ()
 Retrieve the last error message in a string. More...
 
void getErrors (std::ostream &f)
 Prints all of the error messages to an ostream. More...
 
void logErrors ()
 Prints all of the error messages using writelog. More...
 
void writelog (const std::string &msg)
 Write a message to the screen. More...
 
void writelogendl ()
 Write an end of line character to the screen and flush output. More...
 
void logerror (const std::string &msg)
 Write an error message and quit. More...
 
void setLogger (Logger *logwriter)
 Install a logger. More...
 

Protected Attributes

std::vector< std::string > errorMessage
 Current list of error messages. More...
 
std::vector< std::string > errorRoutine
 Current error Routine. More...
 
Loggerlogwriter
 Current pointer to the logwriter. More...
 

Detailed Description

Class to carry out messages.

Definition at line 44 of file application.h.

Constructor & Destructor Documentation

Messages ( )

Constructor for the Messages class.

Constructor for the Messages class which is a subclass of the Application class.

Definition at line 69 of file application.cpp.

References Application::Messages::logwriter.

Member Function Documentation

void writelogendl ( )

Write an end of line character to the screen and flush output.

Definition at line 137 of file application.cpp.

Referenced by Application::writelogendl().

void logerror ( const std::string &  msg)

Write an error message and quit.

The default behavior is to write to the standard error stream, and then call exit(). Note that no end-of-line character is appended to the message, and so if one is desired it must be included in the string. Note that this default behavior will terminate the application Cantera is invoked from (MATLAB, Excel, etc.) If this is not desired, then derive a class and reimplement this method.

Parameters
msgError message to be written to cerr.
Deprecated:
To be removed after Cantera 2.2

Definition at line 126 of file application.cpp.

References Cantera::warn_deprecated().

Referenced by Application::logerror().

Member Data Documentation

std::vector<std::string> errorMessage
protected

Current list of error messages.

Definition at line 164 of file application.h.

Referenced by Application::Messages::popError().

std::vector<std::string> errorRoutine
protected

Current error Routine.

Definition at line 167 of file application.h.

Referenced by Application::Messages::popError().

Logger* logwriter
protected

Current pointer to the logwriter.

Definition at line 170 of file application.h.

Referenced by Application::Messages::Messages().


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