Rogue Wave banner
Previous fileTop of DocumentContentsIndex pageNext file
Threads Module Reference Guide
Rogue Wave web site:  Home Page  |  Main Documentation Page

RWBodyBase

Module:  Threads   Package:  Smart Pointer


RWBodyBase RWTCountingBody<RWMutexLock>

Local Index

Members

Header File

#include <rw/pointer/RWBodyBase.h>

Description

Base class for body classes. Each time an RWHandleBase instance is bound to an instance of this class, the handle instance increments the reference count inherited by the body instance. Each time a handle instance detaches from an instance of this class, the handle decrements the reference count. If the reference count reaches zero, the handle deletes the body instance. The reference counting relieves clients of the burden of having to keep track of when it is safe to delete a body instance.

If the Threads Module is built with the "Handle/Body uses Atomic Count" flag, this class will no longer derive from RWTCountingBody<RWMutexLock>, and will instead use an internal atomic variable for its count. This provides a significant performance boost at the cost of backwards-compatibility due to the inheritance change.

Example

See HandlebodyEx1.cpp and HandlebodyEx2.cpp, located in the Examples directory.

Protected Constructors

RWBodyBase();
RWBodyBase(RWStaticCtor);
RWBodyBase(const RWBodyBase& second);

Protected Destructor

virtual
~RWBodyBase();

Protected Member Operator

RWBodyBase&
operator=(const RWBodyBase& second);


Previous fileTop of DocumentContentsIndex pageNext file

© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.