#include <sharedptr.h>
Public Types | |
typedef size_t | size_type |
Public Member Functions | |
sharedptr () | |
Allocate a new instance. | |
sharedptr (T_obj *pobj) | |
Take ownership. | |
sharedptr (const sharedptr &src) | |
Share ownership. | |
sharedptr & | operator= (const sharedptr &src) |
Share ownership. | |
virtual | ~sharedptr () |
T_obj & | operator * () |
Dereferencing. | |
const T_obj & | operator * () const |
Dereferencing. | |
T_obj * | operator-> () const |
Dereferencing. | |
operator bool () const | |
Test whether the RefPtr<> points to any underlying instance. | |
T_obj * | obj () |
Get the underlying instance:. | |
const T_obj * | obj () const |
Get the underlying instance:. | |
Protected Member Functions | |
void | ref () |
void | unref () |
Protected Attributes | |
size_type * | m_pRefCount |
T_obj * | m_pobj |
|
|
|
Allocate a new instance.
|
|
Take ownership.
|
|
Share ownership.
|
|
|
|
Get the underlying instance:.
|
|
Get the underlying instance:.
|
|
Dereferencing.
|
|
Dereferencing.
|
|
Test whether the RefPtr<> points to any underlying instance. Mimics usage of ordinary pointers: if (ptr)
do_something();
|
|
Dereferencing. Use the methods of the underlying instance like so: refptr->memberfun() |
|
Share ownership.
|
|
|
|
|
|
|
|
|