ValueOutOfBoundException Class Reference

This class is used to managed a value out of the allowed bound. More...

#include <ValueOutOfBoundException.h>

Inherits OutOfBoundException.

Inheritance diagram for ValueOutOfBoundException:

Inheritance graph
[legend]
Collaboration diagram for ValueOutOfBoundException:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 ValueOutOfBoundException () throw ()
 Default constructor.
 ValueOutOfBoundException (std::string sElementName, double dValue, Bound *mBound) throw ()
 This constructor requires 3 parameters :
  • the name of the element which is not in its allowed bound
  • the value which is out of the bound
  • the bound object which contains the boundary conditions ModelId=438739560186.

 ValueOutOfBoundException (std::string sElementName, double dValue, double dValueMin, double dValueMax) throw ()
 This constructor requires 4 parameters :
  • the name of the element which is not in its allowed bound
  • the value which is out of the bound
  • the minimal bound value
  • the maximal bound value ModelId=43834ABD02CE.

 ValueOutOfBoundException (std::string sElementName, double dValue, double dValueMin, double dValueMax, std::string sOrigin, std::string sFileName, unsigned int iLineNumber) throw ()
 This constructor requires 7 parameters :
  • the name of the element which is not in its allowed bound
  • the value which is out of the bound
  • the minimal bound value
  • the maximal bound value
  • 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 ~ValueOutOfBoundException () throw ()
 Destructor.
virtual std::string makeDescription ()
 The message provides by the value out of range exception.
virtual std::string makeReason ()
 The reason message provides by the value out of bound exception.
virtual std::string makeOrigin (std::string sOrigin)
 The origin message provides by the value out of bound exception.

Private Attributes

std::string _sElementName
double _dValue
double _dValueMin
double _dValueMax

Detailed Description

This class is used to managed a value out of the allowed bound.

Definition at line 17 of file ValueOutOfBoundException.h.


Constructor & Destructor Documentation

ValueOutOfBoundException::ValueOutOfBoundException  )  throw ()
 

Default constructor.

Definition at line 17 of file ValueOutOfBoundException.cpp.

00018 {
00019 
00020 }

ValueOutOfBoundException::ValueOutOfBoundException std::string  sElementName,
double  dValue,
Bound mBound
throw ()
 

This constructor requires 3 parameters :

  • the name of the element which is not in its allowed bound
  • the value which is out of the bound
  • the bound object which contains the boundary conditions ModelId=438739560186.

Definition at line 53 of file ValueOutOfBoundException.cpp.

00053                                                                                                              : _sElementName(sElementName),_dValue(dValue),_dValueMin(mBound->getLowerBound()),_dValueMax(mBound->getUpperBound())
00054 {       
00055         setLineNumber(0);
00056         setFileName("");
00057         setType("ValueOutOfBoundException");
00058         
00059         setDescription(makeDescription());
00060         setReason(makeReason());
00061         setOrigin("");
00062 }

ValueOutOfBoundException::ValueOutOfBoundException std::string  sElementName,
double  dValue,
double  dValueMin,
double  dValueMax
throw ()
 

This constructor requires 4 parameters :

  • the name of the element which is not in its allowed bound
  • the value which is out of the bound
  • the minimal bound value
  • the maximal bound value ModelId=43834ABD02CE.

Definition at line 35 of file ValueOutOfBoundException.cpp.

00035                                                                                                                                   : _sElementName(sElementName),_dValue(dValue),_dValueMin(dValueMin),_dValueMax(dValueMax)
00036 {       
00037         setLineNumber(0);
00038         setFileName("");
00039         setType("ValueOutOfBoundException");
00040         
00041         setDescription(makeDescription());
00042         setReason(makeReason());
00043         setOrigin("");
00044         
00045 
00046 }

ValueOutOfBoundException::ValueOutOfBoundException std::string  sElementName,
double  dValue,
double  dValueMin,
double  dValueMax,
std::string  sOrigin,
std::string  sFileName,
unsigned int  iLineNumber
throw ()
 

This constructor requires 7 parameters :

  • the name of the element which is not in its allowed bound
  • the value which is out of the bound
  • the minimal bound value
  • the maximal bound value
  • 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=43834ABD02DD

Definition at line 73 of file ValueOutOfBoundException.cpp.

00073                                                                                                                                                                                                  : _sElementName(sElementName),_dValue(dValue),_dValueMin(dValueMin),_dValueMax(dValueMax)
00074 {       
00075         setType("ValueOutOfBoundException");
00076         setLineNumber(iLineNumber);
00077         setFileName(sFileName);
00078         
00079         setDescription(makeDescription());
00080         setReason(makeReason());
00081         setOrigin(makeOrigin(sOrigin));
00082 }

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

Destructor.

Definition at line 24 of file ValueOutOfBoundException.cpp.

00025 {
00026 
00027 }


Member Function Documentation

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

The message provides by the value out of range exception.

Implements OutOfBoundException.

Definition at line 86 of file ValueOutOfBoundException.cpp.

References _dValue, _dValueMax, _dValueMin, _sElementName, and dtos().

00087 { 
00088         std::string     sExceptionMessage       =       "The value ";
00089                         sExceptionMessage       +=      dtos(_dValue);
00090                         sExceptionMessage       +=  " of the ";
00091                         sExceptionMessage       +=  _sElementName;
00092                         sExceptionMessage       +=      " variable must be in the allowed bound [" ;
00093                         sExceptionMessage       +=      dtos(_dValueMin);
00094                         sExceptionMessage       +=      ","; 
00095                         sExceptionMessage       +=      dtos(_dValueMax);
00096                         sExceptionMessage       +=      "]"; 
00097         
00098         return sExceptionMessage;
00099 }

Here is the call graph for this function:

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

The origin message provides by the value out of bound exception.

Implements OutOfBoundException.

Definition at line 113 of file ValueOutOfBoundException.cpp.

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

00114 {
00115         std::string     sOriginMessage = getFileName();
00116                         sOriginMessage+= " (l:";
00117                         sOriginMessage+= ltos(getLineNumber());
00118                         sOriginMessage+= ") ";
00119                         sOriginMessage+= sOrigin;
00120                         
00121         return sOriginMessage;
00122 }

Here is the call graph for this function:

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

The reason message provides by the value out of bound exception.

Implements OutOfBoundException.

Definition at line 103 of file ValueOutOfBoundException.cpp.

References Exception::getType().

00104 {
00105         std::string     sReasonMessage = "DATA_OUT_OF_RANGE --> ";
00106                         sReasonMessage+= getType();
00107                         
00108         return sReasonMessage;
00109 }

Here is the call graph for this function:


Member Data Documentation

double ValueOutOfBoundException::_dValue [private]
 

Definition at line 43 of file ValueOutOfBoundException.h.

Referenced by makeDescription().

double ValueOutOfBoundException::_dValueMax [private]
 

Definition at line 47 of file ValueOutOfBoundException.h.

Referenced by makeDescription().

double ValueOutOfBoundException::_dValueMin [private]
 

Definition at line 45 of file ValueOutOfBoundException.h.

Referenced by makeDescription().

std::string ValueOutOfBoundException::_sElementName [private]
 

Definition at line 41 of file ValueOutOfBoundException.h.

Referenced by makeDescription().


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