21template<
typename Implementation,
bool Fuse,
typename Allocator,
typename... Args>
22inline object_ptr<Implementation>
allocate_object_ptr(Allocator&& allocator, Args&&... args);
59 return m_pWeak.Lock();
69 return m_pWeak.Lock();
74 template<
typename Implementation,
bool Fuse,
typename Allocator,
typename... Args>
84 m_pWeak.Reset(i_pObject);
128template<
typename Implementation,
typename... Args>
145template<
typename Implementation>
149 std::forward<Implementation>(object_to_emplace));
165template<
typename T,
typename U>
169 if (
nullptr == i_oSrc.
Get())
180 return ERR_NO_INTERFACE;
183 return o_oDest.
Reset(pTmp);
199 return o_oDest.
Reset(pTmp);
244template<
typename Implementation,
bool Fuse,
typename Allocator,
typename... Args>
247 static_assert(!std::is_reference_v<Implementation> && !std::is_volatile_v<Implementation>);
248 using implementation_base_type = std::remove_const_t<Implementation>;
249 using allocator_base =
typename std::allocator_traits<Allocator>::template rebind_alloc<void>;
250 using counter_type = detail::fused_object_reference_counter<implementation_base_type, allocator_base, Fuse>;
252 auto pCounter = counter_type::Create(std::forward<Allocator>(allocator), std::forward<Args>(args)...);
253 auto pSharedObject = pCounter->GetSharedObject();
257 if constexpr (std::is_base_of_v<ant::enable_object_ptr_from_this<implementation_base_type>, implementation_base_type>)
260 pEnabler->Assign(oResult);
A_UTILS_NS::cResult tResult
For backwards compatibility and to bring latest version into scope.
Definition result.h:736
Safely retrieve a valid object_ptr<> instance to *this when all we have is *this.
Definition object_ptr_utilities.h:40
~enable_object_ptr_from_this()=default
Default destructor.
object_ptr< T > object_ptr_from_this()
Retrieve an object_ptr with *this being the shared resource.
Definition object_ptr_utilities.h:57
enable_object_ptr_from_this()=default
Default constructor.
object_ptr< const T > object_ptr_from_this() const
Retrieve an object_ptr with *this being the shared resource - const correct.
Definition object_ptr_utilities.h:67
enable_object_ptr_from_this(const enable_object_ptr_from_this &)=default
Default copy construction.
enable_object_ptr_from_this & operator=(const enable_object_ptr_from_this &)=default
Default copy assignment.
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.
Definition object_ptr_intf.h:112
Definition object_ptr.h:384
Namespace for all functionality of the ADTF UCOM SDK provided since v3.0.
Definition test_runtime.h:14
tResult reset_object_ptr(iobject_ptr< const T > &o_oDest, const iobject_ptr< U > &i_oSrc)
Reset an iobject_ptr with const T.
Definition object_ptr_utilities.h:166
object_ptr< T > ucom_object_ptr_cast(object_ptr< T > oCasted)
Create an object_ptr with an already shared resource of implicitly convertible type.
Definition object_ptr_utilities.h:104
object_ptr< Implementation > make_object_ptr(Args &&... args)
Create an instance of type object_ptr with Implementation as the shared resource.
Definition object_ptr_utilities.h:129
Namespace for all functionality of the ADTF UCOM SDK provided since v3.21.
Definition plugin_logging_intf.h:48
object_ptr< Implementation > allocate_object_ptr(Allocator &&allocator, Args &&... args)
Create an instance of type object_ptr with Implementation as the shared resource.
Definition object_ptr_utilities.h:245
Namespace for the ADTF uCOM SDK.
Definition adtf_system.h:324
ant::weak_object_ptr< T > weak_object_ptr
Alias always bringing the latest version of ant::weak_object_ptr into scope.
Definition weak_object_ptr.h:232
ant::enable_object_ptr_from_this< T > enable_object_ptr_from_this
Alias always bringing the latest version of ant::enable_object_ptr_from_this into scope.
Definition object_ptr_utilities.h:269
Namespace for all functionality provided by ADTF and its SDKs.
Definition adtf_client_connector.h:14
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.
Definition object_ptr_utilities.h:214