library of assembled shared sources

http://lass.cocamware.com

exception.h File Reference

#include "util_common.h"
#include <exception>
#include <string>
#include <sstream>

Include dependency graph for exception.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.


Data Structures

class  lass::util::experimental::RemoteExceptionBase
class  lass::util::experimental::RemoteExceptionWrapper< LocalException >
class  lass::util::Exception
 type of all exceptions in lass More...
class  lass::util::experimental::ExceptionMixin< ExceptionType, ParentType >
class  lass::util::KeyError
class  lass::util::ValueError

Namespaces

namespace  lass
 Library for Assembled Shared Sources.
namespace  lass::util
 general utility, debug facilities, .
namespace  lass::util::experimental

Defines

#define LASS_UTIL_EXCEPTION_PRIVATE_IMPL(t_exception)
#define LASS_THROW_EX(t_exception, s_message)
#define LASS_THROW(s_message)   LASS_THROW_EX(::lass::util::Exception, s_message)
 LASS_THROW_EX for lass::util::Exception.
#define LASS_CATCH_TO_WARNING


Detailed Description

Author:
Bram de Greve (bramz@users.sourceforge.net)

Tom De Muer (tomdemuer@users.sourceforge.net)

*** BEGIN LICENSE INFORMATION ***

The contents of this file are subject to the Common Public Attribution License Version 1.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://lass.sourceforge.net/cpal-license. The License is based on the Mozilla Public License Version 1.1 but Sections 14 and 15 have been added to cover use of software over a computer network and provide for limited attribution for the Original Developer. In addition, Exhibit A has been modified to be consistent with Exhibit B.

Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License.

The Original Code is LASS - Library of Assembled Shared Sources.

The Initial Developer of the Original Code is Bram de Greve and Tom De Muer. The Original Developer is the Initial Developer.

All portions of the code written by the Initial Developer are: Copyright (C) 2004-2007 the Initial Developer. All Rights Reserved.

Contributor(s):

Alternatively, the contents of this file may be used under the terms of the GNU General Public License Version 2 or later (the GPL), in which case the provisions of GPL are applicable instead of those above. If you wish to allow use of your version of this file only under the terms of the GPL and not to allow others to use your version of this file under the CPAL, indicate your decision by deleting the provisions above and replace them with the notice and other provisions required by the GPL License. If you do not delete the provisions above, a recipient may use your version of this file under either the CPAL or the GPL.

*** END LICENSE INFORMATION ***

Definition in file exception.h.


Define Documentation

#define LASS_UTIL_EXCEPTION_PRIVATE_IMPL ( t_exception   ) 

Value:

virtual void doThrowSelf() const { throw *this; }\
        virtual ::std::auto_ptr< ::lass::util::experimental::RemoteExceptionBase > doClone() const \
        { \
            return ::std::auto_ptr< ::lass::util::experimental::RemoteExceptionBase >(new t_exception(*this)); \
        }\

Definition at line 60 of file exception.h.

#define LASS_THROW_EX ( t_exception,
s_message   )  [related]

Value:

do\
    {\
        ::std::ostringstream lassUtilExceptionImplBuffer;\
        lassUtilExceptionImplBuffer << s_message;\
        throw t_exception(lassUtilExceptionImplBuffer.str(), LASS_PRETTY_FUNCTION);\
    }\
    while (false)
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.

