Main Page   Class Hierarchy   Compound List   File List   Compound Members   File Members  

IOHandler Class Reference

Inherited by IOEventLoop::wake_handler, NetHandler< Lock > [private], TCPAcceptor< T, Arg > [private], and TermHandler [private].

List of all members.


Detailed Description

A handler that receives notifications on events on a file descriptor.

The subclass may call want_read(bool) to enable/disable read events, and want_write(bool) to enable/disable write events.

Handlers are only active when attached to both an event loop (via the constructor or set_loop) and a file descriptor (via the constructor or set_ioh()).


Public Methods

void set_loop (IOEventLoop &_loop)
 Attaches the handler to an event loop.

IOEventLoopget_loop ()
 Returns the event loop to which the handler is attached.

bool is_owned ()
 Should this handler refrain from deleting itself on connection close?

void set_owned (bool o)
 Should this handler refrain from deleting itself on connection close?

IOHandle get_ioh ()
 Returns the file descriptor to which the handler is attached.


Protected Methods

 IOHandler (IOHandle ioh=IOHandle())
 Constructor.

 IOHandler (IOEventLoop &loop, IOHandle ioh=IOHandle(), bool owned=false)
 Constructor.

virtual ~IOHandler ()
 Destructor.

void set_ioh (IOHandle ioh)
 Attaches the handler to a file descriptor.

virtual void ravail ()
 Called by the event loop when bytes are available on the file descriptor (if want_read(true) has been called).

virtual void wavail ()
 Called by the event loop when bytes may be written on the file descriptor (if want_write(true) has been called).

void want_read (bool)
 Invoked by the subclass to signal interest in read availability.

void want_write (bool)
 Invoked by the subclass to signal interest in write availability.


Friends

class IOEventLoop


Constructor & Destructor Documentation

IOHandler::IOHandler IOHandle    ioh = IOHandle() [protected]
 

Constructor.

IOHandler::IOHandler IOEventLoop   loop,
IOHandle    ioh = IOHandle(),
bool    owned = false
[protected]
 

Constructor.

virtual IOHandler::~IOHandler   [protected, virtual]
 

Destructor.


Member Function Documentation

IOHandle IOHandler::get_ioh  
 

Returns the file descriptor to which the handler is attached.

IOEventLoop* IOHandler::get_loop  
 

Returns the event loop to which the handler is attached.

bool IOHandler::is_owned  
 

Should this handler refrain from deleting itself on connection close?

virtual void IOHandler::ravail   [protected, virtual]
 

Called by the event loop when bytes are available on the file descriptor (if want_read(true) has been called).

void IOHandler::set_ioh IOHandle    ioh [protected]
 

Attaches the handler to a file descriptor.

void IOHandler::set_loop IOEventLoop   _loop
 

Attaches the handler to an event loop.

void IOHandler::set_owned bool    o
 

Should this handler refrain from deleting itself on connection close?

void IOHandler::want_read bool    [protected]
 

Invoked by the subclass to signal interest in read availability.

void IOHandler::want_write bool    [protected]
 

Invoked by the subclass to signal interest in write availability.

virtual void IOHandler::wavail   [protected, virtual]
 

Called by the event loop when bytes may be written on the file descriptor (if want_write(true) has been called).


Friends And Related Function Documentation

friend class IOEventLoop [friend]
 


The documentation for this class was generated from the following file:
Generated on Fri Dec 20 13:35:11 2002 for NMSTL