HydraExpress™ C++ API Reference Guide

Product Documentation:
   HydraExpress C++
Documentation Home
List of all members | Public Member Functions | Protected Member Functions
rwsf::HandleBase Class Reference

Base class for handle classes. More...

#include <rwsf/core/HandleBase.h>

Inheritance diagram for rwsf::HandleBase:
rwsf::Enumeration< rwsf::rwsf::Filter * > rwsf::AsyncHandle rwsf::Attribute rwsf::Config rwsf::Connector rwsf::Enumeration< T > rwsf::HttpSession rwsf::LogFormatter rwsf::Logger rwsf::Member rwsf::MessageHandler rwsf::MessageInfo rwsf::MessageInfoHandlerChain rwsf::MimeHeaders rwsf::NamedObject rwsf::RequestDispatcher rwsf::ServletContext rwsf::XmlBindingHandleBase rwsf::XmlReader

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
 
HandleBaseoperator= (const HandleBase &second)
 

Detailed Description

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.

Constructor & Destructor Documentation

rwsf::HandleBase::HandleBase ( void  )
protected

Default constructor. Constructs an empty, invalid, handle instance.

rwsf::HandleBase::HandleBase ( StaticCtor  )
protected

Constructs a global static handle instance. (May be used prior to construction.)

rwsf::HandleBase::HandleBase ( BodyBase *  body)
protected

Binds a new handle instance to the body instance.

rwsf::HandleBase::HandleBase ( const HandleBase second)
protected

Binds a new handle instance to the same body instance, if any, that is pointed to by the second handle instance.

virtual rwsf::HandleBase::~HandleBase ( void  )
protectedvirtual

Virtual destructor.

Member Function Documentation

BodyBase& rwsf::HandleBase::body ( void  ) const
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.

HandleBase& rwsf::HandleBase::operator= ( const HandleBase second)
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 © 2020 Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave is registered trademark of Rogue Wave Software, Inc. in the United States and other countries, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.
Provide feedback to Rogue Wave about its documentation.