Referenced by lass::io::impl::SocketImpl::accept(), lass::io::impl::SocketImpl::bind(), lass::util::experimental::Future< T >::bind(), lass::prim::StrictMinMax::checkMinMax(), lass::io::impl::SocketImpl::closeSocket(), lass::io::impl::SocketImpl::connect(), lass::io::ArgValue< T >::doSetValue(), lass::prim::StrictNoDegenerate::enforceEdge(), lass::prim::NoDegenerate::enforceEdge(), lass::prim::StrictNoDegenerate::enforceNonZeroSignedArea(), lass::prim::NoDegenerate::enforceNonZeroSignedArea(), lass::prim::Bounded::enforceRange(), lass::prim::StrictNoDegenerate::enforceSimple(), lass::io::Image::findFormat(), lass::prim::Transformation3D< T >::inverse(), lass::prim::Transformation2D< T >::inverse(), lass::io::impl::SocketImpl::listen(), lass::util::ObjectFactory< ObjectType, KeyType, PointerType, MakerType >::make(), lass::util::ThrowOnUnknownVisit::onUnknownPostVisit(), lass::util::ThrowOnUnknownVisit::onUnknownPreVisit(), lass::io::Image::open(), lass::io::Image::openIgi(), lass::io::Image::openLass(), lass::io::Image::openPfm(), lass::io::Image::openRadianceHdr(), lass::io::impl::SocketImpl::openSocket(), lass::io::Image::openTarga(), lass::io::Image::openTargaTrueColor(), lass::util::CallbackR9< R, P1, P2, P3, P4, P5, P6, P7, P8, P9 >::operator()(), lass::util::CallbackR8< R, P1, P2, P3, P4, P5, P6, P7, P8 >::operator()(), lass::util::CallbackR7< R, P1, P2, P3, P4, P5, P6, P7 >::operator()(), lass::util::CallbackR6< R, P1, P2, P3, P4, P5, P6 >::operator()(), lass::util::CallbackR5< R, P1, P2, P3, P4, P5 >::operator()(), lass::util::CallbackR4< R, P1, P2, P3, P4 >::operator()(), lass::util::CallbackR3< R, P1, P2, P3 >::operator()(), lass::util::CallbackR2< R, P1, P2 >::operator()(), lass::util::CallbackR15< R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14, P15 >::operator()(), lass::util::CallbackR14< R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13, P14 >::operator()(), lass::util::CallbackR13< R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12, P13 >::operator()(), lass::util::CallbackR12< R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11, P12 >::operator()(), lass::util::CallbackR11< R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10, P11 >::operator()(), lass::util::CallbackR10< R, P1, P2, P3, P4, P5, P6, P7, P8, P9, P10 >::operator()(), lass::util::CallbackR1< R, P1 >::operator()(), lass::util::CallbackR0< R >::operator()(), lass::util::impl::IndexRaiser::raise(), lass::util::impl::ComRaiser::raise(), lass::util::impl::ClibRcRaiser::raise(), lass::util::impl::ClibRaiser::raise(), lass::util::impl::ZeroRaiser::raise(), lass::util::impl::DefaultRaiser::raise(), lass::io::Image::HeaderPfm::readFrom(), lass::io::Image::HeaderRadianceHdr::readFrom(), lass::io::impl::SocketImpl::receive(), lass::io::Image::save(), lass::io::Image::saveRadianceHdr(), lass::io::impl::SocketImpl::send(), lass::prim::StrictMinMax::setMax(), lass::prim::StrictMinMax::setMin(), and lass::io::impl::SocketImpl::SocketImpl().

#define LASS_THROW ( s_message   )     LASS_THROW_EX(::lass::util::Exception, s_message)

LASS_THROW_EX for lass::util::Exception.

LASS_THROW(something) is identical to LASS_THROW_EX(util::Exception, something)

Definition at line 249 of file exception.h.

