Jpp test-rotations-new
the software that should make you happy
Loading...
Searching...
No Matches
Exception Class Reference

General exception. More...

#include <Exception.hh>

Inheritance diagram for Exception:

Public Member Functions

 Exception (const std::string &error)
 Constructor.
 
 ~Exception () throw ()
 Destructor.
 
virtual const char * what () const throw ()
 Get error message.
 

Static Public Member Functions

static std::ostream & getOstream ()
 Get output stream for conversion of exception.
 

Private Attributes

const std::string buffer
 

Friends

std::ostream & operator<< (std::ostream &out, const Exception &exception)
 Print error message of JException.
 

Detailed Description

General exception.

Definition at line 13 of file Exception.hh.

Constructor & Destructor Documentation

◆ Exception()

Exception::Exception ( const std::string & error)
inline

Constructor.

Parameters
errorerror message

Definition at line 20 of file Exception.hh.

20 :
21 std::exception(),
22 buffer(error)
23 {}
const std::string buffer
Definition Exception.hh:73

◆ ~Exception()

Exception::~Exception ( )
throw ( )
inline

Destructor.

Definition at line 29 of file Exception.hh.

30 {}

Member Function Documentation

◆ what()

virtual const char * Exception::what ( ) const
throw ( )
inlinevirtual

Get error message.

Returns
error message

Definition at line 38 of file Exception.hh.

39 {
40 return buffer.c_str();
41 }

◆ getOstream()

static std::ostream & Exception::getOstream ( )
inlinestatic

Get output stream for conversion of exception.

Note that the ostream is emptied before use.

Returns
ostream

Definition at line 63 of file Exception.hh.

64 {
65 static std::ostringstream buffer;
66
67 buffer.str("");
68
69 return buffer;
70 }

Friends And Related Symbol Documentation

◆ operator<<

std::ostream & operator<< ( std::ostream & out,
const Exception & exception )
friend

Print error message of JException.

Parameters
outoutput stream
exceptionexception

Definition at line 50 of file Exception.hh.

51 {
52 return out << exception.what();
53 }
virtual const char * what() const
Get error message.
Definition Exception.hh:38

Member Data Documentation

◆ buffer

const std::string Exception::buffer
private

Definition at line 73 of file Exception.hh.


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