libbbb  1.2.1
Groups common code used in some applications and libraries.
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
bbb::RefCnt Class Reference

Class that may be used as base for reference counting of instances. More...

#include <refcnt.h>

+ Inheritance diagram for bbb::RefCnt:

Public Member Functions

 RefCnt (void)
 constructor;
 
void incRef (void)
 increase reference counter
 
void decRef (void)
 decrease reference counter
 
unsigned int referenceCount (void)
 number of times this instance was referenced
 
void forceDelete (void)
 if the caller knows what is doing it should use this
 

Protected Member Functions

virtual ~RefCnt (void)
 destructor;
 

Detailed Description

Class that may be used as base for reference counting of instances.

The class simply provides two methods - incRef() and decRef() - and adds a counter to the class. Whitin decRef(), if the counter reaches 0 the instance is deleted.

Inside the constructor the reference counter is set to 1. The caller needs to decrement the counter when it is done with its reference.


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