Kyoto Tycoon
Public Member Functions
kyototycoon::Poller Class Reference

I/O event notification. More...

#include <ktsocket.h>

List of all members.

Public Member Functions

 Poller ()
 Default constructor.
 ~Poller ()
 Destructor.
const char * error ()
 Get the last happened error information.
bool open ()
 Open the poller.
bool close ()
 Close the poller.
bool deposit (Pollable *event)
 Add a pollable I/O event to the monitored list.
bool withdraw (Pollable *event)
 Remove a pollable I/O from the monitored list.
Pollablenext ()
 Fetch the next notified I/O event.
bool undo (Pollable *event)
 Enable the next notification of a pollable event.
bool wait (double timeout=-1)
 Wait one or more notifying events.
bool flush ()
 Notify all registered events.
int64_t count ()
 Get the number of events to watch.
bool abort ()
 Abort the current operation.

Detailed Description

I/O event notification.


Constructor & Destructor Documentation

Default constructor.

Destructor.


Member Function Documentation

const char* kyototycoon::Poller::error ( )

Get the last happened error information.

Returns:
the last happened error information.

Open the poller.

Returns:
true on success, or false on failure.

Close the poller.

Returns:
true on success, or false on failure.

Add a pollable I/O event to the monitored list.

Parameters:
eventthe pollable event object.
Returns:
true on success, or false on failure.

Remove a pollable I/O from the monitored list.

Parameters:
eventthe pollable event object.
Returns:
true on success, or false on failure.

Fetch the next notified I/O event.

Returns:
the event object, or NULL on failure.

Enable the next notification of a pollable event.

Parameters:
eventthe pollable event object.
Returns:
true on success, or false on failure.
bool kyototycoon::Poller::wait ( double  timeout = -1)

Wait one or more notifying events.

Parameters:
timeoutthe timeout in seconds. If it is not more than 0, no timeout is specified.
Returns:
true on success, or false on failure.

Notify all registered events.

Returns:
true on success, or false on failure.

Get the number of events to watch.

Returns:
the number of events to watch, or -1 on failure.

Abort the current operation.

Returns:
true on success, or false on failure.