IndexOutOfBoundException Class Reference

The index out of Bound exception class manage errors due to a bad given index to access an array ModelId=43834AC0028C. More...

#include <IndexOutOfBoundException.h>

Inherits OutOfBoundException.

Inheritance diagram for IndexOutOfBoundException:

Inheritance graph
[legend]
Collaboration diagram for IndexOutOfBoundException:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 IndexOutOfBoundException () throw ()
 Default constructor.
 IndexOutOfBoundException (std::string sElementName, long iIndex, long iIndexMin, long iIndexMax) throw ()
 This constructor requires 4 parameters :
  • the name of the element which is not in its allowed Bound index
  • the bad index entered
  • the Lower Bound index value
  • the maximal Bound index value ModelId=43834AC0029E.

 IndexOutOfBoundException (std::string sElementName, long iIndex, long iIndexMin, long iIndexMax, 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 index
  • the bad index entered
  • the Lower Bound index value
  • the maximal Bound index 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 ~IndexOutOfBoundException () throw ()
 Destructor.
virtual std::string makeDescription ()
 The message provides by the index out of Bound exception.
virtual std::string makeReason ()
 The reason message provides by the index out of Bound exception.
virtual std::string makeOrigin (std::string sOrigin)
 The origin message provides by the index out of Bound exception.

Private Attributes

std::string _sElementName
long _iIndex
long _iIndexMin
long _iIndexMax

Detailed Description

The index out of Bound exception class manage errors due to a bad given index to access an array ModelId=43834AC0028C.

Definition at line 18 of file IndexOutOfBoundException.h.


Constructor & Destructor Documentation

IndexOutOfBoundException::IndexOutOfBoundException  )  throw ()
 

Default constructor.

Definition at line 16 of file IndexOutOfBoundException.cpp.

00017 {
00018 
00019 }

IndexOutOfBoundException::IndexOutOfBoundException std::string  sElementName,
long  iIndex,
long  iIndexMin,
long  iIndexMax
throw ()
 

This constructor requires 4 parameters :

  • the name of the element which is not in its allowed Bound index
  • the bad index entered
  • the Lower Bound index value
  • the maximal Bound index value ModelId=43834AC0029E.

Definition at line 34 of file IndexOutOfBoundException.cpp.

00034                                                                                                                            : _sElementName(sElementName),_iIndex(iIndex),_iIndexMin(iIndexMin),_iIndexMax(iIndexMax)
00035 {               
00036                 setLineNumber(0);
00037                 setFileName("");
00038                 setType("IndexOutOfBoundException");
00039 
00040                 setOrigin("");  
00041                 setDescription(makeDescription());
00042                 setReason(makeReason());
00043 
00044 }

IndexOutOfBoundException::IndexOutOfBoundException std::string  sElementName,
long  iIndex,
long  iIndexMin,
long  iIndexMax,
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 index
  • the bad index entered
  • the Lower Bound index value
  • the maximal Bound index 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=43834AC002A3

Definition at line 56 of file IndexOutOfBoundException.cpp.

00056                                                                                                                                                                                           : _sElementName(sElementName),_iIndex(iIndex),_iIndexMin(iIndexMin),_iIndexMax(iIndexMax)
00057 {               
00058                 setLineNumber(iLineNumber);
00059                 setFileName(sFileName);
00060                 setType("IndexOutOfBoundException");
00061 
00062                 setDescription(makeDescription());
00063                 setReason(makeReason());
00064                 setOrigin(makeOrigin(sOrigin));
00065 }

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

Destructor.

Definition at line 23 of file IndexOutOfBoundException.cpp.

00024 {
00025 
00026 }


Member Function Documentation

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

The message provides by the index out of Bound exception.

Implements OutOfBoundException.

Definition at line 70 of file IndexOutOfBoundException.cpp.

References _iIndex, _iIndexMax, _iIndexMin, _sElementName, and ltos().

00071 { 
00072         std::string     sExceptionMessage       =       "The index entered ";
00073                         sExceptionMessage       +=      ltos(_iIndex);
00074                         sExceptionMessage       +=  " of the ";
00075                         sExceptionMessage       +=  _sElementName;
00076                         sExceptionMessage       +=      " variable must be in the allowed bound [" ;
00077                         sExceptionMessage       +=      ltos(_iIndexMin);
00078                         sExceptionMessage       +=      ","; 
00079                         sExceptionMessage       +=      ltos(_iIndexMax);
00080                         sExceptionMessage       +=      "["; 
00081         
00082         return sExceptionMessage;
00083 }

Here is the call graph for this function:

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

The origin message provides by the index out of Bound exception.

Implements OutOfBoundException.

Definition at line 97 of file IndexOutOfBoundException.cpp.

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

00098 {
00099         std::string     sOriginMessage = getFileName();
00100                         sOriginMessage+= " (l:";
00101                         sOriginMessage+= ltos(getLineNumber());
00102                         sOriginMessage+= ") ";
00103                         sOriginMessage+= sOrigin;
00104                         
00105         return sOriginMessage;
00106 }

Here is the call graph for this function:

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

The reason message provides by the index out of Bound exception.

Implements OutOfBoundException.

Definition at line 87 of file IndexOutOfBoundException.cpp.

References Exception::getType().

00088 {
00089         std::string     sReasonMessage = "DATA_OUT_OF_RANGE --> ";
00090                         sReasonMessage+= getType();
00091                         
00092         return sReasonMessage;
00093 }

Here is the call graph for this function:


Member Data Documentation

long IndexOutOfBoundException::_iIndex [private]
 

Definition at line 41 of file IndexOutOfBoundException.h.

Referenced by makeDescription().

long IndexOutOfBoundException::_iIndexMax [private]
 

Definition at line 45 of file IndexOutOfBoundException.h.

Referenced by makeDescription().

long IndexOutOfBoundException::_iIndexMin [private]
 

Definition at line 43 of file IndexOutOfBoundException.h.

Referenced by makeDescription().

std::string IndexOutOfBoundException::_sElementName [private]
 

Definition at line 39 of file IndexOutOfBoundException.h.

Referenced by makeDescription().


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