Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

VCF::AsyncResult Class Reference

This class is used to manage invoking a delegate's callbacks asynchronously. More...

#include <vcf/FoundationKit/Delegates.h>

Inheritance diagram for VCF::AsyncResult:

VCF::Object VCF::Waitable List of all members.

Public Types

typedef Procedure1< AsyncResult * > AsyncCallback
typedef std::pair< AsyncReturns *,
Runnable * > 
CallbackWork

Public Member Functions

 AsyncResult (AsyncCallback *callback, bool runCallbacksAsync)
virtual ~AsyncResult ()
void doWork ()
virtual WaitResult wait ()
 This function will wait till the async result is completed.
virtual WaitResult wait (uint32 milliseconds)
 This function will attempt to wait till the async result is completed.
virtual OSHandleID getPeerHandleID ()
void internal_run ()
bool isCompleted () const
 A flag that indicates whether or not the delegate's callbacks have finished executing.
void internal_addRunnable (AsyncReturns *returnObject, Runnable *internalRunnable)

Protected Member Functions

void internal_removeRunnable (Runnable *val)

Protected Attributes

bool completed_
bool runCallbacksAsync_
Condition resultWait_
Mutex resultWaitMtx_
Mutex runnableMtx_
std::vector< CallbackWorkinternalRunnables_
AsyncCallbackcallback_

Friends

class Task
class AsyncTask

Classes

class  AsyncTask
class  Task

Detailed Description

This class is used to manage invoking a delegate's callbacks asynchronously.

You don't need to create an instance of it, instead the framework will hand you a new instance when you call beginInvoke on a delegate.


Member Typedef Documentation

typedef Procedure1<AsyncResult*> VCF::AsyncResult::AsyncCallback
 

typedef std::pair<AsyncReturns*,Runnable*> VCF::AsyncResult::CallbackWork
 


Constructor & Destructor Documentation

VCF::AsyncResult::AsyncResult AsyncCallback callback,
bool  runCallbacksAsync
[inline]
 

virtual VCF::AsyncResult::~AsyncResult  )  [inline, virtual]
 


Member Function Documentation

void VCF::AsyncResult::doWork  ) 
 

virtual OSHandleID VCF::AsyncResult::getPeerHandleID  )  [inline, virtual]
 

Implements VCF::Waitable.

void VCF::AsyncResult::internal_addRunnable AsyncReturns returnObject,
Runnable internalRunnable
[inline]
 

void VCF::AsyncResult::internal_removeRunnable Runnable val  )  [inline, protected]
 

void VCF::AsyncResult::internal_run  )  [inline]
 

bool VCF::AsyncResult::isCompleted  )  const [inline]
 

A flag that indicates whether or not the delegate's callbacks have finished executing.

Returns:
bool a result of true means the callbacks are done, otherwise it returns false.

virtual WaitResult VCF::AsyncResult::wait uint32  milliseconds  )  [inline, virtual]
 

This function will attempt to wait till the async result is completed.

The result is "finished" when all the callbacks for the delegate that created it are done executing. This method will block for the passed in number of milliseconds or until all the callbacks are done whichever happens first.

Implements VCF::Waitable.

virtual WaitResult VCF::AsyncResult::wait  )  [inline, virtual]
 

This function will wait till the async result is completed.

The result is "finished" when all the callbacks for the delegate that created it are done executing. This method will block indefinitely until all the callbacks are done.

Implements VCF::Waitable.


Friends And Related Function Documentation

friend class AsyncTask [friend]
 

friend class Task [friend]
 


Member Data Documentation

AsyncCallback* VCF::AsyncResult::callback_ [protected]
 

bool VCF::AsyncResult::completed_ [protected]
 

std::vector<CallbackWork> VCF::AsyncResult::internalRunnables_ [protected]
 

Condition VCF::AsyncResult::resultWait_ [protected]
 

Mutex VCF::AsyncResult::resultWaitMtx_ [protected]
 

bool VCF::AsyncResult::runCallbacksAsync_ [protected]
 

Mutex VCF::AsyncResult::runnableMtx_ [protected]
 


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information