Rogue Wave banner
Previous fileTop of DocumentContentsIndexNext file

RWHandleBase


Base Class

Data Type and Member Function Indexes
(exclusive of constructors and destructors)

Member Functions

Package

Smart Pointer

Header File

#include <rw/pointer/RWHandleBase.h>

Description

Base class for handle classes. Each time an instance of this class is bound to an instance of the RWBodyBase class, it increments the reference count maintained by that body. Each time an instance of this class detaches from a body instance, it decrements the body's reference count, until the last handle detaches, reaching zero, whereupon it deletes the body instance. The reference counting relieves clients of the burden of keeping track of when it is safe to delete a body instance.

When a handle is copy-constructed, the new handle attaches to the same body as the original. When one handle is assigned to another handle, the handle on the left side detaches from its current body and attaches to the body pointed to by the handle on the right side.

Example

See HandleBodyEx1.cpp and HandleBodyEx2.cpp, located in the examples directory.

Protected Constructors

RWHandleBase(void);
RWHandleBase(RWBodyBase* body);
RWHandleBase(RWStaticCtor);
RWHandleBase(const RWHandleBase& second);

Protected Member Function

RWBodyBase&
body(void) const;

Protected Member Operator

RWHandleBase&
operator=(const RWHandleBase& second);

Public Member Function

RWBoolean
isValid(void) const;

Public Member Operators

RWBoolean
operator!=(const RWHandleBase& second) const;
RWBoolean
operator<(const RWHandleBase& second) const;
RWBoolean
operator==(const RWHandleBase& second) const;


Previous fileTop of DocumentContentsIndexNext file

©Copyright 2000, Rogue Wave Software, Inc.
Contact Rogue Wave about documentation or support issues.