|
ug4
|
#include <smart_pointer.h>
Public Member Functions | |
| template<class T , template< class TPtr > class TFreePolicy> | |
| SmartPtr< T, TFreePolicy > | cast_reinterpret () const |
| Returns a SmartPtr with the specified type and shared reference counting. | |
| void * | get () |
| const void * | get () const |
| bool | invalid () const |
| returns true if the pointer is invalid, false if not. | |
| void | invalidate () |
| operator bool () const noexcept | |
| template<class T > | |
| SmartPtr< void > & | operator= (const SmartPtr< T > &sp) |
| SmartPtr< void > & | operator= (const SmartPtr< void > &sp) |
| template<class T > | |
| SmartPtr< void > & | operator= (NullSmartPtr) |
| int | refcount () const |
| template<class T , template< class TPtr > class TFreePolicy> | |
| void | set_impl (void *ptr) |
| sets the void* to a different location correspoding to a cast to a new type T | |
| SmartPtr () | |
| template<class T > | |
| SmartPtr (const SmartPtr< T > &sp) | |
| SmartPtr (const SmartPtr< void > &sp) | |
| SmartPtr (NullSmartPtr) | |
| SmartPtr (void *ptr, void(*freeFunc)(const void *)) | |
| bool | valid () const |
| returns true if the pointer is valid, false if not. | |
| ~SmartPtr () | |
Private Member Functions | |
| void | release () |
Private Attributes | |
| void(* | m_freeFunc )(const void *) |
| void * | m_ptr |
| int * | m_refCountPtr |
Friends | |
| class | ConstSmartPtr< void > |
The SmartPtr<void> is a specialization of the SmartPtr class. It can only be constructed from an existing SmartPtr or from an existing SmartPtr<void>. This is crucial to guarantee save release methods.
In contrary to the original SmartPtr class, the void specialization does not feature the -> and * operators. One also can't directly access the encapsulated pointer.
If you need a const smart pointer use ConstSmartPtr<void>.
|
inlineexplicit |
|
inline |
|
inline |
|
inlineexplicit |
|
inline |
References SmartPtr< T, FreePolicy >::release().
|
inline |
Returns a SmartPtr with the specified type and shared reference counting.
USE WITH CARE! ONLY COMPATIBLE TYPES SHOULD BE USED
References SmartPtr< T, FreePolicy >::m_ptr.
|
inline |
References SmartPtr< T, FreePolicy >::m_ptr.
Referenced by ug::bridge::lua::LuaParsing< void * >::checkAndGet(), and ug::vrl::jObject2PtrVector().
|
inline |
References SmartPtr< T, FreePolicy >::m_ptr.
|
inline |
returns true if the pointer is invalid, false if not.
References SmartPtr< T, FreePolicy >::m_ptr.
|
inline |
|
inlineexplicitnoexcept |
References SmartPtr< T, FreePolicy >::m_ptr.
References SmartPtr< T, FreePolicy >::m_ptr, and SmartPtr< T, FreePolicy >::release().
|
inline |
References SmartPtr< T, FreePolicy >::m_ptr, and SmartPtr< T, FreePolicy >::release().
|
inline |
|
inlineprivate |
References SmartPtr< T, FreePolicy >::m_ptr.
|
inline |
sets the void* to a different location correspoding to a cast to a new type T
!!! WARNING: THIS METHOD IS DANDGEROUS: DO NOT USE IT UNLESS YOU REALLY KNOW WHAT YOU ARE DOING !!!
References SmartPtr< T, FreePolicy >::m_ptr.
|
inline |
returns true if the pointer is valid, false if not.
References SmartPtr< T, FreePolicy >::m_ptr.
|
friend |
|
private |
|
private |
|
private |