"Smart pointer". Wrapper that automatically deletes its managed pointer when the internal reference count is zero and the last goAutoPtr is deleted.
More...
#include <goautoptr.h>
|
| goAutoPtr (T *p) |
| Initialises a new pointer and sets the reference count to 1. More...
|
|
void | set (T *p) |
|
T * | get () |
|
const T * | get () const |
|
void | reset () |
| Reset the pointer and reference count. Decrements the current reference count, if a pointer is set, and deletes the pointer if the reference is 0.
|
|
| ~goAutoPtr () |
| Decrements the reference count and, if it is 0, deletes the pointer (if any).
|
|
| goAutoPtr (const goAutoPtr< T > &other) |
| Reference the same object as other. More...
|
|
template<class To > |
| goAutoPtr (const goAutoPtr< To > &other) |
|
goRRefPtr< void > * | getRRefPtr () |
|
const goRRefPtr< void > * | getRRefPtr () const |
|
goAutoPtr< T > & | operator= (const goAutoPtr< T > &other) |
|
template<class To > |
goAutoPtr< T > & | operator= (const goAutoPtr< To > &other) |
|
bool | isNull () const |
|
template<class To > |
bool | operator== (const goAutoPtr< To > &other) const |
|
template<class To > |
bool | operator!= (const goAutoPtr< To > &other) const |
|
bool | operator== (const T *p) const |
|
bool | operator!= (const T *p) const |
|
T & | operator* () |
| The usual unary operator*(). More...
|
|
T * | operator-> () |
| The usual operator->(). More...
|
|
| operator T* () |
|
| operator const T * () const |
|
template<class T>
class goAutoPtr< T >
"Smart pointer". Wrapper that automatically deletes its managed pointer when the internal reference count is zero and the last goAutoPtr is deleted.
- Examples
- sumproduct/sp.cpp.
◆ goAutoPtr() [1/2]
Initialises a new pointer and sets the reference count to 1.
- Parameters
-
◆ goAutoPtr() [2/2]
Reference the same object as other.
- Note
- The const classifier is only here to ensure that this class works with lists and the like. No RefPtr is const.
- Parameters
-
◆ operator*()
The usual unary operator*().
- Returns
- Reference to the managed object.
◆ operator->()
The usual operator->().
- Returns
- Pointer to the managed object.
◆ operator=()
template<class T>
template<class To >
- Note
- The const classifier is only here to ensure that this class works with lists and the like. No RefPtr is const.
- Bug:
- SEE CODE!
- Parameters
-
- Returns
The documentation for this class was generated from the following file: