21#ifndef G_NET_EXCEPTION_SINK_H
22#define G_NET_EXCEPTION_SINK_H
33 class ExceptionSinkUnbound ;
137 void call(
std::exception & e ,
bool done ) ;
143 void reset() noexcept ;
147 bool set() const noexcept ;
An abstract interface for handling exceptions thrown out of event-loop callbacks (socket/future event...
A potential ExceptionSink that is realised by bind()ing an exception source pointer.
ExceptionSinkUnbound(ExceptionHandler *eh)
Constructor.
ExceptionSink bind(ExceptionSource *source) const
Returns a sink object with the source pointer set.
A tuple containing an ExceptionHandler interface pointer and a bound 'exception source' pointer.
ExceptionHandler * eh() const noexcept
Returns the exception handler pointer.
ExceptionSource * esrc() const noexcept
Returns the exception source pointer.
void call(std::exception &e, bool done)
Calls the exception handler's onException() method.
void reset() noexcept
Resets the object as if default constructed.
bool set() const noexcept
Returns true if eh() is not null.
static ExceptionSink logOnly()
A factory function for an exception handler that logs the exception as an error but does not re-throw...
ExceptionSink() noexcept
Default constructor for an exception handler that rethrows.
static ExceptionSink rethrow()
A factory function for an exception handler that rethrows.
A mixin base class that identifies the source of an exception when delivered to GNet::ExceptionHandle...