#include <TSocketMultiplexerMethodJob.h>
Inherits ISocketMultiplexerJob.
Inheritance diagram for TSocketMultiplexerMethodJob< T >:
Public Types | |
typedef ISocketMultiplexerJob *(T::*) | Method (ISocketMultiplexerJob *, bool, bool, bool) |
Public Member Functions | |
TSocketMultiplexerMethodJob (T *object, Method method, CArchSocket socket, bool readable, bool writeable) | |
run() invokes object->method(arg) | |
virtual | ~TSocketMultiplexerMethodJob () |
virtual ISocketMultiplexerJob * | run (bool readable, bool writable, bool error) |
Handle socket event. | |
virtual CArchSocket | getSocket () const |
Get the socket. | |
virtual bool | isReadable () const |
Check for interest in readability. | |
virtual bool | isWritable () const |
Check for interest in writability. |
A socket multiplexer job class that invokes a member function.
Definition at line 26 of file TSocketMultiplexerMethodJob.h.
CArchSocket TSocketMultiplexerMethodJob< T >::getSocket | ( | ) | const [inline, virtual] |
Get the socket.
Return the socket to multiplex
Implements ISocketMultiplexerJob.
Definition at line 87 of file TSocketMultiplexerMethodJob.h.
bool TSocketMultiplexerMethodJob< T >::isReadable | ( | ) | const [inline, virtual] |
Check for interest in readability.
Return true if the job is interested in being run if the socket becomes readable.
Implements ISocketMultiplexerJob.
Definition at line 95 of file TSocketMultiplexerMethodJob.h.
bool TSocketMultiplexerMethodJob< T >::isWritable | ( | ) | const [inline, virtual] |
Check for interest in writability.
Return true if the job is interested in being run if the socket becomes writable.
Implements ISocketMultiplexerJob.
Definition at line 103 of file TSocketMultiplexerMethodJob.h.
ISocketMultiplexerJob * TSocketMultiplexerMethodJob< T >::run | ( | bool | readable, | |
bool | writable, | |||
bool | error | |||
) | [inline, virtual] |
Handle socket event.
Called by a socket multiplexer when the socket becomes readable, writable, or has an error. It should return itself if the same job can continue to service events, a new job if the socket must be serviced differently, or NULL if the socket should no longer be serviced. The socket is readable if readable
is true, writable if writable
is true, and in error if error
is true.
This call must not attempt to directly change the job for this socket by calling addSocket()
or removeSocket()
on the multiplexer. It must instead return the new job. It can, however, add or remove jobs for other sockets.
Implements ISocketMultiplexerJob.
Definition at line 76 of file TSocketMultiplexerMethodJob.h.