Selectable Class Referenceabstract

#include <Pt/System/Selectable.h>

Dispatches operations through an event loop.

Inherits NonCopyable.

Inherited by TcpServer, IODevice, and IONotifier.

Public Member Functions

virtual ~Selectable ()
 Destructor.
 
void setActive (EventLoop &parent)
 Sets the parent loop, so that operations can be run.
 
void detach ()
 Remove from event loop and cancels outstanding operations.
 
void cancel ()
 Cancels all operations.
 
bool run ()
 Run operation if it is ready.
 
EventLoopparent () const
 Returns the used event loop.
 

Protected Member Functions

 Selectable ()
 Default Constructor.
 
void post ()
 Posts this selectable to its event loop from any thread.
 
virtual void onAttach (EventLoop &loop)=0
 Attached to loop.
 
virtual void onDetach (EventLoop &loop)=0
 Detached from loop.
 
virtual void onCancel ()=0
 Blocks until operation has cancelled.
 
virtual bool onRun ()=0
 Check if ready and run.