Core Library
Public Member Functions | Private Member Functions | Friends
Core::RefCntPtr< T > Class Template Reference

The smart-pointer type for use with types that contain their own reference counting mechanism, e.g. More...

#include <RefCntPtr.hpp>

Inheritance diagram for Core::RefCntPtr< T >:
Core::SmartPtr< T >

List of all members.

Public Member Functions

 RefCntPtr ()
 Default constructor.
 RefCntPtr (T *pPointer, bool bAddRef=false)
 Construction from an existing pointer.
 RefCntPtr (const RefCntPtr &oPtr)
 Copy constructor.
template<typename U >
 RefCntPtr (const RefCntPtr< U > &oPtr)
 Copy constructor for sub-types of T.
 ~RefCntPtr ()
 Destructor.
RefCntPtroperator= (const RefCntPtr &oPtr)
 Assignment operator.
template<typename U >
RefCntPtroperator= (const RefCntPtr< U > &oPtr)
 Assignment operator for sub-types of T.
void reset (T *pPointer=nullptr, bool bAddRef=false)
 Change pointer ownership.
T * detach ()
 Take ownership of the pointer.

Private Member Functions

T ** getPtrMember ()
 Access the underlying pointer member.

Friends

class RefCntPtr
 Allow member access for RefCntPtrs of sub-types.
T ** attachTo (RefCntPtr< T > &ptr)
 Allow attachment via an output parameter.
template<typename P , typename U >
RefCntPtr< P > static_ptr_cast (const RefCntPtr< U > &oPointer)
 Allow member access for the static_cast like function.
template<typename P , typename U >
RefCntPtr< P > dynamic_ptr_cast (const RefCntPtr< U > &oPointer)
 Allow member access for the dynamic_cast like function.

Detailed Description

template<typename T>
class Core::RefCntPtr< T >

The smart-pointer type for use with types that contain their own reference counting mechanism, e.g.

Core::RefCounted.


Constructor & Destructor Documentation

template<typename T >
Core::RefCntPtr< T >::RefCntPtr ( )

Default constructor.

template<typename T >
Core::RefCntPtr< T >::RefCntPtr ( T *  pPointer,
bool  bAddRef = false 
) [inline, explicit]

Construction from an existing pointer.

template<typename T >
Core::RefCntPtr< T >::RefCntPtr ( const RefCntPtr< T > &  oPtr) [inline]

Copy constructor.

template<typename T >
template<typename U >
Core::RefCntPtr< T >::RefCntPtr ( const RefCntPtr< U > &  oPtr) [inline]

Copy constructor for sub-types of T.

Takes shared ownership of another pointer that must be a sub-type of T..

template<typename T >
Core::RefCntPtr< T >::~RefCntPtr ( ) [inline]

Destructor.


Member Function Documentation

template<typename T >
RefCntPtr< T > & Core::RefCntPtr< T >::operator= ( const RefCntPtr< T > &  oPtr) [inline]

Assignment operator.

template<typename T >
template<typename U >
RefCntPtr< T > & Core::RefCntPtr< T >::operator= ( const RefCntPtr< U > &  oPtr) [inline]

Assignment operator for sub-types of T.

Releases teh current resource and takes shared ownership of another pointer that must be a sub-type of T.

template<typename T >
void Core::RefCntPtr< T >::reset ( T *  pPointer = nullptr,
bool  bAddRef = false 
) [inline]

Change pointer ownership.

template<typename T >
T * Core::RefCntPtr< T >::detach ( ) [inline]

Take ownership of the pointer.

template<typename T >
T ** Core::RefCntPtr< T >::getPtrMember ( ) [inline, private]

Access the underlying pointer member.

This is used by the attachTo() friend function to access the underlying SmartPtr<T> member variable.


Friends And Related Function Documentation

template<typename T >
Core::RefCntPtr< T >::RefCntPtr [friend]

Allow member access for RefCntPtrs of sub-types.

Default constructor.

template<typename T >
T** attachTo ( RefCntPtr< T > &  ptr) [friend]

Allow attachment via an output parameter.

e.g. LoadTypeLib(..., attachTo(p)).

template<typename T >
template<typename P , typename U >
RefCntPtr<P> static_ptr_cast ( const RefCntPtr< U > &  oPointer) [friend]

Allow member access for the static_cast like function.

template<typename T >
template<typename P , typename U >
RefCntPtr<P> dynamic_ptr_cast ( const RefCntPtr< U > &  oPointer) [friend]

Allow member access for the dynamic_cast like function.


The documentation for this class was generated from the following file: