Rapicorn - Experimental UI Toolkit - Source Code  13.07.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Public Member Functions | Static Public Member Functions
Rapicorn::MainLoop Class Reference

An EventLoop implementation that offers public API for running the loop. More...

#include <loop.hh>

Inherits Rapicorn::EventLoop.

List of all members.

Public Member Functions

int run ()
 Run loop iterations until a call to quit() or finishable becomes true.
bool running ()
 Indicates if quit() has been called already.
void quit (int quit_code=0)
 Cause run() to return with quit_code.
bool finishable ()
 Indicates wether this loop has no primary sources left to process.
bool iterate (bool block)
 Perform one loop iteration and return whether more iterations are needed.
void iterate_pending ()
 Call iterate() until no immediate dispatching is needed.
void kill_loops ()
 Kill all sources in this loop and all slave loops.
EventLoopnew_slave ()
 Creates a new slave loop that is run as part of this main loop.
Mutexmutex ()
 Provide access to the mutex associated with this main loop.

Static Public Member Functions

static MainLoop_new ()
 Creates a new main loop object, users can run or iterate this loop directly.

Detailed Description

An EventLoop implementation that offers public API for running the loop.


Member Function Documentation

bool Rapicorn::MainLoop::iterate ( bool  may_block)

Perform one loop iteration and return whether more iterations are needed.

Parameters:
may_blockIf true, iterate() will wait for events occour.

MainLoop::iterate() is the heart of the main event loop. For loop iteration, all event sources are polled for incoming events. Then dispatchable sources are picked one per iteration and dispatched in round-robin fashion. If no sources need immediate dispatching and may_block is true, iterate() will wait for events to become available.

Returns:
Whether more sources need immediate dispatching.

Provide access to the mutex associated with this main loop.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines