polybori::CExtrusivePtr< DataType, ValueType > Class Template Reference

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...

## Detailed Description

### template<class DataType, class ValueType>
class polybori::CExtrusivePtr< DataType, ValueType >

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`.

## Member Typedef Documentation

template<class DataType, class ValueType>

typedef DataType polybori::CExtrusivePtr< DataType, ValueType >::data_type

Type for additional data storange.

template<class DataType, class ValueType>

typedef ValueType polybori::CExtrusivePtr< DataType, ValueType >::value_type

Value type.

## Constructor & Destructor Documentation

template<class DataType, class ValueType>

polybori::CExtrusivePtr< DataType, ValueType >::CExtrusivePtr | ( | const data_type & | data,
|  | value_type * | ptr
| ) |  |

inline

Construct managed pointer with additional data.

template<class DataType, class ValueType>

polybori::CExtrusivePtr< DataType, ValueType >::CExtrusivePtr | ( | const self & | rhs | ) |

inline

Copy constructor.

template<class DataType, class ValueType>

polybori::CExtrusivePtr< DataType, ValueType >::CExtrusivePtr | ( |  | ) |

inline

template<class DataType, class ValueType>

polybori::CExtrusivePtr< DataType, ValueType >::~CExtrusivePtr | ( |  | ) |

inline

Destructor.

## Member Function Documentation

template<class DataType, class ValueType>

const data_type& polybori::CExtrusivePtr< DataType, ValueType >::data | ( |  | ) | const

inline

Accessing helpter data.

template<class DataType, class ValueType>

value_type* polybori::CExtrusivePtr< DataType, ValueType >::get | ( |  | ) | const

inline

Get actual pointer.

Referenced by polybori::operator!=(), and polybori::operator==().

template<class DataType, class ValueType>

void polybori::CExtrusivePtr< DataType, ValueType >::lock | ( |  | ) |

inline protected

template<class DataType, class ValueType>

const value_type& polybori::CExtrusivePtr< DataType, ValueType >::operator* | ( |  | ) | const

inline

Constant dereferencing.

template<class DataType, class ValueType>

value_type& polybori::CExtrusivePtr< DataType, ValueType >::operator* | ( |  | ) |

inline

Nonconstant dereference.

template<class DataType, class ValueType>

value_type* polybori::CExtrusivePtr< DataType, ValueType >::operator-> | ( |  | ) | const

inline

Pointer operator.

template<class DataType, class ValueType>

self& polybori::CExtrusivePtr< DataType, ValueType >::operator= | ( | const self & | rhs | ) |

inline

Assignment.

template<class DataType, class ValueType>

void polybori::CExtrusivePtr< DataType, ValueType >::release | ( |  | ) |

inline protected

template<class DataType, class ValueType>

void polybori::CExtrusivePtr< DataType, ValueType >::swap | ( | self & | rhs | ) |

inline

Swap.

## Member Data Documentation

template<class DataType, class ValueType>

data_type polybori::CExtrusivePtr< DataType, ValueType >::m_data

protected

Store helper data.

template<class DataType, class ValueType>

value_type* polybori::CExtrusivePtr< DataType, ValueType >::p_ptr

protected

Store actual pointer.

The documentation for this class was generated from the following file:

- CExtrusivePtr.h