NotAllowedOperationException Class Reference

This class is used to manage exception when an operation is not allowed. More...

#include <NotAllowedOperationException.h>

Inherits OperationException.

Inheritance diagram for NotAllowedOperationException:

Inheritance graph
[legend]
Collaboration diagram for NotAllowedOperationException:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 NotAllowedOperationException () throw ()
 Default constructor.
virtual ~NotAllowedOperationException () throw ()
 Destructor.
 NotAllowedOperationException (std::string sOperationNotAllowed, std::string sReason, std::string sOrigin, std::string sFileName, unsigned int iLineNumber)
 This constructor requires 5 parameters :
  • the operation which is not allowed
  • the reason why it is not allowed
  • 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 std::string makeDescription ()
 The description message provides by the not allowed operation exception.
virtual std::string makeReason ()
 The reason message provides by the not allowed operation exception.
virtual std::string makeOrigin (std::string sOrigin)
 The origin message provides by the not allowed operation exception.

Private Attributes

std::string _sOperationNotAllowed
std::string _sReason

Detailed Description

This class is used to manage exception when an operation is not allowed.

Definition at line 15 of file NotAllowedOperationException.h.


Constructor & Destructor Documentation

NotAllowedOperationException::NotAllowedOperationException  )  throw ()
 

Default constructor.

Definition at line 15 of file NotAllowedOperationException.cpp.

00016 {
00017 
00018 }

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

Destructor.

Definition at line 20 of file NotAllowedOperationException.cpp.

00021 {
00022 
00023 }

NotAllowedOperationException::NotAllowedOperationException std::string  sOperationNotAllowed,
std::string  sReason,
std::string  sOrigin,
std::string  sFileName,
unsigned int  iLineNumber
 

This constructor requires 5 parameters :

  • the operation which is not allowed
  • the reason why it is not allowed
  • 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.

Definition at line 31 of file NotAllowedOperationException.cpp.

References makeDescription(), makeOrigin(), makeReason(), Exception::setDescription(), Exception::setFileName(), Exception::setLineNumber(), Exception::setOrigin(), Exception::setReason(), and Exception::setType().

00031                                                                                                                                                                           : _sOperationNotAllowed(sOperationNotAllowed),_sReason(sReason)
00032 {       
00033         setLineNumber(iLineNumber);
00034         setFileName(sFileName);
00035         setType("NotAllowedOperationException");
00036         
00037         setDescription(makeDescription());
00038         setReason(makeReason());
00039         setOrigin(makeOrigin(sOrigin));
00040 }

Here is the call graph for this function:


Member Function Documentation

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

The description message provides by the not allowed operation exception.

Implements OperationException.

Definition at line 43 of file NotAllowedOperationException.cpp.

References _sOperationNotAllowed, and _sReason.

Referenced by NotAllowedOperationException().

00044 {
00045         std::string     sExceptionMessage = "The operation ";
00046                         sExceptionMessage+= _sOperationNotAllowed;
00047                         sExceptionMessage+= " is not allowed and the reason is ";
00048                         sExceptionMessage+= _sReason;
00049 
00050         return sExceptionMessage;
00051 }

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

The origin message provides by the not allowed operation exception.

Implements OperationException.

Definition at line 64 of file NotAllowedOperationException.cpp.

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

Referenced by NotAllowedOperationException().

00065 {
00066         std::string     sOriginMessage = getFileName();
00067                         sOriginMessage+= " (l:";
00068                         sOriginMessage+= ltos(getLineNumber());
00069                         sOriginMessage+= ") ";
00070                         sOriginMessage+= sOrigin;
00071                         
00072         return sOriginMessage;
00073 }

Here is the call graph for this function:

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

The reason message provides by the not allowed operation exception.

Implements OperationException.

Definition at line 54 of file NotAllowedOperationException.cpp.

References Exception::getType().

Referenced by NotAllowedOperationException().

00055 {
00056         std::string     sReasonMessage = "OPERATION_NOT_ALLOWED --> ";
00057                         sReasonMessage+= getType();
00058                         
00059         return sReasonMessage;
00060 }

Here is the call graph for this function:


Member Data Documentation

std::string NotAllowedOperationException::_sOperationNotAllowed [private]
 

Definition at line 28 of file NotAllowedOperationException.h.

Referenced by makeDescription().

std::string NotAllowedOperationException::_sReason [private]
 

Reimplemented from Exception.

Definition at line 29 of file NotAllowedOperationException.h.

Referenced by makeDescription().


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