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

RWHandleBase

Module:  Threads   Package:  Smart Pointer


Base Class

Local Index

Members

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.

Public Member Function

bool
isValid() const;

Public Member Operators

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

Protected Constructors

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

Protected Destructor

~RWHandleBase();

Protected Member Function

RWBodyBase&
body() const;

Protected Member Operator

RWHandleBase&
operator=(const RWHandleBase& 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.