#include <CExtrusivePtr.h>
Public Types | |
typedef DataType | data_type |
Type for additional data storange. | |
typedef ValueType | value_type |
Value type. | |
Public Member Functions | |
CExtrusivePtr (const data_type &data, value_type *ptr) | |
Construct managed pointer with additional data. | |
CExtrusivePtr (const self &rhs) | |
Copy constructor. | |
CExtrusivePtr () | |
~CExtrusivePtr () | |
Destructor. | |
self & | operator= (const self &rhs) |
Assignment. | |
const data_type & | data () const |
Accessing helpter data. | |
value_type * | get () const |
Get actual pointer. | |
const value_type & | operator* () const |
Constant dereferencing. | |
value_type & | operator* () |
Nonconstant dereference. | |
value_type * | operator-> () const |
Pointer operator. | |
void | swap (self &rhs) |
Swap. | |
Protected Member Functions | |
void | lock () |
void | release () |
Protected Attributes | |
data_type | m_data |
Store helper data. | |
value_type * | p_ptr |
Store actual pointer. |
The data field can be used as a helper for the incrementing and decrementing reference counts. Very much like in boost::intrusive_ptr, the following functions have to be defined:
void extrusive_ptr_release(const DataType&, ValueType*); void extrusive_ptr_add_ref(const DataType&, ValueType*)
DataType
is ignored, this is essentially boost::intrusive_ptr
, while something like DataType = int* could be used to implement something like boost::shared_ptr
. typedef DataType polybori::CExtrusivePtr< DataType, ValueType >::data_type |
Type for additional data storange.
typedef ValueType polybori::CExtrusivePtr< DataType, ValueType >::value_type |
Value type.
polybori::CExtrusivePtr< DataType, ValueType >::CExtrusivePtr | ( | const data_type & | data, | |
value_type * | ptr | |||
) | [inline] |
Construct managed pointer with additional data.
polybori::CExtrusivePtr< DataType, ValueType >::CExtrusivePtr | ( | const self & | rhs | ) | [inline] |
Copy constructor.
polybori::CExtrusivePtr< DataType, ValueType >::CExtrusivePtr | ( | ) | [inline] |
polybori::CExtrusivePtr< DataType, ValueType >::~CExtrusivePtr | ( | ) | [inline] |
Destructor.
self& polybori::CExtrusivePtr< DataType, ValueType >::operator= | ( | const self & | rhs | ) | [inline] |
Assignment.
const data_type& polybori::CExtrusivePtr< DataType, ValueType >::data | ( | ) | const [inline] |
Accessing helpter data.
value_type* polybori::CExtrusivePtr< DataType, ValueType >::get | ( | ) | const [inline] |
const value_type& polybori::CExtrusivePtr< DataType, ValueType >::operator* | ( | ) | const [inline] |
Constant dereferencing.
value_type& polybori::CExtrusivePtr< DataType, ValueType >::operator* | ( | ) | [inline] |
Nonconstant dereference.
value_type* polybori::CExtrusivePtr< DataType, ValueType >::operator-> | ( | ) | const [inline] |
Pointer operator.
void polybori::CExtrusivePtr< DataType, ValueType >::swap | ( | self & | rhs | ) | [inline] |
Swap.
void polybori::CExtrusivePtr< DataType, ValueType >::lock | ( | ) | [inline, protected] |
void polybori::CExtrusivePtr< DataType, ValueType >::release | ( | ) | [inline, protected] |
data_type polybori::CExtrusivePtr< DataType, ValueType >::m_data [protected] |
Store helper data.
value_type* polybori::CExtrusivePtr< DataType, ValueType >::p_ptr [protected] |
Store actual pointer.