diff options
author | Stephen D. Huston <shuston@apache.org> | 2009-04-23 21:06:35 +0000 |
---|---|---|
committer | Stephen D. Huston <shuston@apache.org> | 2009-04-23 21:06:35 +0000 |
commit | a7259adba14345898e78b483b7620340ffa5cfc5 (patch) | |
tree | e8d26c0981a666442ad4aa2fff5ddb87c5ce5866 /qpid/cpp/src/qpid/client/Handle.h | |
parent | 8d32b03448e8e1ba6319fc0ac484d0ab54b29b38 (diff) | |
download | qpid-python-cmake.tar.gz |
Merge in trunk changes from r758432:768028cmake
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/cmake@768053 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/qpid/client/Handle.h')
-rw-r--r-- | qpid/cpp/src/qpid/client/Handle.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/qpid/cpp/src/qpid/client/Handle.h b/qpid/cpp/src/qpid/client/Handle.h index d8b822d0f9..12fb4cf3c1 100644 --- a/qpid/cpp/src/qpid/client/Handle.h +++ b/qpid/cpp/src/qpid/client/Handle.h @@ -30,9 +30,11 @@ namespace client { template <class T> class HandlePrivate; /** - * A handle is like a pointer: it points to some underlying object. + * A handle is like a pointer: it points to some implementation object. + * Copying the handle does not copy the object. + * * Handles can be null, like a 0 pointer. Use isValid(), isNull() or the - * implicit conversion to bool to test for a null handle. + * conversion to bool to test for a null handle. */ template <class T> class Handle { public: @@ -46,8 +48,11 @@ template <class T> class Handle { /**@return true if handle is null. It is an error to call any function on a null handle. */ QPID_CLIENT_EXTERN bool isNull() const { return !impl; } + /** Conversion to bool supports idiom if (handle) { handle->... } */ QPID_CLIENT_EXTERN operator bool() const { return impl; } - QPID_CLIENT_EXTERN bool operator !() const { return impl; } + + /** Operator ! supports idiom if (!handle) { do_if_handle_is_null(); } */ + QPID_CLIENT_EXTERN bool operator !() const { return !impl; } QPID_CLIENT_EXTERN void swap(Handle<T>&); |