xoreos
0.0.5
|
Base template class for a disposable pointer. More...
#include <disposableptr.h>
Public Types | |
typedef T | ValueType |
typedef T * | PointerType |
typedef T & | ReferenceType |
Public Member Functions | |
DisposablePtrBase (PointerType o, bool d) | |
XOREOS_EXPLICIT_OPERATOR_CONV | operator bool () const |
Implicit conversion operator to bool for convenience, to make checks like "if (disposablePtr) ..." possible. More... | |
~DisposablePtrBase () | |
void | reset (PointerType o=0) |
Resets the pointer with the new value. More... | |
PointerType | get () const |
Returns the plain pointer value. More... | |
void | setDisposable (bool d) |
Change the disposable flag. More... | |
void | dispose () |
Unconditionally dispose of the pointer, destroying the old object. More... | |
Private Attributes | |
PointerType | _pointer |
bool | _dispose |
Base template class for a disposable pointer.
Manages the pointer and allows for optional, automatic deletion through a deallocator template parameter.
Definition at line 68 of file disposableptr.h.
typedef T* Common::DisposablePtrBase< T, Deallocator >::PointerType |
Definition at line 71 of file disposableptr.h.
typedef T& Common::DisposablePtrBase< T, Deallocator >::ReferenceType |
Definition at line 72 of file disposableptr.h.
typedef T Common::DisposablePtrBase< T, Deallocator >::ValueType |
Definition at line 70 of file disposableptr.h.
|
inlineexplicit |
Definition at line 74 of file disposableptr.h.
|
inline |
Definition at line 81 of file disposableptr.h.
|
inline |
Unconditionally dispose of the pointer, destroying the old object.
Definition at line 104 of file disposableptr.h.
Referenced by Common::MemoryWriteStreamDynamic::dispose(), and Common::MemoryWriteStreamDynamic::reserve().
|
inline |
Returns the plain pointer value.
Definition at line 98 of file disposableptr.h.
Referenced by Common::MemoryReadStream::getData(), Common::MemoryWriteStreamDynamic::getData(), Common::DisposablePtr< Common::WriteStream >::operator*(), Common::DisposablePtr< Common::WriteStream >::operator->(), Common::DisposableArray< byte >::operator[](), Common::MemoryWriteStreamDynamic::pos(), Common::MemoryWriteStreamDynamic::reserve(), Common::MemoryReadStream::seek(), and Common::MemoryWriteStreamDynamic::seek().
|
inline |
Implicit conversion operator to bool for convenience, to make checks like "if (disposablePtr) ..." possible.
Definition at line 79 of file disposableptr.h.
|
inline |
Resets the pointer with the new value.
The old object will be destroyed.
Definition at line 87 of file disposableptr.h.
Referenced by Common::MemoryWriteStreamDynamic::reserve().
|
inline |
Change the disposable flag.
Definition at line 101 of file disposableptr.h.
Referenced by Common::MemoryWriteStreamDynamic::setDisposable().
|
private |
|
private |
Definition at line 110 of file disposableptr.h.
Referenced by Common::DisposablePtrBase< byte, DeallocatorArray >::dispose(), Common::DisposablePtrBase< byte, DeallocatorArray >::get(), Common::DisposablePtrBase< byte, DeallocatorArray >::operator bool(), Common::DisposablePtrBase< byte, DeallocatorArray >::reset(), and Common::DisposablePtrBase< byte, DeallocatorArray >::~DisposablePtrBase().