#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 |
typedef size_t Bakery::sharedptr< T_obj >::size_type |
Bakery::sharedptr< T_obj >::sharedptr | ( | ) | [inline] |
Allocate a new instance.
Bakery::sharedptr< T_obj >::sharedptr | ( | T_obj * | pobj | ) | [inline, explicit] |
Take ownership.
Bakery::sharedptr< T_obj >::sharedptr | ( | const sharedptr< T_obj > & | src | ) | [inline] |
Share ownership.
Bakery::sharedptr< T_obj >::~sharedptr | ( | ) | [inline, virtual] |
sharedptr< T_obj > & Bakery::sharedptr< T_obj >::operator= | ( | const sharedptr< T_obj > & | src | ) | [inline] |
Share ownership.
T_obj & Bakery::sharedptr< T_obj >::operator * | ( | ) | [inline] |
Dereferencing.
const T_obj & Bakery::sharedptr< T_obj >::operator * | ( | ) | const [inline] |
Dereferencing.
T_obj * Bakery::sharedptr< T_obj >::operator-> | ( | ) | const [inline] |
Dereferencing.
Use the methods of the underlying instance like so:
refptr->memberfun()
Bakery::sharedptr< T_obj >::operator bool | ( | ) | const [inline] |
Test whether the RefPtr<> points to any underlying instance.
Mimics usage of ordinary pointers:
if (ptr)
do_something();
T_obj * Bakery::sharedptr< T_obj >::obj | ( | ) | [inline] |
Get the underlying instance:.
const T_obj * Bakery::sharedptr< T_obj >::obj | ( | ) | const [inline] |
Get the underlying instance:.
void Bakery::sharedptr< T_obj >::ref | ( | ) | [inline, protected] |
void Bakery::sharedptr< T_obj >::unref | ( | ) | [inline, protected] |
size_type* Bakery::sharedptr< T_obj >::m_pRefCount [protected] |
T_obj* Bakery::sharedptr< T_obj >::m_pobj [protected] |