Core Library
|
A smart-pointer for use within a limited scope. More...
#include <UniquePtr.hpp>
Public Member Functions | |
UniquePtr () | |
Default constructor. | |
UniquePtr (T *pPointer) | |
Construction from a raw pointer. | |
~UniquePtr () | |
Destructor. | |
void | reset (T *pPointer=nullptr) |
Change pointer ownership. | |
T * | detach () |
Take ownership of the pointer. | |
Private Member Functions | |
T ** | getPtrMember () |
Access the underlying pointer member. | |
Friends | |
T ** | attachTo (UniquePtr< T > &ptr) |
Allow attachment via an output parameter. |
A smart-pointer for use within a limited scope.
Core::UniquePtr< T >::UniquePtr | ( | ) | [inline] |
Default constructor.
Core::UniquePtr< T >::UniquePtr | ( | T * | pPointer | ) | [inline, explicit] |
Construction from a raw pointer.
Takes ownership of a new pointer.
Core::UniquePtr< T >::~UniquePtr | ( | ) | [inline] |
Destructor.
void Core::UniquePtr< T >::reset | ( | T * | pPointer = nullptr | ) | [inline] |
Change pointer ownership.
Frees the current pointer and takes ownership of another pointer, if provided.
T * Core::UniquePtr< T >::detach | ( | ) | [inline] |
Take ownership of the pointer.
T ** Core::UniquePtr< T >::getPtrMember | ( | ) | [inline, private] |
Access the underlying pointer member.
This is used by the attachTo() friend function to access the underlying SmartPtr<T> member variable.
Allow attachment via an output parameter.
e.g. LoadTypeLib(..., attachTo(p)).