DivideByZeroException.cpp

Go to the documentation of this file.
00001 // DivideByZeroException.cpp: implementation of the DivideByZeroException class.
00002 //
00004 
00005 #ifdef WIN32 
00006 #pragma warning(disable:4786)
00007 #endif
00008 #include "DivideByZeroException.h"
00009 
00011 // Construction/Destruction
00013 
00015 //##ModelId=43834AC102BC
00016 DivideByZeroException::DivideByZeroException() throw()
00017 {
00018 
00019 }
00020 
00022 //##ModelId=43834AC102DD
00023 DivideByZeroException::~DivideByZeroException() throw()
00024 {
00025 
00026 }
00027 
00031 //##ModelId=43834AC102BD
00032 DivideByZeroException::DivideByZeroException(std::string sExpressionToCompute,std::string sZeroValue)  throw() : _sExpressionToCompute(sExpressionToCompute),_sZeroValue(sZeroValue)
00033 {       
00034         setLineNumber(0);
00035         setFileName("");
00036         setType("DivideByZeroException");
00037         
00038         setDescription(makeDescription());
00039         setReason(makeReason());
00040         setOrigin("");
00041 
00042 }
00043 
00050 //##ModelId=43834AC102CC
00051 DivideByZeroException::DivideByZeroException(std::string sExpressionToCompute,std::string sZeroValue,std::string sOrigin,std::string sFileName,unsigned int iLineNumber) throw() : _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 }
00061 
00063 //##ModelId=43834AC102EA
00064 std::string DivideByZeroException::makeDescription()
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 }
00074 
00076 //##ModelId=43834AC102EC
00077 std::string DivideByZeroException::makeReason()
00078 {
00079         std::string     sReasonMessage = "OPERATION_NOT_ALLOWED --> ";
00080                         sReasonMessage+= getType();
00081                         
00082         return sReasonMessage;
00083 }
00084 
00085 
00087 //##ModelId=43834AC102FA
00088 std::string DivideByZeroException::makeOrigin(std::string sOrigin)
00089 {
00090         std::string     sOriginMessage = getFileName();
00091                         sOriginMessage+= " (l:";
00092                         sOriginMessage+= ltos(getLineNumber());
00093                         sOriginMessage+= ") ";
00094                         sOriginMessage+= sOrigin;
00095                         
00096         return sOriginMessage;
00097 }

Generated on Fri Jul 10 10:31:53 2009 for Utils Library by  doxygen 1.4.5