Exception Class Reference

The main abstract class to manage all the library exceptions. More...

#include <Exception.h>

Inherited by ArithmeticException, FileException, IllegalArgumentException, NoSuchElementException, NullPointerException, OperationException, and OutOfBoundException.

Inheritance diagram for Exception:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 Exception () throw ()
 Default constructor.
virtual ~Exception () throw ()
 Destructor.
virtual std::string makeDescription ()=0
virtual std::string makeReason ()=0
virtual std::string makeOrigin (std::string sOrigin)=0
virtual std::string getReason ()
 Return the reason string of the exception.
virtual std::string getDescription ()
 Return the description string of the exception.
virtual std::string getOrigin ()
 Return the origin string of the exception.
virtual unsigned int getLineNumber ()
 Return the line number which throw the exception.
virtual std::string getFileName ()
 Return the name of the file which throw the exception.
virtual std::string getType ()
 Return the type of the exception thrown.
virtual void setReason (std::string sReason)
 Set the reason string of the exception.
virtual void setDescription (std::string sDescription)
 Set the description string of the exception.
virtual void setOrigin (std::string sOrigin)
 Set the origin string of the exception.
virtual void setLineNumber (unsigned int iLineNumber)
 Set the line number which throw the exception.
virtual void setFileName (std::string sFileName)
 Set the name of the file which throw the exception.
virtual void setType (std::string sType)
 Set the type of the exception thrown.

Private Attributes

std::string _sReason
std::string _sDescription
std::string _sOrigin
std::string _sType
unsigned int _iLineNumber
std::string _sFileName

Detailed Description

The main abstract class to manage all the library exceptions.

Definition at line 20 of file Exception.h.


Constructor & Destructor Documentation

Exception::Exception  )  throw ()
 

Default constructor.

Definition at line 16 of file Exception.cpp.

00017 {
00018 
00019 }

Exception::~Exception  )  throw () [virtual]
 

Destructor.

Definition at line 23 of file Exception.cpp.

00024 {
00025 
00026 }


Member Function Documentation

string Exception::getDescription  )  [virtual]
 

Return the description string of the exception.

Definition at line 37 of file Exception.cpp.

References _sDescription.

00038 {
00039         return _sDescription;
00040 }

std::string Exception::getFileName  )  [virtual]
 

Return the name of the file which throw the exception.

Definition at line 58 of file Exception.cpp.

References _sFileName.

Referenced by ValueOutOfBoundException::makeOrigin(), TrigonometricValueOutOfBoundException::makeOrigin(), SquareRootException::makeOrigin(), ParseException::makeOrigin(), NullPointerException::makeOrigin(), NotAllowedOperationException::makeOrigin(), NoSuchElementException::makeOrigin(), InfinityException::makeOrigin(), IndexOutOfBoundException::makeOrigin(), IllegalArgumentException::makeOrigin(), FileNotFoundException::makeOrigin(), and DivideByZeroException::makeOrigin().

00059 {
00060         return _sFileName;
00061 }

unsigned int Exception::getLineNumber  )  [virtual]
 

Return the line number which throw the exception.

Definition at line 51 of file Exception.cpp.

References _iLineNumber.

Referenced by ValueOutOfBoundException::makeOrigin(), TrigonometricValueOutOfBoundException::makeOrigin(), SquareRootException::makeOrigin(), ParseException::makeOrigin(), NullPointerException::makeOrigin(), NotAllowedOperationException::makeOrigin(), NoSuchElementException::makeOrigin(), InfinityException::makeOrigin(), IndexOutOfBoundException::makeOrigin(), IllegalArgumentException::makeOrigin(), FileNotFoundException::makeOrigin(), and DivideByZeroException::makeOrigin().

00052 {
00053         return _iLineNumber;
00054 }

string Exception::getOrigin  )  [virtual]
 

Return the origin string of the exception.

Definition at line 44 of file Exception.cpp.

References _sOrigin.

00045 {
00046         return _sOrigin;
00047 }

std::string Exception::getReason  )  [virtual]
 

Return the reason string of the exception.

Definition at line 30 of file Exception.cpp.

References _sReason.

00031 {
00032         return _sReason;
00033 }

std::string Exception::getType  )  [virtual]
 

Return the type of the exception thrown.

Definition at line 65 of file Exception.cpp.

References _sType.

Referenced by ValueOutOfBoundException::makeReason(), TrigonometricValueOutOfBoundException::makeReason(), SquareRootException::makeReason(), ParseException::makeReason(), NullPointerException::makeReason(), NotAllowedOperationException::makeReason(), NoSuchElementException::makeReason(), InfinityException::makeReason(), IndexOutOfBoundException::makeReason(), IllegalArgumentException::makeReason(), FileNotFoundException::makeReason(), and DivideByZeroException::makeReason().

