acedia::ReferenceCounted Class Reference

Base class for reference counted objects. More...

#include <referencecounted.hpp>

Inheritance diagram for acedia::ReferenceCounted:
acedia::AbstractActor acedia::Actor acedia::ActorProxy

List of all members.

Public Member Functions

 ReferenceCounted (boost::int32_t initValue) throw ()
 Create a new reference counted object.
void ref ()
 Atomically inrement reference count by one.
bool deref ()
 Atomically decrement reference count by one.
bool isUnreferenced ()
 Atomically checks if there is no reference.
bool isUnique ()
 Atomically checks if there is exactly one reference.

Detailed Description

Base class for reference counted objects.

This class is a simple wrapper around an atomic counter and provides the methods ref() and deref().

ReferenceCounted is neither copyable nor assignable.

Definition at line 45 of file referencecounted.hpp.


Member Function Documentation

bool acedia::ReferenceCounted::deref (  )  [inline]

Atomically decrement reference count by one.

Returns:
true if there are still references to this object (reference count > 0); otherwise false

Definition at line 70 of file referencecounted.hpp.

bool acedia::ReferenceCounted::isUnique (  )  [inline]

Atomically checks if there is exactly one reference.

Returns:
true if there is exactly one reference to this object; otherwise false

Definition at line 84 of file referencecounted.hpp.

bool acedia::ReferenceCounted::isUnreferenced (  )  [inline]

Atomically checks if there is no reference.

Returns:
true if there is no reference to this object; otherwise false

Definition at line 77 of file referencecounted.hpp.


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

Generated by  doxygen 1.6.2