Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

base::Referenced Class Reference

Inheritance diagram for base::Referenced:

Inheritance graph
[legend]
Collaboration diagram for base::Referenced:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Referenced ()
 Referenced (const Referenced &c)
void reference () const
bool unreference () const
const int referenceCount () const
void enableOnUnreferenceCall (bool enabled)
virtual void onUnreference () const
virtual ~Referenced ()

Protected Attributes

int _refCount
bool onUnreferenceEnabled

Detailed Description

Base class for intrusively referenced counted objects. Used by class ref

Definition at line 34 of file Referenced.


Constructor & Destructor Documentation

base::Referenced::Referenced  )  [inline]
 

Definition at line 38 of file Referenced.

References _refCount, DEBUG, Exception, and onUnreferenceEnabled.

base::Referenced::Referenced const Referenced c  )  [inline]
 

Definition at line 54 of file Referenced.

References _refCount, DEBUG, and onUnreferenceEnabled.

virtual base::Referenced::~Referenced  )  [inline, virtual]
 

Definition at line 125 of file Referenced.

References _refCount, and Exception.


Member Function Documentation

void base::Referenced::enableOnUnreferenceCall bool  enabled  )  [inline]
 

If enabled, each call to unreference() will also call virtual method onUnreference()

Definition at line 115 of file Referenced.

References onUnreferenceEnabled.

virtual void base::Referenced::onUnreference  )  const [inline, virtual]
 

Called by unreference() if enabled via enableOnUnreferenceCall(true). Typically overridden in subclasses that wish to know about unreference() calls - for example to handle manually breaking cyclic references

Reimplemented in robot::control::ControllableAdaptor::AdaptorControlInterface, and robot::control::ControllableAdaptor.

Definition at line 121 of file Referenced.

Referenced by unreference().

void base::Referenced::reference  )  const [inline]
 

Increment the reference count by one, indicating that this object has another pointer which is referencing it.

Definition at line 65 of file Referenced.

References _refCount.

const int base::Referenced::referenceCount  )  const [inline]
 

Return the number pointers currently referencing this object.

Definition at line 112 of file Referenced.

References _refCount.

Referenced by robot::control::ControllableAdaptor::AdaptorControlInterface::onUnreference().

bool base::Referenced::unreference  )  const [inline]
 

Decrement the reference count by one, indicating that a pointer to this object is referencing it. If the refence count goes to zero, it is assumed that this object is nolonger referenced and is automatically deleted.

Definition at line 81 of file Referenced.

References _refCount, Exception, onUnreference(), and onUnreferenceEnabled.


Member Data Documentation

int base::Referenced::_refCount [mutable, protected]
 

Definition at line 136 of file Referenced.

Referenced by reference(), referenceCount(), Referenced(), unreference(), and ~Referenced().

bool base::Referenced::onUnreferenceEnabled [protected]
 

Definition at line 137 of file Referenced.

Referenced by enableOnUnreferenceCall(), Referenced(), and unreference().


The documentation for this class was generated from the following file:
Generated on Thu Jul 29 16:39:05 2004 for OpenSim by doxygen 1.3.6