This is a standard reference counting pointer. Be careful not to have two of these point to the same raw pointer or one will be deleted while the other still thinks it is valid.
More...
#include <Utils.h>
template<typename T>
class CSmartPtr< T >
This is a standard reference counting pointer. Be careful not to have two of these point to the same raw pointer or one will be deleted while the other still thinks it is valid.
- Author
- prozac proza.nosp@m.c@ro.nosp@m.ttenb.nosp@m.oy.c.nosp@m.om
Standard constructor, points to nothing.
Attach to an existing raw pointer, be CAREFUL not to have more than one CSmartPtr attach to the same raw pointer or bad things will happen.
- Parameters
-
pRawPtr | The raw pointer to attach to |
Copy constructor, will copy the raw pointer and counter locations and increment the reference counter.
- Parameters
-
CopyFrom | A reference of another CSmartPtr to copy from |
Destructor will Release() the raw pointer and delete it if this was the last reference.
template<typename T>
unsigned int CSmartPtr< T >::GetCount |
( |
| ) |
const |
|
inline |
Implicit type conversion to bool for things like if (!ptr) {} and if (ptr) {}.
- Returns
- See Also
- IsNull()
Attach() to a raw pointer.
- Parameters
-
pRawPtr | The raw pointer to keep track of, ***WARNING*** Do NOT allow more than one CSmartPtr keep track of the same raw pointer |
- Returns
- Reference to self
Copies an existing CSmartPtr adding another reference to the counter.
- Parameters
-
CopyFrom | A reference to another CSmartPtr to be copied |
- Returns
- Reference to self
The documentation for this class was generated from the following file: