rwlogo
SourcePro C++ 12.0

SourcePro® C++ API Reference Guide



   SourcePro C++
Documentation Home

RWBodyBase Class Reference
[Smart Pointers]

Base class for body classes. More...

#include <rw/pointer/RWBodyBase.h>

Inheritance diagram for RWBodyBase:
RWTCountingBody< RWMutexLock > RWTMonitor< RWMutexLock > RWEscrowImpBase RWFunctor0Imp RWStreamImp RWTFunctor1Imp< S1 > RWTFunctor1Imp< Key > RWTFunctor2Imp< S1, S2 > RWTFunctor2Imp< Base *, RWObjectInputStream & > RWTFunctor2Imp< const Base *, RWObjectOutputStream & > RWTFunctor2Imp< Key, S1 > RWTFunctorR0Imp< SR > RWTFunctorR0Imp< Base > RWTFunctorR1Imp< SR, S1 > RWTFunctorR1Imp< SR, Key > RWTFunctorR1Imp< void *, RWSymbol > RWTFunctorR2Imp< SR, S1, S2 > RWTFunctorR2Imp< SR, Key, S1 >

List of all members.

Protected Member Functions

 RWBodyBase (void)
 RWBodyBase (RWStaticCtor)
 RWBodyBase (const RWBodyBase &second)
virtual ~RWBodyBase (void)
RWBodyBaseoperator= (const RWBodyBase &second)
unsigned addReference (void)
unsigned removeReference (void)
unsigned references (void) const

Detailed 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.

Examples

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


Constructor & Destructor Documentation

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.


Member Function Documentation

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 >.

 All Classes Functions Variables Typedefs Enumerations Enumerator Friends

© 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.