2 #ifndef CT_BASE_APPLICATION_H
3 #define CT_BASE_APPLICATION_H
5 #include "cantera/base/config.h"
70 void addError(
const std::string& r,
const std::string& msg);
136 void writelog(
const std::string& msg);
152 void logerror(
const std::string& msg) ;
165 #ifdef WITH_HTML_LOGS
191 void addLogEntry(
const std::string& tag,
const std::string& value) ;
203 void addLogEntry(
const std::string& tag, doublereal value) ;
215 void addLogEntry(
const std::string& tag,
int value) ;
268 #ifdef WITH_HTML_LOGS
286 #ifdef THREAD_SAFE_CANTERA
340 void addError(
const std::string& r,
const std::string& msg) {
425 long int readStringRegistryKey(
const std::string& keyName,
const std::string& valueName,
426 std::string& value,
const std::string& defaultValue);
448 void warn_deprecated(
const std::string& method,
const std::string& extra=
"");
453 m_suppress_deprecation_warnings =
true;
470 #ifdef WITH_HTML_LOGS
477 void addLogEntry(
const std::string& tag,
const std::string& value) {
559 bool m_suppress_deprecation_warnings;
563 #ifdef WITH_HTML_LOGS
576 #if defined(THREAD_SAFE_CANTERA)
void addError(const std::string &r, const std::string &msg)
Set an error condition in the application class without throwing an exception.
void popError()
Discard the last error message.
void writelogendl()
Write an end of line character to the screen and flush output.
std::map< std::string, XML_Node * > xmlfiles
Current vector of xml file trees that have been previously parsed.
void writelogendl()
Write an endl to the screen and flush output.
Base class for 'loggers' that write text messages to log files.
Class to hold global data.
int getErrorCount()
Return the number of errors that have been encountered so far.
ThreadMessages pMessenger
Current pointer to the logwriter.
virtual ~Application()
Destructor for class deletes global data.
std::vector< std::string > loggroups
Current vector of loggroups that are open.
Messages()
Constructor for the Messages class.
std::string lastErrorMessage()
Retrieve the last error message in a string.
XML_Node * xmllog
Current pointer to the top of the XML_Node tree for the current HTML log.
void beginLogGroup(const std::string &title, int loglevel)
Create a new group for log messages.
static Application * s_app
Pointer to the single Application instance.
Class XML_Node is a tree-based representation of the contents of an XML file.
void logerror(const std::string &msg)
Write an error message and quit.
void addError(const std::string &r, const std::string &msg)
Set an error condition in the application class without throwing an exception.
void beginLogGroup(const std::string &title, int loglevel)
Create a new group for log messages.
void addLogEntry(const std::string &tag, const std::string &value)
Add an entry to an HTML log file.
void writelog(const std::string &msg)
Write a message to the screen.
boost::shared_ptr< Messages > pMessages_t
Typedef for thread specific messages.
XML_Node * current
Pointer to the last current position in the XML_Node tree for the current HTML log.
std::vector< std::string > inputDirs
Current vector of input directories to search for input files.
std::string lastErrorMessage()
Retrieve the last error message in a string.
void addLogEntry(const std::string &tag, const std::string &value)
Add an entry to an HTML log file.
void logerror(const std::string &msg)
Write an error message and quit.
std::string tmp_dir
Current value of tmp_dir.
void addLogEntry(const std::string &msg)
Add an entry to an HTML log file.
void addLogEntry(const std::string &tag, int value)
Add an entry to an HTML log file.
void endLogGroup(const std::string &title)
Close the current group of log messages.
void setLogger(Logger *logwriter)
Install a logger.
void suppress_deprecation_warnings()
Globally disable printing of deprecation warnings.
void warn_deprecated(const std::string &method, const std::string &extra="")
Print a warning indicating that method is deprecated.
Class that stores thread messages for each thread, and retrieves them based on the thread id...
std::set< std::string > warnings
Vector of deprecation warnings that have been emitted (to suppress duplicates)
void popError()
Discard the last error message.
void write_logfile(const std::string &file)
Write the HTML log file.
XML_Node * get_XML_File(const std::string &file, int debug=0)
Return a pointer to the XML tree for a Cantera input file.
void endLogGroup(const std::string &title)
Close the current group of log messages.
Application()
Constructor for class sets up the initial conditions Protected ctor access thru static member functio...
void thread_complete()
Delete and free memory allocated per thread in multithreaded applications.
void logErrors()
Prints all of the error messages using writelog.
void getErrors(std::ostream &f)
Prints all of the error messages to an ostream.
static Application * Instance()
Return a pointer to the one and only instance of class Application.
Header for Base class for 'loggers' that write text messages to log files (see Writing messages to th...
void removeThreadMessages()
Remove a local thread message.
std::map< cthreadId_t, pMessages_t > threadMsgMap_t
Typedef for map between a thread and the message.
void addLogEntry(const std::string &tag, doublereal value)
Add an entry to an HTML log file.
Class to carry out messages.
std::vector< std::string > errorMessage
Current list of error messages.
threadMsgMap_t m_threadMsgMap
Thread Msg Map.
void write_logfile(const std::string &file)
Write the HTML log file.
std::vector< int > loglevels
Vector of loglevels for loggroups that are open.
std::vector< std::string > errorRoutine
Current error Routine.
static void ApplicationDestroy()
Static function that destroys the application class's data.
Logger * logwriter
Current pointer to the logwriter.
void writelog(const std::string &msg)
Write a message to the screen.
int loglevel
Current value of the loglevel.
Messages * operator->()
Provide a pointer dereferencing overloaded operator.
void logErrors()
Prints all of the error messages using writelog.
bool stop_on_error
Current list of error messages.
void getErrors(std::ostream &f)
Prints all of the error messages to an ostream.
int getErrorCount()
Return the number of errors that have been encountered so far.
ThreadMessages()
Constructor.
void setLogger(Logger *logwriter)
Install a logger.
void close_XML_File(const std::string &file)
Close an XML File.
std::map< std::string, std::string > options
Current map of options.