Public Member Functions | Protected Member Functions | Friends

atscppapi::AsyncProvider Class Reference

AsyncProvider is the interface that providers of async operations must implement. More...

#include <Async.h>

Inherited by atscppapi::AsyncHttpFetch, and atscppapi::AsyncTimer.

Collaboration diagram for atscppapi::AsyncProvider:
Collaboration graph
[legend]

Public Member Functions

virtual void run ()=0
 This method is invoked when the async operation is requested.
virtual void cancel ()
 Base implementation just breaks communication channel with receiver.
virtual ~AsyncProvider ()

Protected Member Functions

shared_ptr
< AsyncDispatchControllerBase > 
getDispatchController ()

Friends

class Async

Detailed Description

AsyncProvider is the interface that providers of async operations must implement.

The system allows decoupling of the lifetime/scope of provider and receiver objects. The receiver object might have expired before the async operation is complete and the system handles this case. Because of this decoupling, it is the responsibility of the provider to manage it's expiration - self-destruct on completion is a good option.

Definition at line 66 of file Async.h.


Constructor & Destructor Documentation

virtual atscppapi::AsyncProvider::~AsyncProvider (  )  [inline, virtual]

Definition at line 83 of file Async.h.


Member Function Documentation

virtual void atscppapi::AsyncProvider::cancel ( void   )  [inline, virtual]

Base implementation just breaks communication channel with receiver.

Implementations should add business logic here.

Reimplemented in atscppapi::AsyncTimer.

Definition at line 77 of file Async.h.

shared_ptr<AsyncDispatchControllerBase> atscppapi::AsyncProvider::getDispatchController (  )  [inline, protected]

Definition at line 86 of file Async.h.

virtual void atscppapi::AsyncProvider::run (  )  [pure virtual]

This method is invoked when the async operation is requested.

This call should be used to just start the async operation and *not* block this thread. On completion, getDispatchController() can be used to invoke the receiver.

Implemented in atscppapi::AsyncHttpFetch, and atscppapi::AsyncTimer.


Friends And Related Function Documentation

friend class Async [friend]

Definition at line 94 of file Async.h.


The documentation for this class was generated from the following file: