- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Hierarchy
- Class Members

Public Member Functions | List of all members
GNet::Select Class Reference

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

Inheritance diagram for GNet::Select:

## Public Member Functions
| Select ()
virtual | ~Select ()
virtual bool | init ()
| Initialises the object. More...
virtual std::string | run ()
| Runs the main event loop. More...
virtual bool | running () const
| Returns true if called from within run(). More...
virtual void | quit (std::string)
| Causes run() to return (once the call stack has unwound). More...
virtual void | addRead (Descriptor fd, EventHandler &handler)
| Adds the given event source descriptor and associated handler to the read list. More...
virtual void | addWrite (Descriptor fd, EventHandler &handler)
| Adds the given event source descriptor and associated handler to the write list. More...
virtual void | addException (Descriptor fd, EventHandler &handler)
| Adds the given event source descriptor and associated handler to the exception list. More...
virtual void | dropRead (Descriptor fd)
| Removes the given event source descriptor from the list of read sources. More...
virtual void | dropWrite (Descriptor fd)
| Removes the given event source descriptor from the list of write sources. More...
virtual void | dropException (Descriptor fd)
| Removes the given event source descriptor from the list of exception sources. More...
Public Member Functions inherited from GNet::EventLoop
virtual | ~EventLoop ()
| Destructor. More...
Public Member Functions inherited from G::noncopyable
| noncopyable ()

## Additional Inherited Members
Static Public Member Functions inherited from GNet::EventLoop
static EventLoop * | create ()
| A factory method which creates an instance of a derived class on the heap. More...
static EventLoop & | instance ()
| Returns a reference to an instance of the class, if any. More...
static bool | exists ()
| Returns true if an instance exists. More...
Protected Member Functions inherited from GNet::EventLoop
| EventLoop ()
| Constructor. More...

## 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 212 of file geventloop_unix.cpp.

GNet::Select::~Select | ( |  | ) |
| virtual

Definition at line 221 of file geventloop_unix.cpp.

## Member Function Documentation

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 317 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 305 of file geventloop_unix.cpp.

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 311 of file geventloop_unix.cpp.

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 335 of file geventloop_unix.cpp.

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 323 of file geventloop_unix.cpp.

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 329 of file geventloop_unix.cpp.

bool GNet::Select::init | ( |  | ) |
| virtual

Initialises the object.

Implements GNet::EventLoop.

Definition at line 225 of file geventloop_unix.cpp.

void GNet::Select::quit | ( | std::string | reason | ) |
| virtual

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

If there are multiple quit()s before run() returns then the latest reason is used.

Implements GNet::EventLoop.

Definition at line 248 of file geventloop_unix.cpp.

std::string GNet::Select::run | ( |  | ) |
| virtual

Runs the main event loop.

Returns a quit() reason, if any.

Implements GNet::EventLoop.

Definition at line 230 of file geventloop_unix.cpp.

bool GNet::Select::running | ( |  | ) | const
| virtual

Returns true if called from within run().

Implements GNet::EventLoop.

Definition at line 243 of file geventloop_unix.cpp.

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

- geventloop_unix.cpp