SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Base class for body classes. More...
#include <rw/pointer/RWBodyBase.h>
Protected Member Functions | |
RWBodyBase (void) | |
RWBodyBase (RWStaticCtor) | |
RWBodyBase (const RWBodyBase &second) | |
virtual | ~RWBodyBase (void) |
RWBodyBase & | operator= (const RWBodyBase &second) |
unsigned | addReference (void) |
unsigned | removeReference (void) |
unsigned | references (void) const |
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.
See HandlebodyEx1.cpp
and HandlebodyEx2.cpp
, located in the examples
directory.
RWBodyBase::RWBodyBase | ( | void | ) | [inline, protected] |
Default constructor. Constructs a default body instance where the reference count starts at zero.
RWBodyBase::RWBodyBase | ( | RWStaticCtor | ) | [inline, protected] |
Constructs a static body instance where the reference count starts at one, to prevent deletion by handles.
RWBodyBase::RWBodyBase | ( | const RWBodyBase & | second | ) | [inline, protected] |
Copy constructor.
virtual RWBodyBase::~RWBodyBase | ( | void | ) | [protected, virtual] |
Destructor. Throws no exceptions.
unsigned RWBodyBase::addReference | ( | void | ) | [inline, protected] |
Increments the reference count and then returns the previous value minus one.
Reimplemented from RWTCountingBody< RWMutexLock >.
RWBodyBase & RWBodyBase::operator= | ( | const RWBodyBase & | second | ) | [inline, protected] |
Assignment operator. Throws no exceptions.
unsigned RWBodyBase::references | ( | void | ) | const [inline, protected] |
Queries the current reference count. Throws no exceptions.
Reimplemented from RWTCountingBody< RWMutexLock >.
unsigned RWBodyBase::removeReference | ( | void | ) | [inline, protected] |
Decrements the reference count and then returns the previous value minus one.
Reimplemented from RWTCountingBody< RWMutexLock >.
© 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.