ders::ErrorException Class Reference

Exception class with embed errorCode. More...

#include <error.hpp>

Inheritance diagram for ders::ErrorException:

ders::Exception ders::destroyable ders::FileErrorException

List of all members.

Public Member Functions

virtual sh_text getClassName () const
virtual sh_text toText () const
virtual void destroy (mem_pool &mp2)
template<class E>
E * is ()
template<class E>
const E * is () const

Public Attributes

const error errorCode
const FileLine location
const sh_text message
const shException nested

Protected Member Functions

 ErrorException (const FileLine &loc, const ch_rng &msg, error err, shException nest)
void operator delete (void *ptr, size_t size)

Static Protected Member Functions

template<class T>
static void destroy_this (T *ptr, mem_pool &mp2)

Friends

shException newErrorException (const FileLine &loc, const ch_rng &msg, error err, shException nest)


Detailed Description

Exception class with embed errorCode.

Definition at line 135 of file error.hpp.


Constructor & Destructor Documentation

ders::ErrorException::ErrorException ( const FileLine loc,
const ch_rng msg,
error  err,
shException  nest 
) [protected]

Definition at line 375 of file error.cpp.

00376                          : Exception(loc, msg, nest), errorCode(err)
00377 {
00378 }


Member Function Documentation

sh_text ders::ErrorException::getClassName (  )  const [virtual]

Reimplemented from ders::Exception.

Reimplemented in ders::FileErrorException.

Definition at line 380 of file error.cpp.

00381 {
00382  return nt(message.pool(), "ders::ErrorException");
00383 }

sh_text ders::ErrorException::toText (  )  const [virtual]

Reimplemented from ders::Exception.

Reimplemented in ders::FileErrorException.

Definition at line 385 of file error.cpp.

00386 {
00387  return text_buf(getClassName())+" ["+location.file+":"+location.line+
00388    "], errorCode="+errorCode+":\""+error_message(message.pool(), errorCode)+
00389    "\", message: "+message;
00390 }

virtual void ders::ErrorException::destroy ( mem_pool mp2  )  [inline, virtual]

Reimplemented from ders::Exception.

Reimplemented in ders::FileErrorException.

Definition at line 152 of file error.hpp.

00152 { destroy_this(this, mp2); }

template<class E>
E * ders::Exception::is (  )  [inline, inherited]

Definition at line 205 of file exception.hpp.

00206 { return dynamic_cast<E*>(this); }

template<class E>
const E * ders::Exception::is (  )  const [inline, inherited]

Definition at line 208 of file exception.hpp.

00209 { return dynamic_cast<const E*>(this); }

template<class T>
void ders::destroyable::destroy_this ( T *  ptr,
mem_pool mp2 
) [inline, static, protected, inherited]

Definition at line 47 of file destroy.hpp.

00048 {
00049  assert(typeid(*ptr)==typeid(T));
00050 
00051  ptr->~T();
00052  mp2.deallocate(ptr, sizeof(T));
00053 }

void ders::destroyable::operator delete ( void *  ptr,
size_t  size 
) [inline, protected, inherited]

Definition at line 39 of file destroy.hpp.

00039 { hard_assert(false); }


Friends And Related Function Documentation

shException newErrorException ( const FileLine loc,
const ch_rng msg,
error  err,
shException  nest 
) [friend]


Member Data Documentation

Definition at line 147 of file error.hpp.

Definition at line 77 of file exception.hpp.

const sh_text ders::Exception::message [inherited]

Definition at line 78 of file exception.hpp.

Definition at line 79 of file exception.hpp.


The documentation for this class was generated from the following files:

Generated on Tue Dec 8 11:35:33 2009 for derslib by  doxygen 1.5.5