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

io_handler Class Reference

Inherited by io_event_loop::wake_handler, net_handler< Lock > [private], tcp_acceptor< T, Arg > [private], and term_handler [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 (io_event_loop &_loop)
 Attaches the handler to an event loop.

io_event_loopget_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

 io_handler (iohandle ioh=iohandle())
 Constructor.

 io_handler (io_event_loop &loop, iohandle ioh=iohandle(), bool owned=false)
 Constructor.

virtual ~io_handler ()
 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 io_event_loop


Constructor & Destructor Documentation

io_handler::io_handler iohandle    ioh = iohandle() [protected]
 

Constructor.

io_handler::io_handler io_event_loop   loop,
iohandle    ioh = iohandle(),
bool    owned = false
[protected]
 

Constructor.

virtual io_handler::~io_handler   [protected, virtual]
 

Destructor.


Member Function Documentation

iohandle io_handler::get_ioh  
 

Returns the file descriptor to which the handler is attached.

io_event_loop* io_handler::get_loop  
 

Returns the event loop to which the handler is attached.

bool io_handler::is_owned  
 

Should this handler refrain from deleting itself on connection close?

virtual void io_handler::ravail   [protected, virtual]
 

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

void io_handler::set_ioh iohandle    ioh [protected]
 

Attaches the handler to a file descriptor.

void io_handler::set_loop io_event_loop   _loop
 

Attaches the handler to an event loop.

void io_handler::set_owned bool    o
 

Should this handler refrain from deleting itself on connection close?

void io_handler::want_read bool    [protected]
 

Invoked by the subclass to signal interest in read availability.

void io_handler::want_write bool    [protected]
 

Invoked by the subclass to signal interest in write availability.

virtual void io_handler::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 io_event_loop [friend]
 


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