rwlogo
HydraExpress 4.6

HydraExpress C++ API Reference Guide


   


Rogue Wave web site:  Home Page  |  Main Documentation Page

rwsf::HandleBase Class Reference
[Core Design Patterns]

Base class for handle classes. More...

#include <rwsf/core/HandleBase.h>

Inheritance diagram for rwsf::HandleBase:
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

List of all members.

Public Member Functions

bool operator== (const HandleBase &second) const
bool operator!= (const HandleBase &second) const
bool isValid (void) const

Protected Member Functions

 HandleBase (void)
 HandleBase (StaticCtor)
 HandleBase (BodyBase *body)
 HandleBase (const HandleBase &second)
virtual ~HandleBase (void)
HandleBaseoperator= (const HandleBase &second)
BodyBase & body (void) const

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   )  [protected, virtual]

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.

Reimplemented in rwsf::MessageInfo, rwsf::MessageListener, and rwsf::Transport.

bool rwsf::HandleBase::isValid ( void   )  const

Returns true if this handle points to a valid body instance, otherwise returns false.

Reimplemented in rwsf::HttpSession.

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 © Rogue Wave Software, Inc. All Rights Reserved.

The Rogue Wave name and logo are registered trademarks of Rogue Wave Software, and HydraExpress is a trademark of Rogue Wave Software. All other trademarks are the property of their respective owners.