cxxtools::InternalRefCounted< ObjectType > Class Template Reference

Intrusive reference counting. More...

#include <cxxtools/smartptr.h>

Protected Member Functions

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

Detailed Description

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

Intrusive reference counting.

Parameters
ObjectTypeThe managed object type

Intrusive reference couting means that the reference count is part of the managed heap object. Linking and unlinking will only increase and decrease this counter, but not delete it. The managed object needs to implement the methods release() and addRef(). The release must return something, that equals 0 when the last reference is released.

Member Function Documentation

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

link a smart pointer to a managed object

template<typename ObjectType>
bool cxxtools::InternalRefCounted< ObjectType >::unlink ( ObjectType *  object)
inlineprotected

unlink a smart pointer from a managed object


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