qmf::Handle< T > Class Template Reference
A handle is like a pointer: refers to an underlying implementation object.
More...
#include <qmf/Handle.h>
List of all members.
Public Member Functions |
QMF_INLINE_EXTERN bool | isValid () const |
QMF_INLINE_EXTERN bool | isNull () const |
QMF_INLINE_EXTERN | operator bool () const |
| Conversion to bool supports idiom if (handle) { handle->.
|
QMF_INLINE_EXTERN bool | operator! () const |
| Operator ! supports idiom if (!handle) { do_if_handle_is_null(); }.
|
void | swap (Handle< T > &h) |
Protected Types |
typedef T | Impl |
Protected Member Functions |
QMF_INLINE_EXTERN | Handle () |
| Handle (const Handle &) |
Handle & | operator= (const Handle &) |
Protected Attributes |
Impl * | impl |
Detailed Description
template<class T>
class qmf::Handle< T >
A handle is like a pointer: refers to an underlying implementation object.
Copying the handle does not copy the object.
Handles can be null, like a 0 pointer. Use isValid(), isNull() or the conversion to bool to test for a null handle.
Definition at line 38 of file Handle.h.
Member Typedef Documentation
Constructor & Destructor Documentation
Member Function Documentation
template<class T>
QMF_INLINE_EXTERN bool qmf::Handle< T >::isNull |
( |
|
) |
const [inline] |
- Returns:
- true if handle is null. It is an error to call any function on a null handle.
Definition at line 45 of file Handle.h.
template<class T>
QMF_INLINE_EXTERN bool qmf::Handle< T >::isValid |
( |
|
) |
const [inline] |
- Returns:
- true if handle is valid, i.e. not null.
Definition at line 42 of file Handle.h.
template<class T>
QMF_INLINE_EXTERN qmf::Handle< T >::operator bool |
( |
|
) |
const [inline] |
Conversion to bool supports idiom if (handle) { handle->.
.. }
Definition at line 48 of file Handle.h.
template<class T>
QMF_INLINE_EXTERN bool qmf::Handle< T >::operator! |
( |
|
) |
const [inline] |
Operator ! supports idiom if (!handle) { do_if_handle_is_null(); }.
Definition at line 51 of file Handle.h.
Member Data Documentation
The documentation for this class was generated from the following file: