29 #ifndef PT_SELECTABLE_H
30 #define PT_SELECTABLE_H
32 #include <Pt/System/Api.h>
33 #include <Pt/NonCopyable.h>
46 friend class SelectableList;
102 #endif // PT_SELECTABLE_H
Core module.
Definition: pt-gfx-images.dox:14
EventLoop * parent() const
Returns the used event loop.
Definition: Selectable.h:65
virtual void onDetach(EventLoop &loop)=0
Detached from loop.
void detach()
Remove from event loop and cancels outstanding operations.
void cancel()
Cancels all operations.
virtual bool onRun()=0
Check if ready and run.
Selectable()
Default Constructor.
virtual void onCancel()=0
Blocks until operation has cancelled.
virtual void onAttach(EventLoop &loop)=0
Attached to loop.
Dispatches operations through an event loop.
Definition: Selectable.h:45
virtual ~Selectable()
Destructor.
Thread-safe event loop supporting I/O multiplexing and Timers.
Definition: EventLoop.h:74
bool run()
Run operation if it is ready.
Protects derived classes from being copied.
Definition: NonCopyable.h:54
void post()
Posts this selectable to its event loop from any thread.
void setActive(EventLoop &parent)
Sets the parent loop, so that operations can be run.