21#ifndef G_NET_FUTURE_EVENT_H
22#define G_NET_FUTURE_EVENT_H
33 class FutureEventHandler ;
34 class FutureEventImp ;
84 G_EXCEPTION( Error ,
tx(
"FutureEvent error") )
97 static
bool send( HANDLE
handle ,
bool close = true ) noexcept ;
119 std::unique_ptr<FutureEventImp> m_imp ;
A lightweight object containing an ExceptionHandler pointer, optional ExceptionSource pointer and opt...
A callback interface for GNet::FutureEvent.
virtual void onFutureEvent()=0
Callback function that delivers the future event.
virtual ~FutureEventHandler()=default
Destructor.
A FutureEvent object can be used to send a one-shot event between threads via the event loop,...
FutureEvent(FutureEventHandler &, EventState)
Constructor. Installs itself in the event loop.
static bool send(HANDLE handle, bool close=true) noexcept
Pokes an event into the main event loop so that the FutureEventHandler callback is called asynchronou...
HANDLE handle() noexcept
Extracts a handle that can be passed between threads and used in send().
static HANDLE createHandle()
Used by some event loop implementations to create the underlying synchronisation object.
~FutureEvent()
Destructor.
constexpr const char * tx(const char *p) noexcept
A briefer alternative to G::gettext_noop().