#include <eventloop.h>
Inheritance diagram for TPProto::EventLoop:

Public Member Functions | |
| virtual | ~EventLoop () |
| virtual void | listenForSocketRead (TPSocket *sock)=0 |
| Gives a TPSocket to the event loop to be alerted when it's ready to read. | |
| virtual void | listenForSocketWrite (TPSocket *sock)=0 |
| Gives a TPSocket to the event loop to be alerted when it's ready to write. | |
| virtual TimerConnection | setTimer (uint32_t interval, const TimerSignal::slot_type &callback)=0 |
| Sets up a timer to call in a given interval. | |
This class should be subclassed in every client to provide a way of integrating with the existing event loop, or a new event loop if required.
| virtual TPProto::EventLoop::~EventLoop | ( | ) | [inline, virtual] |
Required virtual destructor.
| virtual void TPProto::EventLoop::listenForSocketRead | ( | TPSocket * | sock | ) | [pure virtual] |
Gives a TPSocket to the event loop to be alerted when it's ready to read.
This needs to be implemented to have the TPSocket::isReadyToRead() method called when there is data waiting for the socket.
The socket is removed when it is disconnected.
| sock | The TPSocket to check |
Implemented in TPProto::SimpleEventLoop.
| virtual void TPProto::EventLoop::listenForSocketWrite | ( | TPSocket * | sock | ) | [pure virtual] |
Gives a TPSocket to the event loop to be alerted when it's ready to write.
This needs to be implemented to have the TPSocket::isReadyToSend() method called when the socket is ready to send data.
This is a single shot, and should be disabled from from being triggered again <emph>before</emph> calling TPSocket::isReadyToSend().
| sock | The TPSocket to check |
Implemented in TPProto::SimpleEventLoop.
| virtual TimerConnection TPProto::EventLoop::setTimer | ( | uint32_t | interval, | |
| const TimerSignal::slot_type & | callback | |||
| ) | [pure virtual] |
Sets up a timer to call in a given interval.
| interval | The time interval before calling, in seconds | |
| callback | The slot/callback to call when the timer expires. |
Implemented in TPProto::SimpleEventLoop.
1.5.1