cxxtools::ExternalRefCounted< ObjectType > Class Template Reference

Non-intrusive reference counting. More...

#include <cxxtools/smartptr.h>

Public Member Functions

unsigned refs () const

Protected Member Functions

 ExternalRefCounted ()
bool unlink (ObjectType *object)
 unlink a smart pointer from a managed object
void link (const ExternalRefCounted &ptr, ObjectType *object)
 link a smart pointer to a managed object

Detailed Description

template<typename ObjectType>
class cxxtools::ExternalRefCounted< ObjectType >

Non-intrusive reference counting.

Parameters
ObjectTypeThe managed object type

Non-intrusive reference couting means that the reference count is not part of the managed heap object but part of the policy. Linking and unlinking will increase and decrease the policies counter and delete the managed object if it reaches zero. A small amount of memory needs to be allocated for the counter variable.

Constructor & Destructor Documentation

template<typename ObjectType>
cxxtools::ExternalRefCounted< ObjectType >::ExternalRefCounted ( )
inlineprotected

Member Function Documentation

template<typename ObjectType>
void cxxtools::ExternalRefCounted< ObjectType >::link ( const ExternalRefCounted< ObjectType > &  ptr,
ObjectType *  object 
)
inlineprotected

link a smart pointer to a managed object

template<typename ObjectType>
unsigned cxxtools::ExternalRefCounted< ObjectType >::refs ( ) const
inline
template<typename ObjectType>
bool cxxtools::ExternalRefCounted< ObjectType >::unlink ( ObjectType *  object)
inlineprotected

unlink a smart pointer from a managed object


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