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

Template class for smart pointers-to-T objects (requires modification to T). More...

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

Public Member Functions

 RefCountedObjectPtr (const RefCountedObjectPtr &rhs)
 
 RefCountedObjectPtr (T *realPtr=0)
 
 ~RefCountedObjectPtr ()
 
T & operator* () const
 
T * operator-> () const
 
RefCountedObjectPtroperator= (const RefCountedObjectPtr &rhs)
 

Detailed Description

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

T must support the RefCountedObject interface, hence RefCcountedObjectPtr only works for objects that have been modified for use with reference counting.

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

Constructor & Destructor Documentation

◆ RefCountedObjectPtr() [1/2]

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

◆ RefCountedObjectPtr() [2/2]

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

◆ ~RefCountedObjectPtr()

~RefCountedObjectPtr ( )
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=()

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