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>

List of all members.

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.
selfoperator= (const self &rhs)
 Assignment.
const data_typedata () const
 Accessing helpter data.
value_typeget () const
 Get actual pointer.
const value_typeoperator* () const
 Constant dereferencing.
value_typeoperator* ()
 Nonconstant dereference.
value_typeoperator-> () 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_typep_ptr
 Store actual pointer.


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>
self& polybori::CExtrusivePtr< DataType, ValueType >::operator= ( const self rhs  )  [inline]

Assignment.

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>
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>
void polybori::CExtrusivePtr< DataType, ValueType >::swap ( self rhs  )  [inline]

Swap.

template<class DataType, class ValueType>
void polybori::CExtrusivePtr< DataType, ValueType >::lock (  )  [inline, protected]

template<class DataType, class ValueType>
void polybori::CExtrusivePtr< DataType, ValueType >::release (  )  [inline, protected]


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:

Generated on Wed Jan 30 16:39:53 2013 for PolyBoRi by  doxygen 1.5.6