NullPointerException Class Reference

This class is used to manage exception due to a null pointer. More...

#include <NullPointerException.h>

Inherits Exception.

Inheritance diagram for NullPointerException:

Inheritance graph
[legend]
Collaboration diagram for NullPointerException:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 NullPointerException () throw ()
 Default constructor.
 NullPointerException (std::string sElementName) throw ()
 This constructor requires 1 parameter :
  • the name of the null pointer element ModelId=43834ABF00F8.

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

Private Attributes

std::string _sElementName

Detailed Description

This class is used to manage exception due to a null pointer.

Definition at line 16 of file NullPointerException.h.


Constructor & Destructor Documentation

NullPointerException::NullPointerException  )  throw ()
 

Default constructor.

Definition at line 16 of file NullPointerException.cpp.

00017 {
00018 
00019 }

NullPointerException::NullPointerException std::string  sElementName  )  throw ()
 

This constructor requires 1 parameter :

  • the name of the null pointer element ModelId=43834ABF00F8.

Definition at line 31 of file NullPointerException.cpp.

00031                                                                           : _sElementName(sElementName)
00032 {       
00033         setType("NullPointerException");
00034         setLineNumber(0);
00035         setFileName("");
00036         
00037         setDescription(makeDescription());
00038         setReason(makeReason());
00039         setOrigin("");
00040 
00041 }

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

This constructor requires 4 parameters :

  • the name of the null pointer 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=43834ABF00FA

Definition at line 49 of file NullPointerException.cpp.

00049                                                                                                                                         : _sElementName(sElementName)
00050 {       
00051         setType("NullPointerException");
00052         setLineNumber(iLineNumber);
00053         setFileName(sFileName);
00054         
00055         setDescription(makeDescription());
00056         setReason(makeReason());
00057         setOrigin(makeOrigin(sOrigin));
00058 }

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

Destructor.

Definition at line 22 of file NullPointerException.cpp.

00023 {
00024 
00025 }


Member Function Documentation

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

The message provides by the null pointer exception.

Implements Exception.

Definition at line 63 of file NullPointerException.cpp.

References _sElementName.

00064 {
00065         std::string     sExceptionMessage = "The element ";
00066                         sExceptionMessage+= _sElementName;
00067                         sExceptionMessage+= " is a null pointer !!!";
00068         return sExceptionMessage;
00069 }

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

The origin message provides by the null pointer exception.

Implements Exception.

Definition at line 84 of file NullPointerException.cpp.

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

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

Here is the call graph for this function:

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

The reason message provides by the null pointer exception.

Implements Exception.

Definition at line 74 of file NullPointerException.cpp.

References Exception::getType().

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

Here is the call graph for this function:


Member Data Documentation

std::string NullPointerException::_sElementName [private]
 

Definition at line 38 of file NullPointerException.h.

Referenced by makeDescription().


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