Free Electron
Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Attributes | List of all members
fe::Counted Class Reference

Heap-based support for classes participating in fe::ptr <> More...

#include <Counted.h>

Inheritance diagram for fe::Counted:
Inheritance graph
[legend]

Public Member Functions

virtual void acquire (void)
 Increment the reference count. More...
 
virtual void acquire (int &rCount)
 Increment the reference count (and get the count) More...
 
virtual void release (void)
 Decrement the reference count. More...
 
virtual void abandon (void)
 Decrement the reference count. More...
 
int count (void) const
 Return the count of references. More...
 
void setName (const String &)
 
void trackReference (void *pReference, String what)
 
void untrackReference (void *pReference)
 
void registerRegion (void *pT, U32 bytes)
 

Static Public Member Functions

static String reportTracker (void)
 
static U32 trackerCount (void)
 

Protected Member Functions

int releaseInternal (void)
 Decrement the reference count. More...
 
void suppressReport (void)
 

Private Attributes

int m_count
 

Detailed Description

Heap-based support for classes participating in fe::ptr <>

acquire() and release() are required methods for fe::ptr <>.

Member Function Documentation

◆ abandon()

virtual void fe::Counted::abandon ( void  )
inlinevirtual

Decrement the reference count.

Do not delete, even if count reaches zero. This is used to abandon a Counted from reference counting, although it remains valid to be picked up by reference counting again.

◆ acquire() [1/2]

virtual void fe::Counted::acquire ( void  )
inlinevirtual

Increment the reference count.

Reimplemented in fe::Component.

Referenced by fe::Component::acquire(), and fe::Component::isSingleton().

◆ acquire() [2/2]

virtual void fe::Counted::acquire ( int &  rCount)
inlinevirtual

Increment the reference count (and get the count)

◆ count()

int fe::Counted::count ( void  ) const
inline

◆ release()

virtual void fe::Counted::release ( void  )
inlinevirtual

Decrement the reference count.

When the count reaches zero, the object is deleted.

Reimplemented in fe::Component, fe::ext::NetHost, and fe::SingleMaster.

Referenced by fe::ext::NetHost::release().

◆ releaseInternal()

int fe::Counted::releaseInternal ( void  )
inlineprotected

Decrement the reference count.

Returns the count after decrementing the references. The intent is that a substitute release() can call releaseInternal(), then conditionally delete the object after doing some custom cleanup that is not suitable for putting in the destructor.


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