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. More... | |
void * | get () |
const void * | get () const |
bool | invalid () const |
returns true if the pointer is invalid, false if not. More... | |
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 More... | |
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. More... | |
~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>.
|
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.
Referenced by ug::bridge::ParameterStack::_to_native_vector(), ug::bridge::ParameterStack::_to_pointer_vector(), and ug::bridge::ParameterStack::_to_void_pointer_vector().
|
inline |
References SmartPtr< T, FreePolicy >::m_ptr.
Referenced by ug::bridge::lua::LuaParsing< void * >::checkAndGet(), ug::vrl::jObject2PtrVector(), and ug::vrl::smartPointer2JObject().
|
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 m_freeFunc, SmartPtr< T, FreePolicy >::m_ptr, m_ptr, m_refCountPtr, 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 |
Referenced by operator=(), and ConstSmartPtr< void >::operator=().
|
private |
Referenced by operator=(), and ConstSmartPtr< void >::operator=().
|
private |
Referenced by operator=(), and ConstSmartPtr< void >::operator=().