SigCX::ThreadTunnel Class Reference
[SigC++ Extras]

A inter-thread tunnel. More...

#include <thread_tunnel.h>

Inheritance diagram for SigCX::ThreadTunnel:

SigCX::Tunnel

List of all members.

Public Types

enum  Mode { NewThread, CurrentThread, SingleThread }

Public Member Functions

 ThreadTunnel (Dispatcher &disp, Mode mode=NewThread)
Dispatcherdispatcher ()
virtual bool in_sync_callback ()
virtual void drain ()

Classes

class  FatalError
 Exception class. More...


Detailed Description

A inter-thread tunnel.

This tunnel is implemented using a pipe to transfer callbacks from one thread to another. It also has a single-threaded mode in which it uses the pipe anyway. This can be used to code nearly non-blocking UIs without the use of threads.


Member Enumeration Documentation

enum SigCX::ThreadTunnel::Mode

Execution mode of the ThreadTunnel.

Enumerator:
NewThread  Run dispatcher in newly created thread.

CurrentThread  The dispatcher will run in current thread.

No thread will be created, and the callbacks are deferred until the next iteration of the dispatchers main loop.

SingleThread  This is similiar to CurrentThread, but for use in a single threaded program.


Constructor & Destructor Documentation

SigCX::ThreadTunnel::ThreadTunnel ( Dispatcher disp,
Mode  mode = NewThread 
)

Constructor.

Parameters:
disp Dispatcher to use for the destination thread (working thread, the thread where the callbacks are executed).
mode Working mode of the dispatcher.


Member Function Documentation

Dispatcher& SigCX::ThreadTunnel::dispatcher (  )  [inline]

Get the destination thread dispatcher.

Returns:
The destination thread dispatcher.

virtual bool SigCX::ThreadTunnel::in_sync_callback (  )  [virtual]

Check if tunnel is executing a synchronous callback.

Returns:
true if a synchronous callback is in execution.

Implements SigCX::Tunnel.

virtual void SigCX::ThreadTunnel::drain (  )  [virtual]

Drain the tunnel.

Any callbacks in the tunnel are cancelled. This is intended to be called at the destination end of the tunnel.

Implements SigCX::Tunnel.


The documentation for this class was generated from the following file:
Generated on Mon Sep 10 06:27:37 2007 for SigCX - SigC++ Extras by  doxygen 1.5.3