RSC  0.16.0
rsc::misc::ParentSharedPtrDeleter< ParentType > Class Template Reference

A deleter for boost::shared_ptr which enables to use a pointer in a shared_ptr, which is not a shared_ptr itself and owned by another object. More...

#include <langutils.h>

Collaboration diagram for rsc::misc::ParentSharedPtrDeleter< ParentType >:
Collaboration graph

Public Member Functions

 ParentSharedPtrDeleter (boost::shared_ptr< ParentType > parent)
 
void operator() (void const *)
 

Private Attributes

boost::shared_ptr< ParentType > parent
 

Detailed Description

template<class ParentType>
class rsc::misc::ParentSharedPtrDeleter< ParentType >

A deleter for boost::shared_ptr which enables to use a pointer in a shared_ptr, which is not a shared_ptr itself and owned by another object.

The only requirement is that this object in turn is maintained by a shared_ptr. This deleter effectively keeps up the reference count of the parent object by storing an instance of a shared_ptr to the parent until the child ptr is deleted.

Author
jwienke
Template Parameters
ParentTypetype of the parent which is owned by a shared_ptr

Definition at line 73 of file langutils.h.

Constructor & Destructor Documentation

template<class ParentType >
rsc::misc::ParentSharedPtrDeleter< ParentType >::ParentSharedPtrDeleter ( boost::shared_ptr< ParentType >  parent)
inline

Definition at line 75 of file langutils.h.

Member Function Documentation

template<class ParentType >
void rsc::misc::ParentSharedPtrDeleter< ParentType >::operator() ( void const *  )
inline

Definition at line 79 of file langutils.h.

Member Data Documentation

template<class ParentType >
boost::shared_ptr<ParentType> rsc::misc::ParentSharedPtrDeleter< ParentType >::parent
private

Definition at line 84 of file langutils.h.


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