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. More... | |
typedef ValueType | value_type |
Value type. More... | |
Public Member Functions | |
CExtrusivePtr (const data_type &data, value_type *ptr) | |
Construct managed pointer with additional data. More... | |
CExtrusivePtr (const self &rhs) | |
Copy constructor. More... | |
CExtrusivePtr () | |
~CExtrusivePtr () | |
Destructor. More... | |
self & | operator= (const self &rhs) |
Assignment. More... | |
const data_type & | data () const |
Accessing helpter data. More... | |
value_type * | get () const |
Get actual pointer. More... | |
const value_type & | operator* () const |
Constant dereferencing. More... | |
value_type & | operator* () |
Nonconstant dereference. More... | |
value_type * | operator-> () const |
Pointer operator. More... | |
void | swap (self &rhs) |
Swap. More... | |
Protected Member Functions | |
void | lock () |
void | release () |
Protected Attributes | |
data_type | m_data |
Store helper data. More... | |
value_type * | p_ptr |
Store actual pointer. More... | |
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:
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< DataType, ValueType >::data_type |
Type for additional data storange.
typedef ValueType polybori::CExtrusivePtr< DataType, ValueType >::value_type |
Value type.
|
inline |
Construct managed pointer with additional data.
|
inline |
Copy constructor.
|
inline |
|
inline |
Destructor.
|
inline |
Accessing helpter data.
|
inline |
Get actual pointer.
Referenced by polybori::operator!=(), and polybori::operator==().
|
inlineprotected |
|
inline |
Constant dereferencing.
|
inline |
Nonconstant dereference.
|
inline |
Pointer operator.
|
inline |
Assignment.
|
inlineprotected |
|
inline |
Swap.
|
protected |
Store helper data.
|
protected |
Store actual pointer.