CppUnit - The Unit Testing Library

CppUnit project page | FAQ

Public Member Functions | Protected Types | Protected Attributes | List of all members
Exception Class Reference
Browsing collected test result

Exceptions thrown by failed assertions. More...

`#include <Exception.h>`

Inheritance diagram for Exception:
[legend]
Collaboration diagram for Exception:
[legend]

## Public Member Functions
| Exception (const Message &message=Message(), const SourceLine &sourceLine=SourceLine())
| Constructs the exception with the specified message and source location. More...
| Exception (const Exception &other)
| Constructs a copy of an exception. More...
virtual | ~Exception () throw ()
| Destructs the exception. More...
Exception & | operator= (const Exception &other)
| Performs an assignment. More...
const char * | what () const throw ()
| Returns descriptive message. More...
SourceLine | sourceLine () const
| Location where the error occured. More...
Message | message () const
| Message related to the exception. More...
void | setMessage (const Message &message)
| Set the message. More...
virtual Exception * | clone () const
| Clones the exception. More...

## Protected Types
typedef std::exception | SuperClass

## Protected Attributes
Message | m_message
SourceLine | m_sourceLine
std::string | m_whatMessage

## Detailed Description

Exceptions thrown by failed assertions.

Exception is an exception that serves descriptive strings through its what() method

## Member Typedef Documentation

## ◆ SuperClass

typedef std::exception Exception::SuperClass
| protected

## Constructor & Destructor Documentation

## ◆ Exception() [1/2]

Exception::Exception | ( | const Message & | message = `Message()`,
|  | const SourceLine & | sourceLine = `SourceLine()`
| ) |  |

Constructs the exception with the specified message and source location.

Parameters

  message | Message associated to the exception.
  sourceLine | Source location related to the exception.

## ◆ Exception() [2/2]

CPPUNIT_NS_BEGIN Exception::Exception | ( | const Exception & | other | ) |

Constructs a copy of an exception.

Parameters

  other | Exception to copy.

## ◆ ~Exception()

Exception::~Exception | ( |  | ) |
throw | ( |
| ) |  |
| virtual

Destructs the exception.

## Member Function Documentation

## ◆ clone()

Exception * Exception::clone | ( |  | ) | const
| virtual

Clones the exception.

## ◆ message()

Message Exception::message | ( |  | ) | const

Message related to the exception.

## ◆ operator=()

Exception & Exception::operator= | ( | const Exception & | other | ) |

Performs an assignment.

## ◆ setMessage()

void Exception::setMessage | ( | const Message & | message | ) |

Set the message.

## ◆ sourceLine()

SourceLine Exception::sourceLine | ( |  | ) | const

Location where the error occured.

## ◆ what()

const char * Exception::what | ( |  | ) | const
throw | ( |
| ) |  |

Returns descriptive message.

## Member Data Documentation

## ◆ m_message

Message Exception::m_message
| protected

## ◆ m_sourceLine

SourceLine Exception::m_sourceLine
| protected

## ◆ m_whatMessage

std::string Exception::m_whatMessage
| protected

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

- Exception.h
- Exception.cpp

| Send comments to: CppUnit Developers