irtkException Class Reference

#include <irtkException.h>

Inheritance diagram for irtkException:

Inheritance graph
[legend]
Collaboration diagram for irtkException:

Collaboration graph
[legend]

List of all members.


Detailed Description

Exception class for the irtk library.

Definition at line 22 of file irtkException.h.


Public Member Functions

 irtkException (const std::string &message, const std::string &fileName="", unsigned int line=0)
 Constructor takes message, file name and line number at which exception was thrown.
const std::string & GetMessage () const
 Returns the message.
const std::string & GetFileName () const
 Returns the name of the file in which the exception was thrown.
unsigned int GetLine () const
 Returns the line number at which the exception was thrown.

Protected Attributes

std::string _Message
 The message.
std::string _FileName
 The file name.
unsigned int _Line
 The line number at which the exception was thrown.

Friends

std::ostream & operator<< (std::ostream &os, const irtkException &ex)
 Outputs the exception to a stream.

Constructor & Destructor Documentation

irtkException::irtkException ( const std::string &  message,
const std::string &  fileName = "",
unsigned int  line = 0 
) [inline]

Constructor takes message, file name and line number at which exception was thrown.

Parameters:
message The message.
file The file name. You can use the __FILE__ macro to get the file name.
line The line number at which the exception was thrown. You can use the __LINE__ macro to get the line number.

Definition at line 60 of file irtkException.h.

References _FileName, _Line, and _Message.


Member Function Documentation

const std::string & irtkException::GetMessage (  )  const [inline]

Returns the message.

Definition at line 68 of file irtkException.h.

References _Message.

const std::string & irtkException::GetFileName (  )  const [inline]

Returns the name of the file in which the exception was thrown.

Definition at line 73 of file irtkException.h.

References _FileName.

unsigned int irtkException::GetLine (  )  const [inline]

Returns the line number at which the exception was thrown.

Definition at line 78 of file irtkException.h.

References _Line.


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const irtkException ex 
) [friend]

Outputs the exception to a stream.

Parameters:
os The output stream.
ex The exception.


Member Data Documentation

std::string irtkException::_Message [protected]

The message.

Definition at line 51 of file irtkException.h.

Referenced by GetMessage(), and irtkException().

std::string irtkException::_FileName [protected]

The file name.

Definition at line 54 of file irtkException.h.

Referenced by GetFileName(), and irtkException().

unsigned int irtkException::_Line [protected]

The line number at which the exception was thrown.

Definition at line 57 of file irtkException.h.

Referenced by GetLine(), and irtkException().


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