X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FException.cti;h=4fb5379f817e2c6a42bc57db323c1d5e08f5d996;hb=b8ca4a544cce3e6023bb56b712a03d6362f2bb79;hp=f0be6aa18ab4c1d1c41560fe7f97a09f71016de7;hpb=34378cabd0ef59515f60b8e535d50fd5488c84e2;p=senf.git diff --git a/Utils/Exception.cti b/Utils/Exception.cti index f0be6aa..4fb5379 100644 --- a/Utils/Exception.cti +++ b/Utils/Exception.cti @@ -1,8 +1,8 @@ // $Id$ // -// Copyright (C) 2007 -// Fraunhofer Institut fuer offene Kommunikationssysteme (FOKUS) -// Kompetenzzentrum fuer Satelitenkommunikation (SatCom) +// Copyright (C) 2007 +// Fraunhofer Institute for Open Communication Systems (FOKUS) +// Competence Center NETwork research (NET), St. Augustin, GERMANY // Stefan Bund // // This program is free software; you can redistribute it and/or modify @@ -26,24 +26,39 @@ //#include "Exception.ih" // Custom includes +#include #define prefix_ inline ///////////////////////////////cti.p/////////////////////////////////////// -template -prefix_ senf::ErrnoException::ErrnoException(std::string const & where) - : SystemException(where,fixed_code) +template +prefix_ typename boost::enable_if< boost::is_convertible, Exc & >::type +senf::operator<<(Exc const & exc, Arg const & arg) +{ + const_cast(exc).append( boost::lexical_cast(arg) ); + return const_cast(exc); +} + +/////////////////////////////////////////////////////////////////////////// +// senf::WrapExcecption + +template +prefix_ senf::WrapException::WrapException(BaseException const & base) + : ExceptionMixin(base.what()), BaseException(base) {} -// I for some reason need to explicitly define this constructor even though it's defined identically -// to the default version (even though SyntaxException has a custom copy constructor, the -// non-existent std::stringstream copy constructor will be called otherwise). I believe this is a -// g++ bug. -template -prefix_ senf::ErrnoException::ErrnoException(ErrnoException const & other) - : SystemException(other) +template +prefix_ senf::WrapException::~WrapException() + throw() {} +template +prefix_ char const * senf::WrapException::what() + const throw() +{ + return what_.c_str(); +} + /////////////////////////////cti.e/////////////////////////////////////// #undef prefix_