24 #ifndef INCLUDED_RTL_REF_HXX 25 #define INCLUDED_RTL_REF_HXX 32 #ifdef LIBO_INTERNAL_ONLY 33 #include <type_traits> 44 template <
class reference_type>
49 reference_type * m_pBody;
79 : m_pBody (handle.m_pBody)
85 #ifdef LIBO_INTERNAL_ONLY 86 #if !defined(__COVERITY__) // suppress COPY_INSTEAD_OF_MOVE suggestions 90 : m_pBody (handle.m_pBody)
92 handle.m_pBody =
nullptr;
97 #if defined LIBO_INTERNAL_ONLY 102 template <
class super_type,
103 std::enable_if_t<std::is_base_of_v<super_type, reference_type>,
int> = 0>
104 inline operator Reference<super_type>()
const 106 return Reference<super_type>(m_pBody);
113 template<
class super_type,
114 std::enable_if_t<std::is_base_of_v<super_type, reference_type>,
int> = 0 >
115 inline operator css::uno::Reference<super_type>()
const 117 return css::uno::Reference<super_type>(m_pBody);
133 SAL_CALL
set (reference_type * pBody)
137 reference_type *
const pOld = m_pBody;
151 return set( handle.m_pBody );
154 #ifdef LIBO_INTERNAL_ONLY 166 m_pBody = handle.m_pBody;
167 handle.m_pBody =
nullptr;
174 Reference<reference_type> &
191 reference_type *
const pOld = m_pBody;
203 reference_type * SAL_CALL
get()
const 213 assert(m_pBody != NULL);
222 assert(m_pBody != NULL);
229 bool SAL_CALL
is()
const 231 return (m_pBody != NULL);
234 #if defined LIBO_INTERNAL_ONLY 237 explicit operator bool()
const 245 bool SAL_CALL
operator== (
const reference_type * pBody)
const 247 return (m_pBody == pBody);
256 return (m_pBody == handle.m_pBody);
265 return (m_pBody != handle.m_pBody);
272 SAL_CALL operator< (const Reference<reference_type> & handle)
const 274 return (m_pBody < handle.m_pBody);
283 return (m_pBody > handle.m_pBody);
289 #if defined LIBO_INTERNAL_ONLY 303 {
return std::size_t(s.
get()); }
reference_type * operator->() const
Probably most common used: handle->someBodyOp().
Definition: ref.hxx:211
Reference(reference_type *pBody, __sal_NoAcquire)
Constructor...
Definition: ref.hxx:62
bool operator>(const Reference< reference_type > &handle) const
Needed to place References into STL collection.
Definition: ref.hxx:281
Reference()
Constructor...
Definition: ref.hxx:55
Reference< reference_type > & operator=(const Reference< reference_type > &handle)
Assignment.
Definition: ref.hxx:149
#define COVERITY_NOEXCEPT_FALSE
To markup destructors that coverity warns might throw exceptions which won't throw in practice...
Definition: types.h:367
bool operator==(const reference_type *pBody) const
Returns True if this points to pBody.
Definition: ref.hxx:245
reference_type & operator*() const
Allows (*handle).someBodyOp().
Definition: ref.hxx:220
bool operator!=(const Reference< reference_type > &handle) const
Needed to place References into STL collection.
Definition: ref.hxx:263
Reference< reference_type > & clear()
Unbind the body from this handle.
Definition: ref.hxx:187
__sal_NoAcquire
Definition: types.h:370
Template reference class for reference type.
Definition: ref.hxx:45
Definition: bootstrap.hxx:33
~Reference() COVERITY_NOEXCEPT_FALSE
Destructor...
Definition: ref.hxx:123
Reference(reference_type *pBody)
Constructor...
Definition: ref.hxx:69
Reference(const Reference< reference_type > &handle)
Copy constructor...
Definition: ref.hxx:78
bool is() const
Returns True if the handle does point to a valid body.
Definition: ref.hxx:229
reference_type * get() const
Get the body.
Definition: ref.hxx:203