43 class i_reference_counted;
51 virtual
bool expired() const noexcept = 0;
65 virtual void add_ref() const noexcept = 0;
67 virtual int32_t use_count() const noexcept = 0;
70 virtual
void pin() const noexcept = 0;
71 virtual
void unpin() const = 0;
76 template <typename Interface>
81 struct no_object : std::logic_error {
no_object() : std::logic_error(
"i_ref_ptr::no_object") {} };
90 virtual int32_t use_count() const noexcept = 0;
91 virtual
void reset() = 0;
92 virtual
void reset(Interface* aPtr) = 0;
93 virtual
void reset(Interface* aPtr, Interface* aManagedPtr) = 0;
94 virtual
void reset(Interface* aPtr, Interface* aManagedPtr,
bool aReferenceCounted,
bool aAddRef) = 0;
96 virtual Interface* detach() = 0;
97 virtual
bool valid() const noexcept = 0;
98 virtual
bool managing() const noexcept = 0;
99 virtual Interface*
ptr() const noexcept = 0;
100 virtual Interface* managed_ptr() const noexcept = 0;
101 virtual Interface* operator->() const = 0;
102 virtual Interface& operator*() const = 0;
103 i_ref_ptr& operator=(const
i_ref_ptr& aOther) { reset(aOther.ptr(), aOther.managed_ptr(), aOther.reference_counted(),
true);
return *
this; }
104 template <
typename Interface2>
106 explicit operator bool() const noexcept {
return valid(); }
107 bool operator==(std::nullptr_t)
const noexcept {
return !valid(); }
108 bool operator!=(std::nullptr_t)
const noexcept {
return valid(); }
109 template <
typename Interface2>
111 template <
typename Interface2>
113 template <
typename Interface2>
117 template <
typename Interface1,
typename Interface2>
123 template <
typename Interface1,
typename Interface2>
129 template <
typename Interface1,
typename Interface2>
132 return !(lhs == rhs);
135 template <
typename Interface1,
typename Interface2>
138 return !(lhs == rhs);
141 template <
typename Interface1,
typename Interface2>
147 template <
typename Interface1,
typename Interface2>
153 template <
typename Interface>
virtual bool expired() const noexcept=0
virtual void add_ref() noexcept=0
virtual ~i_ref_control_block()=default
virtual i_reference_counted * ptr() const noexcept=0
virtual int32_t weak_use_count() const noexcept=0
bool operator!=(const i_ref_ptr< Interface2 > &aOther) const noexcept
virtual bool reference_counted() const noexcept=0
virtual ~i_ref_ptr()=default
bool operator==(const i_ref_ptr< Interface2 > &aOther) const noexcept
virtual Interface * ptr() const noexcept=0
bool operator<(const i_ref_ptr< Interface2 > &aOther) const noexcept
i_ref_ptr & operator=(const i_ref_ptr< Interface2 > &aOther)
bool operator!=(std::nullptr_t) const noexcept
virtual Interface * managed_ptr() const noexcept=0
bool operator==(std::nullptr_t) const noexcept
virtual ~i_reference_counted()=default
virtual void add_ref() const noexcept=0
virtual bool expired() const noexcept=0
typename detail::abstract_type< T >::type abstract_t
release_during_destruction()