7 #ifndef _ADTF_UCOM_ANT_OBJECT_PTR_UTILITIES_IMPLEMENTATION_HEADER_
8 #define _ADTF_UCOM_ANT_OBJECT_PTR_UTILITIES_IMPLEMENTATION_HEADER_
64 template<
typename Implementation,
typename ...Args>
friend
65 typename std::enable_if
70 typename std::remove_cv<Implementation>::type
102 template<
typename T,
typename U>
105 const auto p = ucom_cast<typename object_ptr<T>::element_type*>(i_oOther.
Get());
132 template<
typename Implementation,
typename ...Args>
134 typename std::enable_if
139 typename std::remove_cv<Implementation>::type
146 new (std::nothrow) Implementation(std::forward<Args>(args)...));
169 template<
typename Implementation,
typename ...Args>
171 typename std::enable_if
176 typename std::remove_cv<Implementation>::type
185 new (nothrow)
typename remove_cv<Implementation>::type(forward<Args>(args)...));
190 typename std::remove_cv<Implementation>::type
220 if (
nullptr == i_oSrc.Get())
227 const auto pTmp = ucom_object_ptr_cast<const T>(i_oSrc);
231 return ERR_NO_INTERFACE;
234 return o_oDest.Reset(pTmp);
246 template<
typename T,
template<
typename>
class TSrc =
iobject_ptr>
250 return o_oDest.
Reset(pTmp);
A common result class usable as return value throughout.
Safely retrieve a valid object_ptr<> instance to *this when all we have is *this.
~enable_object_ptr_from_this()=default
Default destructor.
object_ptr< const T > object_ptr_from_this() const
Retrieve an object_ptr with *this being the shared resource - const correct.
friend std::enable_if< std::is_base_of< enable_object_ptr_from_this< typename std::remove_cv< Implementation >::type >, typename std::remove_cv< Implementation >::type >::value, object_ptr< Implementation > >::type make_object_ptr(Args &&... args)
Create an instance of type object_ptr with Implementation as the shared resource.
enable_object_ptr_from_this & operator=(const enable_object_ptr_from_this &)=default
Default copy assignment.
void Assign(const object_ptr< T > &i_pObject)
Assign an existing shared resource in form of the managing object ptr.
enable_object_ptr_from_this()=default
Default constructor.
object_ptr< T > object_ptr_from_this()
Retrieve an object_ptr with *this being the shared resource.
enable_object_ptr_from_this(const enable_object_ptr_from_this &)=default
Default copy construction.
weak_object_ptr< T > m_pWeak
weak pointer managing the object_ptr to enable
Base object pointer to realize binary compatible reference counting in interface methods.
virtual tResult Reset(const iobject_ptr< T > &i_oOther)=0
Reset this object_ptr<> with the content of another iobject_ptr<>
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.
std::enable_if< !std::is_base_of< enable_object_ptr_from_this< typename std::remove_cv< Implementation >::type >, typename std::remove_cv< Implementation >::type >::value, object_ptr< Implementation > >::type make_object_ptr(Args &&... args)
Create an instance of type object_ptr with Implementation as the shared resource.
tResult reset_object_ptr(TDest< const T > &o_oDest, const TSrc< U > &i_oSrc)
Reset an iobject_ptr with const T.
object_ptr< T > ucom_object_ptr_cast(const iobject_ptr< U > &i_oOther)
Create an object_ptr with an already shared resource of implicitly convertible type.
ant::object_ptr< T > ucom_object_ptr_const_cast(const ant::iobject_ptr< const T > &i_oOther)
Create an object_ptr with a mutable shared resource of an existing const resource.
ant::iobject_ptr< T > iobject_ptr
Alias always bringing the latest version of ant::iobject_ptr into scope.
Namespace for entire ADTF SDK.