GNet::Select Class Reference

A concrete implementation of GNet::EventLoop using select() in the implementation. More...

Inheritance diagram for GNet::Select:

GNet::EventLoop G::noncopyable

List of all members.

Public Member Functions

 Select ()
virtual ~Select ()
virtual bool init ()
 Initialises the object.
virtual void run ()
 Runs the main event loop.
virtual bool running () const
 Returns true if called from within run().
virtual bool quit ()
 Causes run() to return (once the call stack has unwound).
virtual void addRead (Descriptor fd, EventHandler &handler)
 Adds the given event source descriptor and associated handler to the read list.
virtual void addWrite (Descriptor fd, EventHandler &handler)
 Adds the given event source descriptor and associated handler to the write list.
virtual void addException (Descriptor fd, EventHandler &handler)
 Adds the given event source descriptor and associated handler to the exception list.
virtual void dropRead (Descriptor fd)
 Removes the given event source descriptor from the list of read sources.
virtual void dropWrite (Descriptor fd)
 Removes the given event source descriptor from the list of write sources.
virtual void dropException (Descriptor fd)
 Removes the given event source descriptor from the list of exception sources.


Detailed Description

A concrete implementation of GNet::EventLoop using select() in the implementation.

Definition at line 67 of file geventloop_unix.cpp.


Constructor & Destructor Documentation

GNet::Select::Select (  ) 

Definition at line 211 of file geventloop_unix.cpp.

GNet::Select::~Select (  )  [virtual]

Definition at line 220 of file geventloop_unix.cpp.


Member Function Documentation

bool GNet::Select::init (  )  [virtual]

Initialises the object.

Implements GNet::EventLoop.

Definition at line 224 of file geventloop_unix.cpp.

void GNet::Select::run (  )  [virtual]

Runs the main event loop.

Implements GNet::EventLoop.

Definition at line 229 of file geventloop_unix.cpp.

bool GNet::Select::running (  )  const [virtual]

Returns true if called from within run().

Implements GNet::EventLoop.

Definition at line 239 of file geventloop_unix.cpp.

bool GNet::Select::quit (  )  [virtual]

Causes run() to return (once the call stack has unwound).

Returns true, or on some platforms the previous state of the quit flag. (This means that run() can be used to process one event at a time for testing purposes).

Implements GNet::EventLoop.

Definition at line 244 of file geventloop_unix.cpp.

void GNet::Select::addRead ( Descriptor  fd,
EventHandler handler 
) [virtual]

Adds the given event source descriptor and associated handler to the read list.

See also Socket::addReadHandler().

Implements GNet::EventLoop.

Definition at line 302 of file geventloop_unix.cpp.

References GNet::EventHandlerList::add(), and GNet::FdSet::invalidate().

void GNet::Select::addWrite ( Descriptor  fd,
EventHandler handler 
) [virtual]

Adds the given event source descriptor and associated handler to the write list.

See also Socket::addWriteHandler().

Implements GNet::EventLoop.

Definition at line 308 of file geventloop_unix.cpp.

References GNet::EventHandlerList::add(), and GNet::FdSet::invalidate().

void GNet::Select::addException ( Descriptor  fd,
EventHandler handler 
) [virtual]

Adds the given event source descriptor and associated handler to the exception list.

See also Socket::addExceptionHandler().

Implements GNet::EventLoop.

Definition at line 314 of file geventloop_unix.cpp.

References GNet::EventHandlerList::add(), and GNet::FdSet::invalidate().

void GNet::Select::dropRead ( Descriptor  fd  )  [virtual]

Removes the given event source descriptor from the list of read sources.

See also Socket::dropReadHandler().

Implements GNet::EventLoop.

Definition at line 320 of file geventloop_unix.cpp.

References GNet::FdSet::invalidate(), and GNet::EventHandlerList::remove().

void GNet::Select::dropWrite ( Descriptor  fd  )  [virtual]

Removes the given event source descriptor from the list of write sources.

See also Socket::dropWriteHandler().

Implements GNet::EventLoop.

Definition at line 326 of file geventloop_unix.cpp.

References GNet::FdSet::invalidate(), and GNet::EventHandlerList::remove().

void GNet::Select::dropException ( Descriptor  fd  )  [virtual]

Removes the given event source descriptor from the list of exception sources.

See also Socket::dropExceptionHandler().

Implements GNet::EventLoop.

Definition at line 332 of file geventloop_unix.cpp.

References GNet::FdSet::invalidate(), and GNet::EventHandlerList::remove().


The documentation for this class was generated from the following file:

Generated on Fri Apr 18 15:56:13 2008 for E-MailRelay by  doxygen 1.5.5