31 namespace EventEmitterImp
33 template <
typename T>
void raiseEvent( T handler , EventState & es ) ;
40 EventHandler * m_handler ;
41 void operator()() { (m_handler->*m_method)() ; }
47 EventHandler * m_handler ;
48 EventHandler::Reason m_reason ;
49 void operator()() { (m_handler->*m_method)( m_reason ) ; }
51 Binder1 bind( Binder1::Method method , EventHandler * handler ) {
return {method,handler} ; }
52 Binder2 bind( Binder2::Method method , EventHandler * handler , EventHandler::Reason reason ) {
return {method,handler,reason} ; }
57void GNet::EventEmitterImp::raiseEvent( T handler , EventState & es )
61 EventLoggingContext set_logging_context( es ) ;
68 if( es.hasExceptionHandler() )
69 es.doOnException( e ,
true ) ;
73 catch( std::exception & e )
75 if( es.hasExceptionHandler() )
76 es.doOnException( e ,
false ) ;
86 namespace imp = EventEmitterImp ;
93 namespace imp = EventEmitterImp ;
100 namespace imp = EventEmitterImp ;
An exception class that is caught separately by GNet::EventEmitter and GNet::TimerList so that onExce...
static void raiseReadEvent(EventHandler *, EventState &)
Calls readEvent() on the event handler and catches any exceptions and delivers them to the EventState...
static void raiseOtherEvent(EventHandler *, EventState &, EventHandler::Reason)
Calls otherEvent() on the event handler and catches any exceptions and delivers them to the EventStat...
static void raiseWriteEvent(EventHandler *, EventState &)
Calls writeEvent() on the event handler and catches any exceptions and delivers them to the EventStat...
A base class for classes that have a file descriptor and handle asynchronous events from the event lo...
virtual void readEvent()
Called for a read event.
virtual void writeEvent()
Called for a write event.
virtual void otherEvent(Reason)
Called for a socket-exception event, or a socket-close event on windows.
A lightweight object containing an ExceptionHandler pointer, optional ExceptionSource pointer and opt...