class CCL::Promise

Overview

#include <asyncoperation.h>

class Promise
{
public:
    // construction

    Promise (IAsyncOperation* operation);
    Promise (const Promise& promise);

    // methods

    Promise then (IAsyncCompletionHandler* handler);

    template  <typename T>
    Promise then (
        T* target,
        typename MemberFuncCompletionHandler <T>::MemberFunc memberFunc
    );

    template  <typename T>
    Promise then (const T& lambda);

    Promise modifyState (IAsyncStateModifier* modifier);

    template  <typename T>
    Promise modifyState (const T& lambda);

    template  <typename T>
    Promise modifyState (
        T* target,
        typename MemberFuncCompletionHandler <T>::MemberFunc memberFunc
    );

    operator IAsyncOperation * () const;
    IAsyncOperation* operator -> () const;
};

Detailed Documentation

Construction

Promise (IAsyncOperation* operation)

takes ownership!