HydraExpress™ C++ API Reference Guide

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

Base class for classes that must maintain a thread-safe reference count. More...

#include <rwsf/core/RefCountingObject.h>

Public Member Functions

virtual ~RefCountingObject (void)
 
void addRef (void) const
 
virtual void releaseRef (void) const
 

Protected Member Functions

 RefCountingObject ()
 
 RefCountingObject (const RefCountingObject &second)
 
RefCountingObjectoperator= (const RefCountingObject &second)
 

Detailed Description

RefCountingObject is a base class for classes that must maintain a thread-safe reference count.

Constructor & Destructor Documentation

virtual rwsf::RefCountingObject::~RefCountingObject ( void  )
virtual

Destructor.

rwsf::RefCountingObject::RefCountingObject ( )
protected

Constructs a default instance (initializes the reference count to 0). Throws no exceptions.

rwsf::RefCountingObject::RefCountingObject ( const RefCountingObject second)
protected

Constructs a copy of second. The reference count is not copied, and is instead initialized to 0.

Member Function Documentation

void rwsf::RefCountingObject::addRef ( void  ) const

Increments the reference count. A call to releaseRef() should be made for each call to addRef(), otherwise a memory leak may occur. This method should only be used with objects allocated on the heap.

RefCountingObject& rwsf::RefCountingObject::operator= ( const RefCountingObject second)
protected

Defines an assignment operator so derived classes can do assignments. This method does not assign the reference count. The existing reference count on the class is used.

virtual void rwsf::RefCountingObject::releaseRef ( void  ) const
virtual

Decrements the reference count. If the reference count reaches 0, this object is deleted. This method should only be used with objects allocated on the heap. This method should not be called before calling addRef(), and should be called once for each call to addRef().

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.