24#ifndef INCLUDED_RTL_REF_HXX
25#define INCLUDED_RTL_REF_HXX
32#ifdef LIBO_INTERNAL_ONLY
44template <
class reference_type>
49 reference_type * m_pBody;
79 : m_pBody (handle.m_pBody)
85#ifdef LIBO_INTERNAL_ONLY
86#if !defined(__COVERITY__)
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>
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;
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);
274 return (m_pBody < handle.m_pBody);
283 return (m_pBody > handle.m_pBody);
289#if defined LIBO_INTERNAL_ONLY
300struct hash<::rtl::Reference<T>>
302 std::size_t operator()(::rtl::Reference<T>
const & s)
const
303 {
return std::size_t(s.
get()); }
__sal_NoAcquire
Definition types.h:371
#define COVERITY_NOEXCEPT_FALSE
To markup destructors that coverity warns might throw exceptions which won't throw in practice,...
Definition types.h:367
Definition bootstrap.hxx:34
Template reference class for reference type.
Definition ref.hxx:46
bool operator!=(const Reference< reference_type > &handle) const
Needed to place References into STL collection.
Definition ref.hxx:263
bool operator>(const Reference< reference_type > &handle) const
Needed to place References into STL collection.
Definition ref.hxx:281
Reference< reference_type > & clear()
Unbind the body from this handle.
Definition ref.hxx:187
Reference< reference_type > & set(reference_type *pBody)
Set... Similar to assignment.
Definition ref.hxx:133
bool operator==(const reference_type *pBody) const
Returns True if this points to pBody.
Definition ref.hxx:245
reference_type * get() const
Get the body.
Definition ref.hxx:203
bool is() const
Returns True if the handle does point to a valid body.
Definition ref.hxx:229
reference_type & operator*() const
Allows (*handle).someBodyOp().
Definition ref.hxx:220
reference_type * operator->() const
Probably most common used: handle->someBodyOp().
Definition ref.hxx:211
~Reference() COVERITY_NOEXCEPT_FALSE
Destructor...
Definition ref.hxx:123
Reference(const Reference< reference_type > &handle)
Copy constructor...
Definition ref.hxx:78
Reference< reference_type > & operator=(const Reference< reference_type > &handle)
Assignment.
Definition ref.hxx:149
Reference()
Constructor...
Definition ref.hxx:55
bool operator<(const Reference< reference_type > &handle) const
Needed to place References into STL collection.
Definition ref.hxx:272
Reference(reference_type *pBody, __sal_NoAcquire)
Constructor...
Definition ref.hxx:62
Reference(reference_type *pBody)
Constructor...
Definition ref.hxx:69