Referenced by lass::spat::QuadTree< ObjectType, ObjectTraits >::add(), lass::io::impl::BinaryIMemoryMapImpl::BinaryIMemoryMapImpl(), lass::util::impl::bindThread(), lass::prim::TriangleMesh3D< T, BoundingVolumeHierarchy, SplitHeuristics >::buildMesh(), lass::python::impl::FunctorPythonRBase< R >::call(), lass::io::ArgValue< T >::checkMode(), lass::spat::PlanarMesh::connect(), lass::util::impl::CrashDumpImpl::CrashDumpImpl(), lass::io::BinaryISocket::doSeekg(), lass::io::BinaryOSocket::doSeekp(), lass::io::BinaryISocket::doTellg(), lass::io::BinaryOSocket::doTellp(), lass::spat::PlanarMesh::edgeHandleRef(), lass::spat::PlanarMesh::faceHandleRef(), lass::python::impl::fetchAndThrowPythonException(), lass::io::ProxyOStream::filter(), lass::io::Image::filterMedian(), lass::num::SplineBezierPath< ScalarType, DataType, DataTraits >::finalInit(), lass::num::FirFilter< T, InputIterator, OutputIterator >::FirFilter(), lass::num::I2dB(), lass::spat::PlanarMesh::inConvexCell(), lass::num::SplineLinear< ScalarType, DataType, DataTraits >::init(), lass::num::SplineCubic< ScalarType, DataType, DataTraits >::init(), lass::num::IirFilter< T, InputIterator, OutputIterator >::init(), lass::util::impl::CrashDumpImpl::init(), lass::spat::PlanarMesh::insertEdge(), lass::spat::MeshInterpolator< T, TPI >::insertPolyLine(), lass::spat::MeshInterpolator< T, TPI >::insertSite(), lass::util::impl::ThreadInternal::join(), lass::util::Dictionary< KeyType, ValueType, KeyLess, ValueLess >::key(), lass::util::impl::lass_getenv(), lass::util::impl::CrashDumpImpl::loadLibrary(), lass::util::impl::MutexInternal::lock(), lass::util::CloneFactory< AbstractProduct, IdentifierType, ProductCloner >::make(), lass::spat::PlanarMesh::markPolygons(), lass::spat::KdTree< ObjectType, ObjectTraits >::nearestNeighbour(), lass::io::Image::open(), lass::io::Logger::openLog(), lass::util::IdGenerator< T >::operator()(), lass::util::Dictionary< KeyType, ValueType, KeyLess, ValueLess >::operator[](), lass::spat::PlanarMesh::org(), lass::num::p2dB(), lass::spat::PlanarMesh::pointHandleRef(), lass::spat::PlanarMesh::pointLocate(), lass::spat::PlanarMesh::pointShoot(), lass::spat::PlanarMesh::pointWalk(), lass::spat::PlanarMesh::polygon(), lass::python::impl::PyMap::PyMap(), lass::spat::KdTree< ObjectType, ObjectTraits >::rangeSearch(), lass::prim::XYZW::reset(), lass::prim::XYZ::reset(), lass::prim::XY::reset(), lass::util::impl::ThreadInternal::run(), lass::spat::PlanarMesh::safeSplitEdge(), lass::io::Image::save(), lass::io::ProxyOStream::setFilter(), lass::util::setProcessPriority(), lass::util::impl::ThreadInternal::sleep(), lass::util::stringCast(), lass::io::ArgParser::subscribe(), lass::spat::PlanarMesh::swap(), lass::util::impl::ThreadLocalStorageInternal::ThreadLocalStorageInternal(), lass::spat::PlanarMesh::triangle(), lass::prim::triangulate(), lass::util::impl::MutexInternal::tryLock(), lass::util::impl::MutexInternal::unlock(), lass::num::W2dB(), lass::util::impl::ConditionInternal::wait(), lass::spat::PlanarMesh::walk(), lass::spat::PlanarMesh::walkTillConstrained(), lass::prim::XY::XY(), lass::prim::XYZ::XYZ(), and lass::prim::XYZW::XYZW().

#define LASS_CATCH_TO_WARNING

Value:

catch (const ::std::exception& error)\
    {\
        std::cerr << "[LASS RUN MSG] UNDEFINED BEHAVIOUR WARNING: Exception caught in "\
            << LASS_PRETTY_FUNCTION << ":\n" << error.what() << std::endl;\
    }\
    catch (...)\
    {\
        std::cerr << "[LASS RUN MSG] UNDEFINED BEHAVIOUR WARNING: Unknown exception caught in "\
            << LASS_PRETTY_FUNCTION << std::endl;\
    }\
catches all exceptions and prints an undefined behaviour warning to std::cerr

Definition at line 257 of file exception.h.

Referenced by lass::util::ThreadPool< TaskType, ConsumerType, IdlePolicy, ParticipationPolicy >::stopThreads(), and lass::util::ThreadPool< TaskType, ConsumerType, IdlePolicy, ParticipationPolicy >::~ThreadPool().


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