HydraExpress™ C++ 2019 |
HydraExpress™ C++ API Reference Guide |
Product Documentation: HydraExpress C++ Documentation Home |
Base class for handle classes. More...
#include <rwsf/core/HandleBase.h>
Public Member Functions | |
bool | isValid (void) const |
bool | operator!= (const HandleBase &second) const |
bool | operator== (const HandleBase &second) const |
Protected Member Functions | |
HandleBase (void) | |
HandleBase (StaticCtor) | |
HandleBase (BodyBase *body) | |
HandleBase (const HandleBase &second) | |
virtual | ~HandleBase (void) |
BodyBase & | body (void) const |
HandleBase & | operator= (const HandleBase &second) |
rwsf::HandleBase is the base class for handle classes. Each time an instance of this class is bound to an instance of an rwsf::BodyBase 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. When this count reaches zero, it deletes the body instance.
rwsf::HandleBase implements the handle/body idiom in conjunction with rwsf::BodyBase. An instance of this class is a handle to a private, reference-counted body. 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.
|
protected |
Default constructor. Constructs an empty, invalid, handle instance.
|
protected |
Constructs a global static handle instance. (May be used prior to construction.)
|
protected |
Binds a new handle instance to the body instance.
|
protected |
Binds a new handle instance to the same body instance, if any, that is pointed to by the second handle instance.
|
protectedvirtual |
Virtual destructor.
|
protected |
Gets a reference for the body instance. If the body instance is not set for this handle or is not valid, this throws an rwsf::Exception exception.
bool rwsf::HandleBase::isValid | ( | void | ) | const |
Returns true
if this handle points to a valid body instance, otherwise returns false
.
bool rwsf::HandleBase::operator!= | ( | const HandleBase & | second | ) | const |
Returns true
if the handle points to different body instance, if any, than pointed to by the second handle, otherwise returns false
. Throws no exceptions.
|
protected |
Binds this handle instance to the same body instance, if any, that is pointed to by the second handle instance.
bool rwsf::HandleBase::operator== | ( | const HandleBase & | second | ) | const |
Returns true
if the handle points to the same body instance, if any, as pointed to by the second handle, otherwise returns false
. Two empty handles are equal. Throws no exceptions.
Copyright © 2019 Rogue Wave Software, Inc. All Rights Reserved. |