#include <FXRefedObject.h>
Inheritance diagram for FX::FXRefedObject< intType, lastUsed, referrersPolicy >:
intType | The type of the container maintaining the reference count. Usually int or FX::FXAtomicInt | |
lastUsed | Can be FX::Pol::hasLastUsed | |
referrersPolicy | Either FX::Pol::unknownReferrers or FX::Pol::knowReferrers |
delete this
. You of course should override this with anything you like. noMoreReferrers() will never be called more than once and once it has been called, even if the object is not deleted all attempts to open a new reference upon it will return a null reference. If you don't want this, specialise FX::FXRefedObjectImpl::countHolder (see the header file).You can temporarily disable the reference counting mechanism by instantiating a FX::FXRefedObject_DisableCount. This is useful during refed object initialisation where it may end up temporarily opening a reference on itself, thus causing deletion of itself during construction as no other reference exists yet.
A specialisation exists for FX::FXAtomicInt which implements an atomic reference count (despite not actually using FX::FXAtomicInt directly to do it).
Definition at line 257 of file FXRefedObject.h.
Public Member Functions | |
FXRefedObject () | |
virtual | ~FXRefedObject () |
FXRefedObject (const FXRefedObject &o) | |
const intType & | refCount () const throw () |
void | resetDying () throw () |
Protected Member Functions | |
virtual void | noMoreReferrers () |
bool | int_increfcount () |
bool | int_decrefcount () |
Friends | |
class | FXRefingObjectImpl::refedObject |
struct | FXRefingObjectImpl::dataHolderI |
class | FXRefedObject_DisableCount |