Public Member Functions | Static Public Member Functions | Private Attributes | Friends
IOerror Class Reference

Report an I/O error. More...

Inheritance diagram for IOerror:
Inheritance graph
[legend]
Collaboration diagram for IOerror:
Collaboration graph
[legend]

Public Member Functions

 IOerror (const string &title)
 Construct from title string. More...
 
 IOerror (const dictionary &)
 Construct from dictionary. More...
 
virtual ~IOerror () throw ()
 Destructor. More...
 
const stringioFileName () const
 
label ioStartLineNumber () const
 
label ioEndLineNumber () const
 
OSstreamoperator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const string &ioFileName, const label ioStartLineNumber=-1, const label ioEndLineNumber=-1)
 Convert to OSstream. More...
 
OSstreamoperator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const IOstream &)
 Convert to OSstream. More...
 
OSstreamoperator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const dictionary &)
 Convert to OSstream. More...
 
 operator dictionary () const
 Create and return a dictionary. More...
 
void exit (const int errNo=1)
 Exit : can be called for any error to exit program. More...
 
void abort ()
 Abort : used to stop code for fatal errors. More...
 
- Public Member Functions inherited from error
 error (const string &title)
 Construct from title string. More...
 
 error (const dictionary &)
 Construct from dictionary. More...
 
 error (const error &)
 Construct as copy. More...
 
virtual ~error () throw ()
 Destructor. More...
 
string message () const
 
const stringfunctionName () const
 
const stringsourceFileName () const
 
label sourceFileLineNumber () const
 
void throwExceptions ()
 
void dontThrowExceptions ()
 
OSstreamoperator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber=0)
 Convert to OSstream. More...
 
OSstreamoperator() (const string &functionName, const char *sourceFileName, const int sourceFileLineNumber=0)
 Convert to OSstream. More...
 
 operator OSstream & ()
 Convert to OSstream. More...
 
OSstreamoperator() ()
 Explicitly convert to OSstream for << operations. More...
 
 operator dictionary () const
 Create and return a dictionary. More...
 
void exit (const int errNo=1)
 Exit : can be called for any error to exit program. More...
 
void abort ()
 Abort : used to stop code for fatal errors. More...
 
- Public Member Functions inherited from messageStream
 messageStream (const string &title, errorSeverity, const int maxErrors=0)
 Construct from components. More...
 
 messageStream (const dictionary &)
 Construct from dictionary. More...
 
const stringtitle () const
 Return the title of this error type. More...
 
int maxErrors () const
 Return the maximum number of errors before program termination. More...
 
int & maxErrors ()
 Return non-const access to the maximum number of errors before. More...
 
OSstreammasterStream (const label communicator)
 Convert to OSstream. More...
 
OSstreamoperator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber=0)
 Convert to OSstream. More...
 
OSstreamoperator() (const string &functionName, const char *sourceFileName, const int sourceFileLineNumber=0)
 Convert to OSstream. More...
 
OSstreamoperator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const string &ioFileName, const label ioStartLineNumber=-1, const label ioEndLineNumber=-1)
 Convert to OSstream. More...
 
OSstreamoperator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const IOstream &)
 Convert to OSstream. More...
 
OSstreamoperator() (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const dictionary &)
 Convert to OSstream. More...
 
 operator OSstream & ()
 Convert to OSstream for << operations. More...
 
OSstreamoperator() ()
 Explicitly convert to OSstream for << operations. More...
 

Static Public Member Functions

static void SafeFatalIOError (const char *functionName, const char *sourceFileName, const int sourceFileLineNumber, const IOstream &, const string &msg)
 Print basic message and exit. Uses cerr if streams not constructed. More...
 
