winss
|
A container for pointers where the lifetime should be owned by the caller. More...
#include <not_owning_ptr.hpp>
Public Member Functions | |
NotOwningPtr (T *p) | |
Create a new NotOwningPtr with a pointer to the actual object. More... | |
template<class V > | |
NotOwningPtr (const NotOwningPtr< V > &ptr) | |
Copy constructor to allow copying the pointer. More... | |
T * | Get () |
Gets the not owned pointer. More... | |
T * | Get () const |
Gets the not owned pointer as a constant. More... | |
T & | operator* () |
Gets the dereferenced object. More... | |
T & | operator* () const |
Gets the dereferenced object as a constant. More... | |
T * | operator-> () |
Gets the not owned pointer. More... | |
T * | operator-> () const |
Gets the not owned pointer as a constant. More... | |
bool | operator== (const NotOwningPtr &ptr) const |
Checks equality of this not owned pointer and another. More... | |
bool | operator!= (const NotOwningPtr &ptr) const |
Checks inequality of this not owned pointer and another. More... | |
NotOwningPtr & | operator= (const NotOwningPtr &ptr) |
Assigns the pointer to another pointer. More... | |
A container for pointers where the lifetime should be owned by the caller.
Any function/class requiring a NotOwningPtr will be required to manage the lifetime of the object. If the object is deleted before the function/class has finished with it then unexpected errors will occur.
T | The type of pointer which is not owned. |
|
inlineexplicit |
Create a new NotOwningPtr with a pointer to the actual object.
|
inline |
Copy constructor to allow copying the pointer.
|
inline |
Gets the not owned pointer.
|
inline |
Gets the not owned pointer as a constant.
|
inline |
Checks inequality of this not owned pointer and another.
[in] | ptr | The other not owned pointer. |
|
inline |
Gets the dereferenced object.
|
inline |
Gets the dereferenced object as a constant.
|
inline |
Gets the not owned pointer.
|
inline |
Gets the not owned pointer as a constant.
|
inline |
Assigns the pointer to another pointer.
[in] | ptr | The other not owned pointer. |
|
inline |
Checks equality of this not owned pointer and another.
[in] | ptr | The other not owned pointer. |