NoSuchElementException Class Reference

This class is used to manage exception due to a element which can not be found. More...

#include <NoSuchElementException.h>

Inherits Exception.

Inheritance diagram for NoSuchElementException:

Inheritance graph
[legend]
Collaboration diagram for NoSuchElementException:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 NoSuchElementException () throw ()
 Default constructor.
 NoSuchElementException (std::string sElementName) throw ()
 This constructor requires 1 parameter :
  • the name of the not found element ModelId=43834ABF0125.

 NoSuchElementException (std::string sElementName, std::string sOrigin, std::string sFileName, unsigned int iLineNumber) throw ()
 This constructor requires 4 parameters :
  • the name of the not found element
  • 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 ~NoSuchElementException () throw ()
 Destructor.
virtual std::string makeDescription ()
 The message provides by the no such element exception.
virtual std::string makeReason ()
 The reason message provides by the no such element exception.
virtual std::string makeOrigin (std::string sOrigin)
 The origin message provides by the no such element exception.

Private Attributes

std::string _sElementName

Detailed Description

This class is used to manage exception due to a element which can not be found.

Definition at line 18 of file NoSuchElementException.h.


Constructor & Destructor Documentation

NoSuchElementException::NoSuchElementException  )  throw ()
 

Default constructor.

Definition at line 16 of file NoSuchElementException.cpp.

00017 {
00018 
00019 }

NoSuchElementException::NoSuchElementException std::string  sElementName  )  throw ()
 

This constructor requires 1 parameter :

  • the name of the not found element ModelId=43834ABF0125.

Definition at line 24 of file NoSuchElementException.cpp.

00024                                                                               : _sElementName(sElementName)
00025 {       
00026         setType("NoSuchElementException");
00027         setLineNumber(0);
00028         setFileName("");
00029         
00030         setDescription(makeDescription());
00031         setReason(makeReason());
00032         setOrigin("");
00033 
00034 }

NoSuchElementException::NoSuchElementException std::string  sElementName,
std::string  sOrigin,
std::string  sFileName,
unsigned int  iLineNumber
throw ()
 

This constructor requires 4 parameters :

  • the name of the not found element
  • 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=43834ABF0127

Definition at line 42 of file NoSuchElementException.cpp.

00042                                                                                                                                              : _sElementName(sElementName)
00043 {       
00044         setType("NoSuchElementException");
00045         setLineNumber(iLineNumber);
00046         setFileName(sFileName);
00047         
00048         setDescription(makeDescription());
00049         setReason(makeReason());
00050         setOrigin(makeOrigin(sOrigin));
00051 }

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

Destructor.

Definition at line 57 of file NoSuchElementException.cpp.

00058 {
00059 
00060 }


Member Function Documentation

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

The message provides by the no such element exception.

Implements Exception.

Definition at line 64 of file NoSuchElementException.cpp.

References _sElementName.

00065 {
00066         std::string     sExceptionMessage = "The wanted element ";
00067                         sExceptionMessage+= _sElementName;
00068                         sExceptionMessage+= " doesn't exist !!!";
00069         return sExceptionMessage;
00070 }

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

The origin message provides by the no such element exception.

Implements Exception.

Definition at line 85 of file NoSuchElementException.cpp.

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

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

Here is the call graph for this function:

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

The reason message provides by the no such element exception.

Implements Exception.

Definition at line 75 of file NoSuchElementException.cpp.

References Exception::getType().

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

Here is the call graph for this function:


Member Data Documentation

std::string NoSuchElementException::_sElementName [private]
 

Definition at line 38 of file NoSuchElementException.h.

Referenced by makeDescription().


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