ReferenceCount Class Reference

counts the number of smartpointers refering to it More...

#include <reference-count.h>

Inheritance diagram for ReferenceCount:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 ReferenceCount ()
 ReferenceCount (const ReferenceCount &)
ReferenceCountoperator= (const ReferenceCount &o)
void incref ()
int decref ()
virtual ~ReferenceCount ()

Public Attributes

volatile int reference_count

Detailed Description

counts the number of smartpointers refering to it

Keeps track of the number of reference floating around to this object. This class is resistent to concurrent access. In other words the reference_count will be atomically increased and decreased


Constructor & Destructor Documentation

ReferenceCount::ReferenceCount (  )  [inline]
ReferenceCount::ReferenceCount ( const ReferenceCount  )  [inline]
virtual ReferenceCount::~ReferenceCount (  )  [inline, virtual]

destroys the object. In this case performs a sanity check on the refernce_count.

References assert(), and reference_count.


Member Function Documentation

int ReferenceCount::decref (  )  [inline]

decreases the refernce count. Returns the new reference count.

References cmpxchg, and reference_count.

void ReferenceCount::incref (  )  [inline]

atomically increases the reference count.

References assert(), cmpxchg, and reference_count.

ReferenceCount& ReferenceCount::operator= ( const ReferenceCount o  )  [inline]

References assert(), and reference_count.


Member Data Documentation

The number of smart pointers refering to this object. 0 if none.

Referenced by decref(), incref(), operator=(), and ~ReferenceCount().


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

Generated by  doxygen 1.6.2