class DelayedReturn

The "DelayedReturn" class implements delayed returning from functions. More...

Full nameArts::DelayedReturn
Definition#include <arts/delayedreturn.h>
List of all Methods
Annotated List
Files
Globals
Hierarchy
Index

Public Methods

Protected Methods

Protected Members


Detailed Description

The "DelayedReturn" class implements delayed returning from functions.

For instance, suppose you would like to return from a wait() operation only after a certain time has passed, without blocking other clients from using your interface during this time.

Your implementation (in the skel file) of wait should look like this


 static DelayedReturn *delayedReturn = 0;

 bool TimeServer::waitUntil(long time)
 {
     if(time(0) < time)
     {
     	   // ... initialize timer here ...
         delayedReturn = Dispatcher::the()->delayReturn();
     }
     return false; 
 }

 void timerEvent()
 {
 	   delayedReturn->doReturn(true);
 }

NOTE: this class breaks for local use (i.e. you can only use it if the call was a remote call), so it is strongly recommended not to use it unless there is no alternative (and you should really know what you are doing, too).

Buffer * buffer

buffer

[protected]

Connection * connection

connection

[protected]

 DelayedReturn ()

DelayedReturn

[protected]

void  initialize (Connection *connection, Buffer *buffer)

initialize

[protected]

 ~DelayedReturn ()

~DelayedReturn

[protected]

void  doReturn (const AnyConstRef& value)

doReturn

call this only once to make the request really return

void  doReturn ()

doReturn

return without value (for void functions)


Generated by: stefan on stefan on Sat Jun 2 23:13:28 2001, using kdoc 2.0a53.