SourcePro® API Reference Guide

 
Loading...
Searching...
No Matches
RWBodyBase Class Reference

Base class for body classes. More...

#include <rw/pointer/RWBodyBase.h>

Inheritance diagram for RWBodyBase:
RWTCountingBody< RWMutexLock > RWTMonitor< RWMutexLock > RWEscrowImpBase RWStreamImp RWTEscrowImp< Redeemable > RWInputStreamImp RWOutputStreamImp RWTThreadEscrowImp< Redeemable > RWByteInputStreamImp RWCharInputStreamImp RWDataInputStreamImp RWUCharInputStreamImp RWWCharInputStreamImp RWByteOutputStreamImp RWCharOutputStreamImp RWDataOutputStreamImp RWUCharOutputStreamImp RWWCharOutputStreamImp

Protected Member Functions

 RWBodyBase (const RWBodyBase &second)
 
 RWBodyBase (RWStaticCtor)
 
 RWBodyBase (void)
 
virtual ~RWBodyBase (void)
 
RWBodyBaseoperator= (const RWBodyBase &second)
 
- Protected Member Functions inherited from RWTCountingBody< RWMutexLock >
 RWTCountingBody (const RWTCountingBody< RWMutexLock > &second)
 
 RWTCountingBody (RWStaticCtor)
 
 RWTCountingBody (unsigned initCount=0)
 
RWTCountingBody< RWMutexLock > & operator= (const RWTCountingBody< RWMutexLock > &second)
 
 ~RWTCountingBody (void)
 
unsigned addReference (void)
 
unsigned references (void) const
 
unsigned removeReference (void)
 
- Protected Member Functions inherited from RWTMonitor< RWMutexLock >
 RWTMonitor (const RWTMonitor< RWMutexLock > &second)
 
 RWTMonitor (RWStaticCtor)
 
 RWTMonitor (void)
 
 ~RWTMonitor (void)
 
void acquire (void)
 
bool isAcquired (void) const
 
RWTMonitor< RWMutexLock > & monitor (void) const
 
RWMutexLockmutex (void)
 
RWTMonitor< RWMutexLock > & operator= (const RWTMonitor< RWMutexLock > &)
 
void release (void)
 
bool tryAcquire (void)
 

Friends

class RWTCountedPointer< RWBodyBase >
 

Additional Inherited Members

- Protected Types inherited from RWTCountingBody< RWMutexLock >
typedef RWTLockGuard< RWTMonitor< RWMutexLock > > LockGuard
 
typedef RWTTryLockGuard< RWTMonitor< RWMutexLock > > TryLockGuard
 
typedef RWTUnlockGuard< RWTMonitor< RWMutexLock > > UnlockGuard
 
- Protected Types inherited from RWTMonitor< RWMutexLock >
typedef RWTLockGuard< RWTMonitor< RWMutexLock > > LockGuard
 
typedef RWTTryLockGuard< RWTMonitor< RWMutexLock > > TryLockGuard
 
typedef RWTUnlockGuard< RWTMonitor< RWMutexLock > > UnlockGuard
 

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.

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

Constructor & Destructor Documentation

◆ RWBodyBase() [1/3]

RWBodyBase::RWBodyBase ( void )
inlineprotected

Default constructor. Constructs a default body instance where the reference count starts at zero.

◆ RWBodyBase() [2/3]

RWBodyBase::RWBodyBase ( RWStaticCtor )
inlineprotected

Constructs a static body instance where the reference count starts at one, to prevent deletion by handles.

◆ RWBodyBase() [3/3]

RWBodyBase::RWBodyBase ( const RWBodyBase & second)
inlineprotected

Copy constructor.

◆ ~RWBodyBase()

virtual RWBodyBase::~RWBodyBase ( void )
protectedvirtual

Destructor. Throws no exceptions.

Member Function Documentation

◆ operator=()

RWBodyBase & RWBodyBase::operator= ( const RWBodyBase & second)
inlineprotected

Assignment operator. Throws no exceptions.

Copyright © 2024 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved.