#include <vrpn_OwningPtr.h>
Public 类型 | |
| typedef T | element_type |
| typedef T & | reference_type |
| typedef D | deleter_type |
| typedef traits::OwningPtrPointerType< T >::type | pointer |
| typedef OwningPtr< T, D > | type |
Public 成员函数 | |
| OwningPtr () | |
| Construct empty. | |
| OwningPtr (pointer p) | |
| ~OwningPtr () | |
| Destructor: deletes owned object, if any. | |
| void | reset (pointer p=pointer()) |
| pointer | release () |
| Returns the held pointer without performing the delete action. | |
| void | swap (type &other) |
| Swap pointers with another OwningPtr of the same type. | |
| pointer | get () const |
| Gets pointer value | |
| pointer | operator-> () const |
| Smart pointer operator overload | |
| reference_type | operator* () const |
| Smart pointer operator | |
| bool | valid () const |
| Checks pointer validity | |
| bool | operator! () const |
| Redundant way of checking pointer validity | |
Safe bool idiom - in the absence of explicit operator bool() | |
| typedef pointer type::* | unspecified_bool_type |
| operator unspecified_bool_type () const | |
A unique-ownership smart pointer, with the ability to transfer ownership, but only explicitly (aka, not like auto_ptr did it).
Essentially, a hybrid of boost::scoped_ptr and std::unique_ptr that doesn't require C++11.
Limitations relative to unique_ptr: no move semantics (naturally, since no C++11, and have not implemented rvalue-reference-emulation), no stateful deleters, and no casting or conversions.
|
inline |
Construct empty.
|
inlineexplicit |
Construct with a raw pointer for a new object to take exclusive ownership of.
|
inline |
Destructor: deletes owned object, if any.
|
inline |
Gets pointer value
|
inline |
Redundant way of checking pointer validity
|
inline |
Smart pointer operator
|
inline |
Smart pointer operator overload
|
inline |
Returns the held pointer without performing the delete action.
|
inline |
Deletes the owned object, if any, and takes ownership of a new object, if one is passed.
|
inline |
Swap pointers with another OwningPtr of the same type.
|
inline |
Checks pointer validity