diff options
Diffstat (limited to 'qpid/cpp/src/qpid/client/Completion.h')
-rw-r--r-- | qpid/cpp/src/qpid/client/Completion.h | 35 |
1 files changed, 15 insertions, 20 deletions
diff --git a/qpid/cpp/src/qpid/client/Completion.h b/qpid/cpp/src/qpid/client/Completion.h index c4979d7934..0b246b7765 100644 --- a/qpid/cpp/src/qpid/client/Completion.h +++ b/qpid/cpp/src/qpid/client/Completion.h @@ -22,13 +22,14 @@ #ifndef _Completion_ #define _Completion_ -#include <boost/shared_ptr.hpp> -#include "Future.h" -#include "SessionImpl.h" +#include "Handle.h" +#include <string> namespace qpid { namespace client { +class CompletionImpl; + /** * Asynchronous commands that do not return a result will return a * Completion. You can use the completion to wait for that specific @@ -38,32 +39,26 @@ namespace client { * *\ingroup clientapi */ -class Completion +class Completion : public Handle<CompletionImpl> { -protected: - Future future; - shared_ptr<SessionImpl> session; - public: ///@internal - Completion() {} - - ///@internal - Completion(Future f, shared_ptr<SessionImpl> s) : future(f), session(s) {} + QPID_CLIENT_EXTERN Completion(CompletionImpl* =0); + QPID_CLIENT_EXTERN ~Completion(); + QPID_CLIENT_EXTERN Completion(const Completion&); + QPID_CLIENT_EXTERN Completion& operator=(const Completion&); /** Wait for the asynchronous command that returned this *Completion to complete. * - *@exception If the command returns an error, get() throws an exception. + *@exception If the command returns an error. */ - void wait() - { - future.wait(*session); - } + QPID_CLIENT_EXTERN void wait(); + + QPID_CLIENT_EXTERN bool isComplete(); - bool isComplete() { - return future.isComplete(*session); - } + protected: + QPID_CLIENT_EXTERN std::string getResult(); }; }} |