|
Core Library
|
The smart-pointer type for use with types that contain their own reference counting mechanism, e.g. More...
#include <RefCntPtr.hpp>
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. | |
| RefCntPtr & | operator= (const RefCntPtr &oPtr) |
| Assignment operator. | |
| template<typename U > | |
| RefCntPtr & | operator= (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. | |
The smart-pointer type for use with types that contain their own reference counting mechanism, e.g.
| Core::RefCntPtr< T >::RefCntPtr | ( | ) |
Default constructor.
| Core::RefCntPtr< T >::RefCntPtr | ( | T * | pPointer, |
| bool | bAddRef = false |
||
| ) | [inline, explicit] |
Construction from an existing pointer.
| Core::RefCntPtr< T >::RefCntPtr | ( | const RefCntPtr< T > & | oPtr | ) | [inline] |
Copy constructor.
| 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..
| Core::RefCntPtr< T >::~RefCntPtr | ( | ) | [inline] |
Destructor.
| RefCntPtr< T > & Core::RefCntPtr< T >::operator= | ( | const RefCntPtr< T > & | oPtr | ) | [inline] |
Assignment operator.
| 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.
| void Core::RefCntPtr< T >::reset | ( | T * | pPointer = nullptr, |
| bool | bAddRef = false |
||
| ) | [inline] |
Change pointer ownership.
| T * Core::RefCntPtr< T >::detach | ( | ) | [inline] |
Take ownership of the pointer.
| 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.
Core::RefCntPtr< T >::RefCntPtr [friend] |
Allow member access for RefCntPtrs of sub-types.
Default constructor.
Allow attachment via an output parameter.
e.g. LoadTypeLib(..., attachTo(p)).
| RefCntPtr<P> static_ptr_cast | ( | const RefCntPtr< U > & | oPointer | ) | [friend] |
Allow member access for the static_cast like function.
| RefCntPtr<P> dynamic_ptr_cast | ( | const RefCntPtr< U > & | oPointer | ) | [friend] |
Allow member access for the dynamic_cast like function.
1.7.6.1