DivideByZeroException Class Reference

This class is used to manage a Divide By Zero Exception. More...

#include <DivideByZeroException.h>

Inherits ArithmeticException.

Inheritance diagram for DivideByZeroException:

Inheritance graph
[legend]
Collaboration diagram for DivideByZeroException:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 DivideByZeroException () throw ()
 Default constructor.
 DivideByZeroException (std::string sExpressionToCompute, std::string sZeroValue) throw ()
 This constructor requires 2 parameters :
  • the attribute which the value cannot be computed due to the divide by zero error
  • the attribute which is null and has done the error ModelId=43834AC102BD.

 DivideByZeroException (std::string sExpressionToCompute, std::string sZeroValue, std::string sOrigin, std::string sFileName, unsigned int iLineNumber) throw ()
 This constructor requires 5 parameters :
  • the attribute which the value cannot be computed due to the divide by zero error
  • the attribute which is null and has done the error
  • the method which throw the exception
  • the name of the file where the exception was thrown
  • the line number in the file where the exception was thrown.

virtual ~DivideByZeroException () throw ()
 Destructor.
virtual std::string makeDescription ()
 The description message provides by the divide by zero exception.
virtual std::string makeReason ()
 The reason message provides by the divide by zero exception.
virtual std::string makeOrigin (std::string sOrigin)
 The origin message provides by the divide by zero exception.

Private Attributes

std::string _sExpressionToCompute
std::string _sZeroValue

Detailed Description

This class is used to manage a Divide By Zero Exception.

Definition at line 19 of file DivideByZeroException.h.


Constructor & Destructor Documentation

DivideByZeroException::DivideByZeroException  )  throw ()
 

Default constructor.

Definition at line 16 of file DivideByZeroException.cpp.

00017 {
00018 
00019 }

DivideByZeroException::DivideByZeroException std::string  sExpressionToCompute,
std::string  sZeroValue
throw ()
 

This constructor requires 2 parameters :

  • the attribute which the value cannot be computed due to the divide by zero error
  • the attribute which is null and has done the error ModelId=43834AC102BD.

Definition at line 32 of file DivideByZeroException.cpp.

00032                                                                                                          : _sExpressionToCompute(sExpressionToCompute),_sZeroValue(sZeroValue)
00033 {       
00034         setLineNumber(0);
00035         setFileName("");
00036         setType("DivideByZeroException");
00037         
00038         setDescription(makeDescription());
00039         setReason(makeReason());
00040         setOrigin("");
00041 
00042 }

DivideByZeroException::DivideByZeroException std::string  sExpressionToCompute,
std::string  sZeroValue,
std::string  sOrigin,
std::string  sFileName,
unsigned int  iLineNumber
throw ()
 

This constructor requires 5 parameters :

  • the attribute which the value cannot be computed due to the divide by zero error
  • the attribute which is null and has done the error
  • the method which throw the exception
  • the name of the file where the exception was thrown
  • the line number in the file where the exception was thrown.

ModelId=43834AC102CC

Definition at line 51 of file DivideByZeroException.cpp.

00051                                                                                                                                                                        : _sExpressionToCompute(sExpressionToCompute),_sZeroValue(sZeroValue)
00052 {       
00053         setLineNumber(iLineNumber);
00054         setFileName(sFileName);
00055         setType("DivideByZeroException");
00056         
00057         setDescription(makeDescription());
00058         setReason(makeReason());
00059         setOrigin(makeOrigin(sOrigin));
00060 }

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

Destructor.

Definition at line 23 of file DivideByZeroException.cpp.

00024 {
00025 
00026 }


Member Function Documentation

std::string DivideByZeroException::makeDescription  )  [virtual]
 

The description message provides by the divide by zero exception.

Implements ArithmeticException.

Definition at line 64 of file DivideByZeroException.cpp.

References _sExpressionToCompute, and _sZeroValue.

00065 {
00066         std::string     sExceptionMessage = "Computing of the ";
00067                         sExceptionMessage+= _sExpressionToCompute;
00068                         sExceptionMessage+= " not possible due to ";
00069                         sExceptionMessage+= _sZeroValue;
00070                         sExceptionMessage+= " equal to zero";
00071 
00072         return sExceptionMessage;
00073 }

std::string DivideByZeroException::makeOrigin std::string  sOrigin  )  [virtual]
 

The origin message provides by the divide by zero exception.

Implements ArithmeticException.

Definition at line 88 of file DivideByZeroException.cpp.

References Exception::getFileName(), Exception::getLineNumber(), and ltos().

00089 {
00090         std::string     sOriginMessage = getFileName();
00091                         sOriginMessage+= " (l:";
00092                         sOriginMessage+= ltos(getLineNumber());
00093                         sOriginMessage+= ") ";
00094                         sOriginMessage+= sOrigin;
00095                         
00096         return sOriginMessage;
00097 }

Here is the call graph for this function:

std::string DivideByZeroException::makeReason  )  [virtual]
 

The reason message provides by the divide by zero exception.

Implements ArithmeticException.

Definition at line 77 of file DivideByZeroException.cpp.

References Exception::getType().

00078 {
00079         std::string     sReasonMessage = "OPERATION_NOT_ALLOWED --> ";
00080                         sReasonMessage+= getType();
00081                         
00082         return sReasonMessage;
00083 }

Here is the call graph for this function:


Member Data Documentation

std::string DivideByZeroException::_sExpressionToCompute [private]
 

Definition at line 41 of file DivideByZeroException.h.

Referenced by makeDescription().

std::string DivideByZeroException::_sZeroValue [private]
 

Definition at line 43 of file DivideByZeroException.h.

Referenced by makeDescription().


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