Class to handle messaging in a simple, consistent stream-based manner. More...
#include <OpenFOAM/messageStream.H>
Class to handle messaging in a simple, consistent stream-based manner.
The messageStream class is globaly instantiated with a title string a given severity, which controls the program termination, and a number of errors before termination. Errors, messages and other data are piped to the messageStream class in the standard manner.
Definition at line 67 of file messageStream.H.
Inheritance diagram for messageStream:
Collaboration diagram for messageStream:Public Types | |
| enum | errorSeverity { INFO, WARNING, SERIOUS, FATAL } |
| Severity flags. More... | |
Public Member Functions | |
| messageStream (const string &title, errorSeverity sev, const int maxErrors=0) | |
| Construct from components. | |
| messageStream (const dictionary &dict) | |
| Construct from dictionary. | |
| const string & | title () const |
| Return the title of this error type. | |
| int | maxErrors () const |
| Return the maximum number of errors before program termination. | |
| int & | maxErrors () |
| Return non-const access to the maximum number of errors before. | |
| OSstream & | operator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber=0) |
| Convert to Ostream. | |
| OSstream & | operator() (const string &functionName, const char *sourceFileName, const int sourceFileLineNumber=0) |
| OSstream & | operator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const string &ioFileName, const label ioStartLineNumber=-1, const label ioEndLineNumber=-1) |
| Convert to Ostream. | |
| OSstream & | operator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const IOstream &) |
| Convert to Ostream. | |
| OSstream & | operator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const dictionary &) |
| Convert to Ostream. | |
| operator OSstream & () | |
| Convert to Ostream for << operations. | |
| OSstream & | operator() () |
| Explicitly convert to Ostream for << operations. | |
Static Public Attributes | |
| static int | level |
Protected Attributes | |
| string | title_ |
| errorSeverity | severity_ |
| int | maxErrors_ |
| int | errorCount_ |
| enum errorSeverity |
Severity flags.
Definition at line 73 of file messageStream.H.
| messageStream | ( | const string & | title, |
| errorSeverity | sev, | ||
| const int | maxErrors = 0 |
||
| ) |
Construct from components.
Definition at line 38 of file messageStream.C.
| messageStream | ( | const dictionary & | dict | ) |
Construct from dictionary.
Definition at line 51 of file messageStream.C.
|
inline |
Return the title of this error type.
Definition at line 117 of file messageStream.H.
References messageStream::title_.
Referenced by Foam::operator<<().
|
inline |
Return the maximum number of errors before program termination.
Definition at line 123 of file messageStream.H.
References messageStream::maxErrors_.
|
inline |
Return non-const access to the maximum number of errors before.
program termination to enable user to reset it
Definition at line 130 of file messageStream.H.
References messageStream::maxErrors_.
| Foam::OSstream & operator() | ( | const char * | functionName, |
| const char * | sourceFileName, | ||
| const int | sourceFileLineNumber = 0 |
||
| ) |
Convert to Ostream.
Prints basic message and then returns Ostream for further info.
Reimplemented in error.
Definition at line 61 of file messageStream.C.
References Foam::endl().
| Foam::OSstream & operator() | ( | const string & | functionName, |
| const char * | sourceFileName, | ||
| const int | sourceFileLineNumber = 0 |
||
| ) |
Reimplemented in error.
Definition at line 80 of file messageStream.C.
| Foam::OSstream & operator() | ( | const char * | functionName, |
| const char * | sourceFileName, | ||
| const int | sourceFileLineNumber, | ||
| const string & | ioFileName, | ||
| const label | ioStartLineNumber = -1, |
||
| const label | ioEndLineNumber = -1 |
||
| ) |
Convert to Ostream.
Prints basic message and then returns Ostream for further info.
Reimplemented in IOerror.
Definition at line 96 of file messageStream.C.
References Foam::endl().
| Foam::OSstream & operator() | ( | const char * | functionName, |
| const char * | sourceFileName, | ||
| const int | sourceFileLineNumber, | ||
| const IOstream & | ioStream | ||
| ) |
Convert to Ostream.
Prints basic message and then returns Ostream for further info.
Reimplemented in IOerror.
Definition at line 130 of file messageStream.C.
| Foam::OSstream & operator() | ( | const char * | functionName, |
| const char * | sourceFileName, | ||
| const int | sourceFileLineNumber, | ||
| const dictionary & | dict | ||
| ) |
Convert to Ostream.
Prints basic message and then returns Ostream for further info.
Reimplemented in IOerror.
Definition at line 150 of file messageStream.C.
|
inline |
Explicitly convert to Ostream for << operations.
Reimplemented in error.
Definition at line 187 of file messageStream.H.
|
protected |
Definition at line 86 of file messageStream.H.
Referenced by messageStream::title().
|
protected |
Definition at line 87 of file messageStream.H.
|
protected |
Definition at line 88 of file messageStream.H.
Referenced by messageStream::maxErrors().
|
protected |
Definition at line 89 of file messageStream.H.
|
static |
Definition at line 96 of file messageStream.H.
Referenced by Foam::operator<<(), and IOobject::setBad().