NewNet::RefCounter Class Reference

Helper class for reference counting. More...

#include <nnrefcounter.h>

List of all members.

Public Member Functions

 RefCounter ()
 Create a new reference counter object.
void operator++ ()
 Increment the reference count.
bool operator-- ()
 Decrement the reference count.
unsigned int count ()
 Return the reference count.


Detailed Description

This class basically provides an int that's guaranteed to me 0 when the refcounter is constructed. Provides increment and decrement operators. The decrement operator will return true if the reference count drops to zero.

Definition at line 38 of file nnrefcounter.h.


Constructor & Destructor Documentation

NewNet::RefCounter::RefCounter (  )  [inline]

Creates a new reference counter object with the reference count initialized at 0.

Definition at line 44 of file nnrefcounter.h.


Member Function Documentation

void NewNet::RefCounter::operator++ (  )  [inline]

Increment the reference count by 1.

Definition at line 50 of file nnrefcounter.h.

bool NewNet::RefCounter::operator-- (  )  [inline]

Decrement the reference count by 1. Returns true if the reference count drops to zero. Delete the owner object if that happens.

Definition at line 58 of file nnrefcounter.h.

unsigned int NewNet::RefCounter::count (  )  [inline]

Return the value of this reference counter.

Definition at line 77 of file nnrefcounter.h.

Referenced by NewNet::Object::~Object().


The documentation for this class was generated from the following file:
Generated on Sun Jan 7 14:00:02 2007 for NewNet by  doxygen 1.5.1