00066 {
00067         return _sType;
00068 }

virtual std::string Exception::makeDescription  )  [pure virtual]
 

Implemented in ArithmeticException, DivideByZeroException, FileException, FileNotFoundException, IllegalArgumentException, IndexOutOfBoundException, InfinityException, NoSuchElementException, NotAllowedOperationException, NullPointerException, OperationException, OutOfBoundException, ParseException, SquareRootException, TrigonometricValueOutOfBoundException, and ValueOutOfBoundException.

virtual std::string Exception::makeOrigin std::string  sOrigin  )  [pure virtual]
 

Implemented in ArithmeticException, DivideByZeroException, FileException, FileNotFoundException, IllegalArgumentException, IndexOutOfBoundException, InfinityException, NoSuchElementException, NotAllowedOperationException, NullPointerException, OperationException, OutOfBoundException, ParseException, SquareRootException, TrigonometricValueOutOfBoundException, and ValueOutOfBoundException.

virtual std::string Exception::makeReason  )  [pure virtual]
 

Implemented in ArithmeticException, DivideByZeroException, FileException, FileNotFoundException, IllegalArgumentException, IndexOutOfBoundException, InfinityException, NoSuchElementException, NotAllowedOperationException, NullPointerException, OperationException, OutOfBoundException, ParseException, SquareRootException, TrigonometricValueOutOfBoundException, and ValueOutOfBoundException.

void Exception::setDescription std::string  sDescription  )  [virtual]
 

Set the description string of the exception.

Definition at line 79 of file Exception.cpp.

References _sDescription.

Referenced by IllegalArgumentException::IllegalArgumentException(), and NotAllowedOperationException::NotAllowedOperationException().

00080 {
00081         _sDescription = sDescription;
00082 }

void Exception::setFileName std::string  sFileName  )  [virtual]
 

Set the name of the file which throw the exception.

Definition at line 100 of file Exception.cpp.

References _sFileName.

Referenced by IllegalArgumentException::IllegalArgumentException(), and NotAllowedOperationException::NotAllowedOperationException().

00101 {
00102         _sFileName = sFileName;
00103 }

void Exception::setLineNumber unsigned int  iLineNumber  )  [virtual]
 

Set the line number which throw the exception.

Definition at line 93 of file Exception.cpp.

References _iLineNumber.

Referenced by IllegalArgumentException::IllegalArgumentException(), and NotAllowedOperationException::NotAllowedOperationException().

00094 {
00095         _iLineNumber = iLineNumber;
00096 }

void Exception::setOrigin std::string  sOrigin  )  [virtual]
 

Set the origin string of the exception.

Definition at line 86 of file Exception.cpp.

References _sOrigin.

Referenced by IllegalArgumentException::IllegalArgumentException(), and NotAllowedOperationException::NotAllowedOperationException().

00087 {
00088         _sOrigin = sOrigin;
00089 }

void Exception::setReason std::string  sReason  )  [virtual]
 

Set the reason string of the exception.

Definition at line 72 of file Exception.cpp.

References _sReason.

Referenced by IllegalArgumentException::IllegalArgumentException(), and NotAllowedOperationException::NotAllowedOperationException().

00073 {
00074         _sReason = sReason;
00075 }

void Exception::setType std::string  sType  )  [virtual]
 

Set the type of the exception thrown.

Definition at line 107 of file Exception.cpp.

References _sType.

Referenced by IllegalArgumentException::IllegalArgumentException(), and NotAllowedOperationException::NotAllowedOperationException().

00108 {
00109         _sType = sType;
00110 }


Member Data Documentation

unsigned int Exception::_iLineNumber [private]
 

Definition at line 72 of file Exception.h.

Referenced by getLineNumber(), and setLineNumber().

std::string Exception::_sDescription [private]
 

Definition at line 66 of file Exception.h.

Referenced by getDescription(), and setDescription().

std::string Exception::_sFileName [private]
 

Definition at line 74 of file Exception.h.

Referenced by getFileName(), and setFileName().

std::string Exception::_sOrigin [private]
 

Definition at line 68 of file Exception.h.

Referenced by getOrigin(), and setOrigin().

std::string Exception::_sReason [private]
 

Reimplemented in NotAllowedOperationException.

Definition at line 64 of file Exception.h.

Referenced by getReason(), and setReason().

std::string Exception::_sType [private]
 

Definition at line 70 of file Exception.h.

Referenced by getType(), and setType().


The documentation for this class was generated from the following files:
Generated on Fri Jul 10 10:32:15 2009 for Utils Library by  doxygen 1.4.5