Workspace 6.21.5
Public Member Functions | List of all members
RefCountedPtr< T > Class Template Reference

Template class for reference-counted pointers-to-T (T requires no special modification). More...

#include <Workspace/Application/LanguageUtils/refcount.h>

Inheritance diagram for RefCountedPtr< T >:
[legend]

Public Member Functions

 RefCountedPtr (const RefCountedPtr &rhs)
 
 RefCountedPtr (T *realPtr=0)
 
 ~RefCountedPtr ()
 
T & operator* () const
 
T * operator-> () const
 
RefCountedPtroperator= (const RefCountedPtr &rhs)
 

Detailed Description

template<class T>
class CSIRO::Application::RefCountedPtr< T >

This class differs from RefCountedObjectPtr in that it does not require that T is derived from RefCountedObject. Instead, RefCountedPtr uses its own proxy class to take care of this.

Based on Item 29 in "More Effective C++", Scott Meyers.

Constructor & Destructor Documentation

◆ RefCountedPtr() [1/2]

RefCountedPtr ( T *  realPtr = 0)
inline
Parameters
realPtrThe object to assign to this reference counted pointer.

◆ RefCountedPtr() [2/2]

RefCountedPtr ( const RefCountedPtr< T > &  rhs)
inline
Parameters
rhsThe object to hold a reference count for.

◆ ~RefCountedPtr()

~RefCountedPtr ( )
inline

Member Function Documentation

◆ operator*()

T & operator* ( ) const
inline
Returns
A reference to the underlying object.

◆ operator->()

T * operator-> ( ) const
inline
Returns
A pointer to the underlying object.

◆ operator=()

RefCountedPtr & operator= ( const RefCountedPtr< T > &  rhs)
inline
Parameters
rhsThe object to assign to this one. The reference count for the previously held object is decremented.