User Manual, Developers Guide and API Documentation

wns::Exception Class Reference

Base class of all WNS exceptions. More...

#include <Exception.hpp>

Inherits wns::IOutputStreamable, and exception.

Inherited by rise::plmapping::PhyMode::UndefinedException, rise::scenario::pathloss::Deny::Exception, rise::scenario::Propagation::NoModelError, wimac::service::CIDNotFound, wns::Assure::Exception, wns::ChamaeleonBase::BadCast, wns::CloneNotSupported, wns::container::RangeMap< RangeType, ValueType, CleanupStrategy >::Exception, wns::container::Registry< KEY, ELEMENT, CLEANUPPOLICY, SORTINGPOLICY >::DuplicateKeyValue, wns::container::Registry< KEY, ELEMENT, CLEANUPPOLICY, SORTINGPOLICY >::UnknownKeyValue, wns::events::scheduler::ICommand::CancelException [private], wns::events::scheduler::IEvent::CancelException [private], wns::ldk::FlowSeparator::InstanceNotFound, wns::ldk::fun::FindFriendException, wns::ldk::harq::softcombining::Container< T >::InvalidPositionInTB, wns::ldk::harq::softcombining::Container< T >::InvalidRV, wns::NullException, wns::probe::bus::context::DuplicateKey, wns::probe::bus::context::NotFound, wns::probe::bus::context::TypeError, wns::probe::bus::detail::Table< T >::OutOfRange, wns::scheduler::queue::detail::InnerQueue::RequestBelowMinimumSize, wns::scheduler::queue::detail::InnerQueue::RetrieveException, wns::simulator::ModuleDependencyMismatchException, and wns::simulator::StatusReport::WriteError.

Collaboration diagram for wns::Exception:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 Exception (const std::string &s)
 String s is set as reason.
 Exception ()
 Creates empty Exception (contains no reason).
const BacktracegetBacktrace () const
 Return the backtrace of the stack at creation time of this Exception.
virtual const char * what () const throw ()
 Return the reason as C-style character string.
virtual ~Exception () throw ()
 Destructor.

Protected Member Functions

virtual std::string doToString () const
 Represent the Exception as std::string.

Private Attributes

Backtrace backtrace_
 Backtrace of the current stack, taken at creation of time of the Exception.
std::string reason_
 String containing the reason for the exception.

Friends

template<typename T>
Exceptionoperator<< (Exception &e, const T &t)
 Allows using Exceptions like streams.


Detailed Description

Author:
Marc Schinnenburg <marc@schinnenburg.net>
This Exception also contains a backtrace of the program stack as it was at creation time of the Exception. The backtrace can be accesed with exception.getBacktrace(). If NDEBUG is defined the backtrace will be empty (the overhead to generate the backtrace vanishes).

Definition at line 48 of file Exception.hpp.


Constructor & Destructor Documentation

Exception::Exception (  ) 

Definition at line 32 of file Exception.cpp.

Exception::Exception ( const std::string &  s  )  [explicit]

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


Member Function Documentation

std::string Exception::doToString (  )  const [protected, virtual]

Implements wns::IOutputStreamable.

Definition at line 67 of file Exception.cpp.

const wns::Backtrace & Exception::getBacktrace (  )  const

Can be used in streams like this:

 std::cerr << exception.getBacktrace() << std::endl;

Definition at line 61 of file Exception.cpp.

const char * Exception::what (  )  const throw () [virtual]

Definition at line 55 of file Exception.cpp.


Friends And Related Function Documentation

template<typename T>
Exception& operator<< ( Exception e,
const T &  t 
) [friend]

Usgae: excp << "Reason: invalid argument";

Definition at line 97 of file Exception.hpp.


Member Data Documentation

Definition at line 122 of file Exception.hpp.

std::string wns::Exception::reason_ [private]

Definition at line 116 of file Exception.hpp.


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

Generated on Sat May 26 03:32:50 2012 for openWNS by  doxygen 1.5.5