#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 | ( | ) |
Allocate a new instance.
| Bakery::sharedptr< T_obj >::sharedptr | ( | T_obj * | pobj | ) | [explicit] |
Take ownership.
| Bakery::sharedptr< T_obj >::sharedptr | ( | const sharedptr< T_obj > & | src | ) |
Share ownership.
| Bakery::sharedptr< T_obj >::~sharedptr | ( | ) | [virtual] |
| const T_obj * Bakery::sharedptr< T_obj >::obj | ( | ) | const [inline] |
Get the underlying instance:.
| T_obj * Bakery::sharedptr< T_obj >::obj | ( | ) | [inline] |
Get the underlying instance:.
| const T_obj & Bakery::sharedptr< T_obj >::operator * | ( | ) | const [inline] |
Dereferencing.
| T_obj & Bakery::sharedptr< T_obj >::operator * | ( | ) | [inline] |
Dereferencing.
| 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 >::operator-> | ( | ) | const [inline] |
Dereferencing.
Use the methods of the underlying instance like so:
refptr->memberfun()
| sharedptr& Bakery::sharedptr< T_obj >::operator= | ( | const sharedptr< T_obj > & | src | ) |
Share ownership.
| void Bakery::sharedptr< T_obj >::ref | ( | ) | [inline, protected] |
| void Bakery::sharedptr< T_obj >::unref | ( | ) | [inline, protected] |
T_obj* Bakery::sharedptr< T_obj >::m_pobj [protected] |
size_type* Bakery::sharedptr< T_obj >::m_pRefCount [protected] |
1.4.7