FbxScopedPtr mimics a built-in pointer except that it guarantees deletion of the object pointed to, either on destruction of the FbxScopedPtr or via an explicit Reset().
Definition at line 57 of file fbxscopedptr.h.
#include <fbxscopedptr.h>
Public Member Functions |
|
| FbxScopedPtr (T *p=0) | |
| Construct from a pointer. |
|
| ~FbxScopedPtr () | |
| Destructor. |
|
| void | Reset (T *p=0) |
| Reset the scoped pointer by swapping with
another pointer. |
|
| T & | operator* () const |
| Dereference operator. |
|
| T * | operator-> () const |
| Member access operator. |
|
| T * | Get () const |
| Retrieve the pointer it holds. |
|
| operator T * () const | |
| Convert to a type T pointer. |
|
| operator bool () const | |
| Convert to boolean value. |
|
| bool | operator! () const |
| Logical not operator. |
|
| void | Swap (FbxScopedPtr &b) |
| Swap with another pointer. |
|
| T * | Release () |
| Release the pointer, so that it won't
perform deletion in its destruction. |
|
| FbxScopedPtr | ( | T * | p = 0 |
) | [inline, explicit] |
| ~FbxScopedPtr | ( | ) | [inline] |
| void Reset | ( | T * | p = 0 |
) | [inline] |
Reset the scoped pointer by swapping with another pointer.
Definition at line 80 of file fbxscopedptr.h.
{
FBX_ASSERT(p == 0 || p != ptr); // catch self-reset errors
ThisType(p).Swap(*this);
}
| T& operator* | ( | ) | const [inline] |
Dereference operator.
Definition at line 87 of file fbxscopedptr.h.
{
FBX_ASSERT(ptr != 0);
return *ptr;
}
| T* operator-> | ( | ) | const [inline] |
Member access operator.
Definition at line 94 of file fbxscopedptr.h.
{
FBX_ASSERT(ptr != 0);
return ptr;
}
| T* Get | ( | ) | const [inline] |
| operator T * | ( | ) | const [inline] |
| operator bool | ( | ) | const [inline] |
| bool operator! | ( | ) | const [inline] |
| void Swap | ( | FbxScopedPtr< T, DeletionPolicyT > & | b | ) | [inline] |
Swap with another pointer.
Definition at line 125 of file fbxscopedptr.h.
{
T * tmp = b.ptr;
b.ptr = ptr;
ptr = tmp;
}
| T* Release | ( | ) | [inline] |
Release the pointer, so that it won't perform deletion in its destruction.
Definition at line 133 of file fbxscopedptr.h.
{
T* tmp = ptr;
ptr = NULL;
return tmp;
}