ug4
|
#include <smart_pointer.h>
Public Member Functions | |
SmartPtr< T, FreePolicy > | cast_const () const |
performs a const cast More... | |
template<class TDest > | |
ConstSmartPtr< TDest, FreePolicy > | cast_dynamic () const |
preforms a dynamic cast More... | |
template<class TDest > | |
ConstSmartPtr< TDest, FreePolicy > | cast_reinterpret () const |
performs a static cast More... | |
template<class TDest > | |
ConstSmartPtr< TDest, FreePolicy > | cast_static () const |
performs a static cast More... | |
ConstSmartPtr () | |
ConstSmartPtr (const ConstSmartPtr &sp) | |
template<class TPtr > | |
ConstSmartPtr (const ConstSmartPtr< TPtr, FreePolicy > &sp) | |
template<class TPtr > | |
ConstSmartPtr (const SmartPtr< TPtr, FreePolicy > &sp) | |
ConstSmartPtr (const T *ptr) | |
ConstSmartPtr (const T *ptr, int *refCount) | |
WARNING: this method is DANGEROUS! More... | |
ConstSmartPtr (NullSmartPtr) | |
const T * | get () const |
bool | invalid () const |
returns true if the pointer is invalid, false if not. More... | |
template<class TDest > | |
bool | is_of_type () const |
operator bool () const noexcept | |
bool | operator!= (const ConstSmartPtr &sp) const |
template<class TPtr > | |
bool | operator!= (const SmartPtr< TPtr, FreePolicy > &sp) const |
bool | operator!= (NullSmartPtr) const |
const T & | operator* () const |
const T * | operator-> () const |
ConstSmartPtr & | operator= (const ConstSmartPtr &sp) |
template<class TIn > | |
ConstSmartPtr< T, FreePolicy > & | operator= (const ConstSmartPtr< TIn, FreePolicy > &sp) |
ConstSmartPtr & | operator= (const SmartPtr< T, FreePolicy > &sp) |
template<class TIn > | |
ConstSmartPtr< T, FreePolicy > & | operator= (const SmartPtr< TIn, FreePolicy > &sp) |
ConstSmartPtr & | operator= (NullSmartPtr) |
bool | operator== (const ConstSmartPtr &sp) const |
template<class TPtr > | |
bool | operator== (const SmartPtr< TPtr, FreePolicy > &sp) const |
bool | operator== (NullSmartPtr) const |
int | refcount () const |
int * | refcount_ptr () const |
WARNING: this method is dangerous! More... | |
bool | valid () const |
returns true if the pointer is valid, false if not. More... | |
~ConstSmartPtr () | |
Private Member Functions | |
void | release () |
decrements the refCount and frees the encapsulated pointer if required. More... | |
Static Private Member Functions | |
static void | free_void_ptr (void *ptr) |
Private Attributes | |
const T * | m_ptr |
int * | m_refCount |
Friends | |
class | ConstSmartPtr< void > |
|
inlineexplicit |
|
inlineexplicit |
References ConstSmartPtr< T, FreePolicy >::m_refCount.
|
inline |
|
inline |
References ConstSmartPtr< T, FreePolicy >::m_refCount.
|
inline |
this template method allows to assign smart-pointers that encapsulate derivates of T. Make sure that the pointer-type of TSmartPtr is castable to T*.
References ConstSmartPtr< T, FreePolicy >::m_refCount.
|
inline |
References ConstSmartPtr< T, FreePolicy >::m_refCount.
|
inline |
References ConstSmartPtr< T, FreePolicy >::release().
|
inlineexplicit |
WARNING: this method is DANGEROUS!
You should only use this constructor if you really know what you're doing! The following methods are required for SmartPtr<void> and casts
References ConstSmartPtr< T, FreePolicy >::m_refCount.
|
inline |
performs a const cast
References ConstSmartPtr< T, FreePolicy >::m_ptr, and ConstSmartPtr< T, FreePolicy >::m_refCount.
|
inline |
preforms a dynamic cast
References ConstSmartPtr< T, FreePolicy >::m_ptr, ConstSmartPtr< T, FreePolicy >::m_refCount, and p.
|
inline |
performs a static cast
References ConstSmartPtr< T, FreePolicy >::m_ptr, ConstSmartPtr< T, FreePolicy >::m_refCount, and p.
|
inline |
performs a static cast
References ConstSmartPtr< T, FreePolicy >::m_ptr, ConstSmartPtr< T, FreePolicy >::m_refCount, and p.
|
inlinestaticprivate |
|
inline |
References ConstSmartPtr< T, FreePolicy >::m_ptr.
Referenced by ug::DomainDiscretizationBase< TDomain, TAlgebra, TGlobAssembler >::calc_error(), ug::CheckDoFElem(), ug::collectStretchedElementIndices(), ug::ExtractPositionsElem(), ug::MarkElementsAbsolute(), ConstSmartPtr< T, FreePolicy >::operator=(), ConstSmartPtr< T, FreePolicy >::operator==(), and SmartPtr< T, FreePolicy >::operator==().
|
inline |
returns true if the pointer is invalid, false if not.
References ConstSmartPtr< T, FreePolicy >::m_ptr.
Referenced by ug::LocalFiniteElementProvider::create_sub_dof_set(), ug::CreateUnionOfFunctionGroups(), ug::DependentUserData< TData, dim >::extract_fct_grp(), and ug::VertexCenteredVankaSubspace< TDomain, TAlgebra >::extract_ids().
|
inline |
References ConstSmartPtr< T, FreePolicy >::m_ptr.
|
inlineexplicitnoexcept |
References ConstSmartPtr< T, FreePolicy >::m_ptr.
|
inline |
References ConstSmartPtr< T, FreePolicy >::operator==().
|
inline |
References ConstSmartPtr< T, FreePolicy >::operator==().
|
inline |
References ConstSmartPtr< T, FreePolicy >::m_ptr.
|
inline |
References ConstSmartPtr< T, FreePolicy >::m_ptr.
|
inline |
References ConstSmartPtr< T, FreePolicy >::m_ptr.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
References ConstSmartPtr< T, FreePolicy >::get().
Referenced by ConstSmartPtr< T, FreePolicy >::operator!=().
|
inline |
References SmartPtr< T, FreePolicy >::get(), and ConstSmartPtr< T, FreePolicy >::get().
|
inline |
References ConstSmartPtr< T, FreePolicy >::m_ptr.
|
inline |
References ConstSmartPtr< T, FreePolicy >::m_refCount.
Referenced by ug::vrl::ConstSmartTestFunction().
|
inline |
WARNING: this method is dangerous!
This method should never be used since it may be removed in future versions of the SmartPtr class. It is featured in order to allow to implement a template-constructor that casts element-pointers of a smart pointer.
References ConstSmartPtr< T, FreePolicy >::m_refCount.
Referenced by ConstSmartPtr< T, FreePolicy >::operator=().
|
inlineprivate |
decrements the refCount and frees the encapsulated pointer if required.
References ConstSmartPtr< T, FreePolicy >::m_ptr, and ConstSmartPtr< T, FreePolicy >::m_refCount.
Referenced by ConstSmartPtr< void >::invalidate(), ConstSmartPtr< T, FreePolicy >::operator=(), ConstSmartPtr< void >::operator=(), ConstSmartPtr< T, FreePolicy >::~ConstSmartPtr(), and ConstSmartPtr< void >::~ConstSmartPtr().
|
inline |
returns true if the pointer is valid, false if not.
References ConstSmartPtr< T, FreePolicy >::m_ptr.
Referenced by ug::IProjGaussSeidel< TDomain, TAlgebra >::apply(), ug::LoadBalancer::create_quality_record(), ug::LocalFiniteElementProvider::create_sub_dof_set(), ug::L2DistIntegrand< TGridFunction >::evaluate(), ug::H1SemiDistIntegrand< TGridFunction >::evaluate(), ug::H1EnergyDistIntegrand< TGridFunction >::evaluate(), ug::L2Integrand< TGridFunction >::evaluate(), ug::H1SemiIntegrand< TGridFunction >::evaluate(), ug::H1EnergyIntegrand< TGridFunction >::evaluate(), ug::LocalFiniteElementProvider::get(), ug::LocalFiniteElementProvider::get_dofs(), and ConstSmartPtr< void >::invalidate().
|
friend |
|
private |
Referenced by ConstSmartPtr< T, FreePolicy >::cast_const(), ConstSmartPtr< T, FreePolicy >::cast_dynamic(), ConstSmartPtr< T, FreePolicy >::cast_reinterpret(), ConstSmartPtr< void >::cast_reinterpret(), ConstSmartPtr< T, FreePolicy >::cast_static(), ConstSmartPtr< T, FreePolicy >::get(), ConstSmartPtr< void >::get(), ConstSmartPtr< T, FreePolicy >::invalid(), ConstSmartPtr< void >::invalid(), ConstSmartPtr< void >::invalidate(), ConstSmartPtr< T, FreePolicy >::is_of_type(), ConstSmartPtr< T, FreePolicy >::operator bool(), ConstSmartPtr< void >::operator bool(), ConstSmartPtr< T, FreePolicy >::operator!=(), ConstSmartPtr< T, FreePolicy >::operator*(), ConstSmartPtr< T, FreePolicy >::operator->(), ConstSmartPtr< T, FreePolicy >::operator=(), ConstSmartPtr< void >::operator=(), ConstSmartPtr< T, FreePolicy >::operator==(), ConstSmartPtr< T, FreePolicy >::release(), ConstSmartPtr< void >::release(), ConstSmartPtr< void >::set_impl(), ConstSmartPtr< T, FreePolicy >::valid(), and ConstSmartPtr< void >::valid().
|
private |
Referenced by ConstSmartPtr< T, FreePolicy >::cast_const(), ConstSmartPtr< T, FreePolicy >::cast_dynamic(), ConstSmartPtr< T, FreePolicy >::cast_reinterpret(), ConstSmartPtr< T, FreePolicy >::cast_static(), ConstSmartPtr< T, FreePolicy >::ConstSmartPtr(), ConstSmartPtr< void >::operator=(), ConstSmartPtr< T, FreePolicy >::operator=(), ConstSmartPtr< T, FreePolicy >::refcount(), ConstSmartPtr< T, FreePolicy >::refcount_ptr(), and ConstSmartPtr< T, FreePolicy >::release().