Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

EventHandler.h File Reference

#include "assa/Assure.h"

Go to the source code of this file.

Namespaces

namespace  ASSA

Typedefs

typedef unsigned long TimerId
 Timer Id is used in handle_timeout() calls.
typedef int(EventHandler::* EH_IO_Callback )(int)
 A type for the pointer to I/O-related callback member function of class EventHandler.

Enumerations

enum  EventType {
  READ_EVENT = 0x01, WRITE_EVENT = 0x02, EXCEPT_EVENT = 0x04, TIMEOUT_EVENT = 0x10,
  SIGNAL_EVENT = 0x20, RWE_EVENTS = 0x07, ALL_EVENTS = 0x37
}

Functions

bool isReadEvent (EventType e_)
bool isWriteEvent (EventType e_)
bool isExceptEvent (EventType e_)
bool isTimeoutEvent (EventType e_)
bool isSignalEvent (EventType e_)
bool isRWEEvents (EventType e_)
bool isAllEvents (EventType e_)


Detailed Description

An abstract interface for handling I/O events, timers, and such.

Definition in file EventHandler.h.


Typedef Documentation

int(EventHandler::* ASSA::EH_IO_Callback)(int)
 

A type for the pointer to I/O-related callback member function of class EventHandler.

These are:

  • handle_read ()
  • handle_write ()
  • handle_except ()

See also:
EventHandler

Definition at line 236 of file EventHandler.h.

typedef unsigned long ASSA::TimerId
 

Timer Id is used in handle_timeout() calls.

Definition at line 27 of file EventHandler.h.


Enumeration Type Documentation

enum ASSA::EventType
 

EventType defines events types that Reactor understands.

Enumeration values:
READ_EVENT  Notify when there will be at least 1 byte available for reading from IO channel without blocking .
WRITE_EVENT  Notify when there will be room for at least 1 byte to be written to IO channel without blocking.
EXCEPT_EVENT  Notify when there is an exception condition detected in TCP layer.
TIMEOUT_EVENT  Notify about expired timer.
SIGNAL_EVENT  Notify when UNIX signal is delivered by OS.
RWE_EVENTS  READ_EVENT | WRITE_EVENT | EXCEPT_EVENT.
ALL_EVENTS  Mask that includes all events.

Definition at line 34 of file EventHandler.h.

00035 {   
00036     READ_EVENT    = 0x01,   
00039     WRITE_EVENT   = 0x02,   
00042     EXCEPT_EVENT  = 0x04,   
00044     TIMEOUT_EVENT = 0x10,   
00045     SIGNAL_EVENT  = 0x20,   
00046     RWE_EVENTS    = 0x07,   
00047     ALL_EVENTS    = 0x37    
00048 };


Function Documentation

bool ASSA::isAllEvents EventType  e_  )  [inline]
 

Definition at line 87 of file EventHandler.h.

References ASSA::isExceptEvent(), ASSA::isReadEvent(), ASSA::isSignalEvent(), ASSA::isTimeoutEvent(), and ASSA::isWriteEvent().

00088 {
00089     return isReadEvent (e_) && isWriteEvent (e_) && isExceptEvent (e_) &&
00090         isSignalEvent (e_) && isTimeoutEvent (e_) ;
00091 }

bool ASSA::isExceptEvent EventType  e_  )  [inline]
 

Definition at line 63 of file EventHandler.h.

References ASSA::EXCEPT_EVENT.

Referenced by ASSA::isAllEvents(), ASSA::isRWEEvents(), ASSA::Reactor::registerIOHandler(), and ASSA::Reactor::removeHandler().

00064 {
00065     return (e_ & EXCEPT_EVENT) == EXCEPT_EVENT;
00066 }

bool ASSA::isReadEvent EventType  e_  )  [inline]
 

Definition at line 51 of file EventHandler.h.

References ASSA::READ_EVENT.

Referenced by ASSA::isAllEvents(), ASSA::isRWEEvents(), ASSA::Reactor::registerIOHandler(), and ASSA::Reactor::removeHandler().

00052 {     
00053     return (e_ & READ_EVENT) == READ_EVENT;
00054 }

bool ASSA::isRWEEvents EventType  e_  )  [inline]
 

Definition at line 81 of file EventHandler.h.

References ASSA::isExceptEvent(), ASSA::isReadEvent(), and ASSA::isWriteEvent().

00082 {
00083     return isReadEvent (e_) && isWriteEvent (e_) && isExceptEvent (e_);
00084 }

bool ASSA::isSignalEvent EventType  e_  )  [inline]
 

Definition at line 75 of file EventHandler.h.

References ASSA::SIGNAL_EVENT.

Referenced by ASSA::isAllEvents(), and ASSA::Reactor::registerIOHandler().

00076 {
00077     return (e_ & SIGNAL_EVENT) == SIGNAL_EVENT;
00078 }

bool ASSA::isTimeoutEvent EventType  e_  )  [inline]
 

Definition at line 69 of file EventHandler.h.

References ASSA::TIMEOUT_EVENT.

Referenced by ASSA::isAllEvents(), ASSA::Reactor::registerIOHandler(), and ASSA::Reactor::removeHandler().

00070 {
00071     return (e_ & TIMEOUT_EVENT) == TIMEOUT_EVENT;
00072 }

bool ASSA::isWriteEvent EventType  e_  )  [inline]
 

Definition at line 57 of file EventHandler.h.

References ASSA::WRITE_EVENT.

Referenced by ASSA::isAllEvents(), ASSA::isRWEEvents(), ASSA::Reactor::registerIOHandler(), and ASSA::Reactor::removeHandler().

00058 {
00059     return (e_ & WRITE_EVENT) == WRITE_EVENT;
00060 }


Generated on Mon Mar 26 22:47:36 2007 for libassa by  doxygen 1.4.2