#include <sue_sel.hpp>
Collaboration diagram for SUEEventSelector:
Public Methods | |
SUEEventSelector () | |
Constructor. | |
virtual | ~SUEEventSelector () |
Destructor. | |
void | RegisterFdHandler (SUEFdHandler *h) |
Register file descriptor handler. | |
void | RemoveFdHandler (SUEFdHandler *h) |
Removes the specified handler. | |
void | RegisterTimeoutHandler (SUETimeoutHandler *h) |
Register a timeout handler. | |
void | RemoveTimeoutHandler (SUETimeoutHandler *h) |
Removes the specified handler. | |
void | RegisterSignalHandler (SUESignalHandler *h) |
Register a signal handler. | |
void | RemoveSignalHandler (SUESignalHandler *h) |
Remove a signal handler. | |
void | Go () |
Main loop. | |
void | Break () |
Cause main loop to break (Go() function to return). | |
virtual void | HandleSelectFailure (int rc) |
Handle select(2) errors. |
This class provides an object-oriented framework for the unix select(2) system call. It uses objects of:
chat.cpp, children.cpp, hellobot.cpp, sigs.cpp, sitter.cpp, and sleep5.cpp.
|
Constructor.
|
|
Destructor.
|
|
Cause main loop to break (Go() function to return). This function sets the loop breaking flag which causes Go() function to return. The flag is cleared each time Go() is called. Go() checks for this flag after the main sequence of actions is performed, before repeating it.
|
|
Main loop. This function
The function is intended to be the main loop of your process.
|
|
Handle select(2) errors. This method is called whenever select(2) returns negative value.
|
|
Register file descriptor handler. Registers an FD to be watched. FD is specified with a SUEFdHandler subclass object. SUEFdHandler provides the value of the descriptor, the notification modes (r/w/e), and the callback function for notification (as a virtual method).
|
|
Register a signal handler. Registers a signal specified with SUESignalHandler object
|
|
Register a timeout handler. Registers a time moment at which to wake up and call the notification method. Time value (in seconds and microseconds) is specified by a SUEFdHandler subclass object which also provides a callback function for notification (as a virtual method).
|
|
Removes the specified handler. Removes (unregisters) an FD handler. In case the handler is not registered, silently ignores the call |
|
Remove a signal handler.
|
|
Removes the specified handler. Removes (unregisters) a timeout handler. In case the handler is not registered, silently ignores the call
|