library of assembled shared sources

http://lass.cocamware.com

lass::util::Exception Class Reference

type of all exceptions in lass More...

#include <exception.h>

Inheritance diagram for lass::util::Exception:

Inheritance graph
[legend]
Collaboration diagram for lass::util::Exception:

Collaboration graph
[legend]

Public Member Functions

 Exception (const std::string &message, const std::string &location)
 Exception (const std::string &message)
 Exception ()
 ~Exception () throw ()
virtual const char * what () const throw ()
 return message in STL style
const std::string & message () const
 return string with error message
const std::string & location () const
 return string with location info where exception is thrown
void throwSelf () const
std::auto_ptr
< RemoteExceptionBase > 
clone () const

Private Attributes

std::string message_
std::string location_

Related Functions

(Note that these are not member functions.)

 LASS_THROW_EX(t_exception, s_message)

Detailed Description

type of all exceptions in lass

Author:
Bram de Greve [Bramz]
See also:
LASS_THROW

Definition at line 113 of file exception.h.


Constructor & Destructor Documentation

lass::util::Exception::Exception ( const std::string &  message,
const std::string &  location 
) [inline]

Definition at line 119 of file exception.h.

lass::util::Exception::Exception ( const std::string &  message  )  [inline, explicit]

Definition at line 126 of file exception.h.

lass::util::Exception::Exception (  )  [inline]

Definition at line 133 of file exception.h.

lass::util::Exception::~Exception (  )  throw () [inline]

Definition at line 140 of file exception.h.


Member Function Documentation

virtual const char* lass::util::Exception::what (  )  const throw () [inline, virtual]

return message in STL style

Definition at line 144 of file exception.h.

References message_.

const std::string& lass::util::Exception::message (  )  const [inline]

const std::string& lass::util::Exception::location (  )  const [inline]

return string with location info where exception is thrown

Definition at line 158 of file exception.h.

References location_.

Referenced by lass::python::impl::handleLassException().

void lass::util::experimental::RemoteExceptionBase::throwSelf (  )  const [inline, inherited]

std::auto_ptr<RemoteExceptionBase> lass::util::experimental::RemoteExceptionBase::clone (  )  const [inline, inherited]


Friends And Related Function Documentation

LASS_THROW_EX ( t_exception,
s_message   )  [related]

To throw an exception like util::Exception that accepts a message and a location string, you can supply those strings yourself, ore you can use this macro for your convenience.

This macro will fill in the location by itself so that you only have to worry about the message. And as an extra, the message is streamed, so you can use the regular operator<< to concatenate variables in the message.

  int foo = -5;
  if (foo < 0)
  {
      LASS_THROW_EX(util::Exception, "foo '" << foo << "' is less than zero");
  }

Definition at line 233 of file exception.h.


Field Documentation

std::string lass::util::Exception::message_ [private]

Definition at line 166 of file exception.h.

Referenced by message(), and what().

std::string lass::util::Exception::location_ [private]

Definition at line 167 of file exception.h.

Referenced by location().


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

Generated on Mon Nov 10 14:22:17 2008 for Library of Assembled Shared Sources by doxygen 1.5.7.1
SourceForge.net Logo