SourcePro® 2023.1 |
SourcePro® API Reference Guide |
Base class for all handle classes. Increments a reference count for each class instance that is bound to an instance of the RWBodyBase class. More...
#include <rw/pointer/RWHandleBase.h>
Public Member Functions | |
bool | isValid (void) const |
bool | operator!= (const RWHandleBase &second) const |
bool | operator< (const RWHandleBase &second) const |
bool | operator== (const RWHandleBase &second) const |
Protected Member Functions | |
RWHandleBase (void) | |
RWHandleBase (RWStaticCtor) | |
RWHandleBase (RWBodyBase *body) | |
RWHandleBase (const RWHandleBase &second) | |
~RWHandleBase (void) | |
RWBodyBase & | body (void) const |
RWHandleBase & | operator= (const RWHandleBase &second) |
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.
HandleBodyEx1.cpp
and HandleBodyEx2.cpp
, located in the examples
directory.
|
inlineprotected |
Default constructor. Constructs an empty, invalid, handle instance. Throws no exceptions.
|
inlineprotected |
Constructs a global static handle instance (may be used prior to construction). Throws no exceptions.
|
inlineprotected |
Binds a new handle instance to a body instance.
|
inlineprotected |
Binds a new handle instance to the same body instance, if any, that is pointed to by a second handle instance second.
|
inlineprotected |
Destructor.
|
inlineprotected |
Gets a reference for the body instance, if any.
RWTHRInvalidPointer | Thrown if this handle is not attached to a body. |
|
inline |
Returns true
if this handle points to a valid body instance, and false
otherwise. Throws no exceptions.
|
inline |
Returns true
if the handle points to different body instance, if any, than pointed to by a second handle second, and otherwise returns false
. Throws no exceptions.
|
inline |
Required for collections based on C++ Standard Library collections. (Redefine this operator in derived classes, as necessary.) Throws no exceptions.
|
inlineprotected |
Binds this handle instance to the same body instance, if any, that is pointed to by a second handle instance second.
|
inline |
Returns true
if the handle points to the same body instance, if any, as pointed to by a second handle second, and otherwise returns false
. Two empty handles are equal. Throws no exceptions.
Copyright © 2023 Rogue Wave Software, Inc., a Perforce company. All Rights Reserved. |