- Static Public Member Functions inherited from error
static void safePrintStack (std::ostream &)
 Helper function to print a stack (if OpenFOAM IO not yet. More...
 
static void printStack (Ostream &)
 Helper function to print a stack. More...
 

Private Attributes

string ioFileName_
 
label ioStartLineNumber_
 
label ioEndLineNumber_
 

Friends

Ostreamoperator<< (Ostream &, const IOerror &)
 

Additional Inherited Members

- Public Types inherited from messageStream
enum  errorSeverity { INFO, WARNING, SERIOUS, FATAL }
 Severity flags. More...
 
- Static Public Attributes inherited from messageStream
static int level
 
- Protected Attributes inherited from error
string functionName_
 
string sourceFileName_
 
label sourceFileLineNumber_
 
bool throwExceptions_
 
OStringStreammessageStreamPtr_
 
- Protected Attributes inherited from messageStream
string title_
 
errorSeverity severity_
 
int maxErrors_
 
int errorCount_
 

Detailed Description

Report an I/O error.

Definition at line 195 of file error.H.

Constructor & Destructor Documentation

◆ IOerror() [1/2]

IOerror ( const string title)

Construct from title string.

Definition at line 36 of file IOerror.C.

◆ IOerror() [2/2]

IOerror ( const dictionary errDict)

Construct from dictionary.

Definition at line 45 of file IOerror.C.

◆ ~IOerror()

~IOerror ( )
throw (
)
virtual

Destructor.

Definition at line 54 of file IOerror.C.

Member Function Documentation

◆ ioFileName()

const string& ioFileName ( ) const
inline

Definition at line 223 of file error.H.

References IOerror::ioFileName_.

Referenced by Foam::operator<<().

Here is the caller graph for this function:

◆ ioStartLineNumber()

label ioStartLineNumber ( ) const
inline

Definition at line 228 of file error.H.

References IOerror::ioStartLineNumber_.

Referenced by Foam::operator<<().

Here is the caller graph for this function:

◆ ioEndLineNumber()

label ioEndLineNumber ( ) const
inline

Definition at line 233 of file error.H.

References IOerror::ioEndLineNumber_.

Referenced by Foam::operator<<().

Here is the caller graph for this function:

◆ operator()() [1/3]

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 OSstream.

Prints basic message and returns OSstream for further info.

Definition at line 59 of file IOerror.C.

References error::operator()().

Here is the call graph for this function:

◆ operator()() [2/3]

Foam::OSstream & operator() ( const char *  functionName,
const char *  sourceFileName,
const int  sourceFileLineNumber,
const IOstream ioStream 
)

Convert to OSstream.

Prints basic message and returns OSstream for further info.

Definition at line 78 of file IOerror.C.

◆ operator()() [3/3]

Foam::OSstream & operator() ( const char *  functionName,
const char *  sourceFileName,
const int  sourceFileLineNumber,
const dictionary dict 
)

Convert to OSstream.

Prints basic message and returns OSstream for further info.

Definition at line 98 of file IOerror.C.

References dict, dictionary::endLineNumber(), dictionaryName::name(), and dictionary::startLineNumber().

Here is the call graph for this function:

◆ SafeFatalIOError()

void SafeFatalIOError ( const char *  functionName,
const char *  sourceFileName,
const int  sourceFileLineNumber,
const IOstream ioStream,
const string msg 
)
static

Print basic message and exit. Uses cerr if streams not constructed.

yet (at startup). Use in startup parsing instead of FatalError.

Definition at line 118 of file IOerror.C.

References JobInfo::constructed, Foam::endl(), Foam::exit(), Foam::FatalIOError, FatalIOErrorInFunction, IOstream::lineNumber(), and IOstream::name().

Here is the call graph for this function:

◆ operator dictionary()

operator dictionary ( ) const

Create and return a dictionary.

◆ exit()

void exit ( const int  errNo = 1)

Exit : can be called for any error to exit program.

Definition at line 168 of file IOerror.C.

References Foam::abort(), dictionary::add(), JobInfo::constructed, Foam::endl(), Foam::env(), JobInfo::exit(), Foam::exit(), UPstream::exit(), Foam::jobInfo, UPstream::parRun(), and Foam::Perr.

Referenced by Foam::exit(), IFstream::operator()(), and Istream::operator()().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ abort()

void abort ( )

Abort : used to stop code for fatal errors.

Definition at line 209 of file IOerror.C.

References JobInfo::abort(), Foam::abort(), UPstream::abort(), dictionary::add(), JobInfo::constructed, Foam::endl(), Foam::env(), Foam::exit(), Foam::jobInfo, UPstream::parRun(), and Foam::Perr.

Referenced by Foam::abort().

Here is the call graph for this function:
Here is the caller graph for this function:

Friends And Related Function Documentation

◆ operator<<

Ostream& operator<< ( Ostream ,
const IOerror  
)
friend

Field Documentation

◆ ioFileName_

string ioFileName_
private

Definition at line 201 of file error.H.

Referenced by IOerror::ioFileName().

◆ ioStartLineNumber_

label ioStartLineNumber_
private

Definition at line 202 of file error.H.

Referenced by IOerror::ioStartLineNumber().

◆ ioEndLineNumber_

label ioEndLineNumber_
private

Definition at line 203 of file error.H.

Referenced by IOerror::ioEndLineNumber().


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