7 #ifndef _ADTF_UCOM_ANT_WEAK_OBJECT_PTR_IMPLEMENTATION_HEADER_
8 #define _ADTF_UCOM_ANT_WEAK_OBJECT_PTR_IMPLEMENTATION_HEADER_
25 template <
typename T >
29 template<
typename>
friend class detail::delegate_object_ptr;
31 typedef typename detail::object_reference_counter::size_type size_type;
43 template <
typename U >
44 weak_object_ptr(U* i_pObject, detail::iobject_ptr_ref<size_type>* i_pRefer) :
45 m_pObject(ucom_cast<T*>(i_pObject)),
192 swap(o_oOther.m_pRefer, m_pRefer);
193 swap(o_oOther.m_pObject, m_pObject);
211 void IncreaseWeakCount()
213 if (
nullptr != m_pRefer)
215 m_pRefer->IncreaseWeakCount();
219 void DecreaseWeakCount()
221 if (
nullptr != m_pRefer)
223 m_pRefer->DecreaseWeakCount();
231 detail::iobject_ptr_ref<size_type>* m_pRefer;
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
A common result class usable as return value throughout.
virtual detail::iobject_ptr_ref< size_t > * GetObjPtrRef() const =0
Get the reference counter.
virtual T * Get() const =0
Get raw pointer to shared object.
Base object pointer to realize binary compatible reference counting in interface methods.
Object pointer implementation used for reference counting on objects of type IObject.
Implementation of a weak pointer for usage with iobject_ptr and object_ptr.
weak_object_ptr & operator=(weak_object_ptr oOther)
Assignment operator.
tResult Reset(const iobject_ptr< T > &i_oOther)
Reset this weak_object_ptr<> with the content of another iobject_ptr<>
~weak_object_ptr()
Destructs the weak_object_ptr.
object_ptr< T > Lock() const
Create an object_ptr<> from *this weak pointer (thread safe).
void Reset()
Reset to an empty weak_ptr object.
weak_object_ptr(const weak_object_ptr &i_oOther)
Copy constructor.
weak_object_ptr()
Default constructor for empty construction.
weak_object_ptr(std::nullptr_t)
Construct the weak_ptr from a nullptr - for empty construction.
void Swap(weak_object_ptr &o_oOther)
Swap content of *this with o_oOther (only shallow copies are performed!)
weak_object_ptr(const iobject_ptr< U > &i_pOther)
Copy construction from an iobject_ptr.
tResult Reset(const iobject_ptr< U > &i_oOther)
Reset this weak_object_ptr<> with the content of another iobject_ptr<>
weak_object_ptr(weak_object_ptr &&oOther)
Move constructor.
weak_object_ptr & operator=(const iobject_ptr< U > &i_pOther)
Assignment from an iobject_ptr.
Namespace for entire ADTF SDK.