X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Utils%2FException.cti;h=ea123701100f23b8a71f46539b020a5a3dd201fe;hb=d2459b6c8249291588fd3d0d125ed3d38e003b55;hp=bd89b67b521442d293b8e101e55fdc0605285bb2;hpb=96d3a2a43b4e6d7693a136a3adeb099440f19068;p=senf.git diff --git a/Utils/Exception.cti b/Utils/Exception.cti index bd89b67..ea12370 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,20 +26,39 @@ //#include "Exception.ih" // Custom includes +#include #define prefix_ inline ///////////////////////////////cti.p/////////////////////////////////////// -template -prefix_ senf::ErrnoException::ErrnoException() - : SystemException(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) {} -template -prefix_ senf::ErrnoException::ErrnoException(char const * where) - : SystemException(where,fixed_code) +template +prefix_ senf::WrapException::~WrapException() + throw() {} +template +prefix_ char const * senf::WrapException::what() + const throw() +{ + return message().c_str(); +} + /////////////////////////////cti.e/////////////////////////////////////// #undef prefix_