IndexOutOfBoundException.cpp

Go to the documentation of this file.
00001 // IndexOutOfBoundException.cpp: implementation of the IndexOutOfBoundException class.
00002 //
00004 
00005 #ifdef WIN32 
00006 #pragma warning(disable:4786)
00007 #endif
00008 #include "IndexOutOfBoundException.h"
00009 
00011 // Construction/Destruction
00013 
00015 //##ModelId=43834AC0029D
00016 IndexOutOfBoundException::IndexOutOfBoundException() throw()
00017 {
00018 
00019 }
00020 
00022 //##ModelId=43834AC002B1
00023 IndexOutOfBoundException::~IndexOutOfBoundException() throw()
00024 {
00025 
00026 }
00027 
00033 //##ModelId=43834AC0029E
00034 IndexOutOfBoundException::IndexOutOfBoundException(std::string sElementName,long iIndex,long iIndexMin,long iIndexMax) throw() : _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 }
00045 
00046 
00055 //##ModelId=43834AC002A3
00056 IndexOutOfBoundException::IndexOutOfBoundException(std::string sElementName,long iIndex,long iIndexMin,long iIndexMax,std::string sOrigin,std::string sFileName,unsigned int iLineNumber) throw() : _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 }
00066 
00067 
00069 //##ModelId=43834AC002B3
00070 std::string IndexOutOfBoundException::makeDescription()
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 }
00084 
00086 //##ModelId=43834AC002B5
00087 std::string IndexOutOfBoundException::makeReason()
00088 {
00089         std::string     sReasonMessage = "DATA_OUT_OF_RANGE --> ";
00090                         sReasonMessage+= getType();
00091                         
00092         return sReasonMessage;
00093 }
00094 
00096 //##ModelId=43834AC002BB
00097 std::string IndexOutOfBoundException::makeOrigin(std::string sOrigin)
00098 {
00099         std::string     sOriginMessage = getFileName();
00100                         sOriginMessage+= " (l:";
00101                         sOriginMessage+= ltos(getLineNumber());
00102                         sOriginMessage+= ") ";
00103                         sOriginMessage+= sOrigin;
00104                         
00105         return sOriginMessage;
00106 }

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