PolyBoRi
|
This template class defines a reimplementation of the interface from boost:intrusive_ptr, but with an additional data field. More...
#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. |
This template class defines a reimplementation of the interface from boost:intrusive_ptr, but with an additional data field.
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*)
If 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::data_type |
Type for additional data storange.
typedef ValueType polybori::CExtrusivePtr::value_type |
Value type.
polybori::CExtrusivePtr::CExtrusivePtr | ( | const data_type & | data, |
value_type * | ptr | ||
) | [inline] |
Construct managed pointer with additional data.
polybori::CExtrusivePtr::CExtrusivePtr | ( | const self & | rhs | ) | [inline] |
Copy constructor.
polybori::CExtrusivePtr::CExtrusivePtr | ( | ) | [inline] |
polybori::CExtrusivePtr::~CExtrusivePtr | ( | ) | [inline] |
Destructor.
const data_type& polybori::CExtrusivePtr::data | ( | ) | const [inline] |
Accessing helpter data.
value_type* polybori::CExtrusivePtr::get | ( | ) | const [inline] |
Get actual pointer.
void polybori::CExtrusivePtr::lock | ( | ) | [inline, protected] |
const value_type& polybori::CExtrusivePtr::operator* | ( | ) | const [inline] |
Constant dereferencing.
value_type& polybori::CExtrusivePtr::operator* | ( | ) | [inline] |
Nonconstant dereference.
value_type* polybori::CExtrusivePtr::operator-> | ( | ) | const [inline] |
Pointer operator.
void polybori::CExtrusivePtr::release | ( | ) | [inline, protected] |
void polybori::CExtrusivePtr::swap | ( | self & | rhs | ) | [inline] |
Swap.
data_type polybori::CExtrusivePtr::m_data [protected] |
Store helper data.
value_type* polybori::CExtrusivePtr::p_ptr [protected] |
Store actual pointer.