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
104 template<
class derived_type >
107 std::enable_if_t<std::is_base_of_v<reference_type, derived_type>,
int> = 0 )
108 : m_pBody (rRef.
get())
118 template<
class super_type,
119 std::enable_if_t<std::is_base_of_v<super_type, reference_type>,
int> = 0 >
120 inline operator css::uno::Reference<super_type>()
const
122 return css::uno::Reference<super_type>(m_pBody);
138 SAL_CALL
set (reference_type * pBody)
142 reference_type *
const pOld = m_pBody;
156 return set( handle.m_pBody );
159#ifdef LIBO_INTERNAL_ONLY
171 m_pBody = handle.m_pBody;
172 handle.m_pBody =
nullptr;
196 reference_type *
const pOld = m_pBody;
208 reference_type * SAL_CALL
get()
const
218 assert(m_pBody != NULL);
227 assert(m_pBody != NULL);
234 bool SAL_CALL
is()
const
236 return (m_pBody != NULL);
239#if defined LIBO_INTERNAL_ONLY
242 explicit operator bool()
const
250 bool SAL_CALL
operator== (
const reference_type * pBody)
const
252 return (m_pBody == pBody);
261 return (m_pBody == handle.m_pBody);
270 return (m_pBody != handle.m_pBody);
279 return (m_pBody < handle.m_pBody);
288 return (m_pBody > handle.m_pBody);
294#if defined LIBO_INTERNAL_ONLY
305struct hash<::rtl::Reference<T>>
307 std::size_t operator()(::rtl::Reference<T>
const & s)
const
308 {
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:268
bool operator>(const Reference< reference_type > &handle) const
Needed to place References into STL collection.
Definition ref.hxx:286
Reference< reference_type > & clear()
Unbind the body from this handle.
Definition ref.hxx:192
Reference< reference_type > & set(reference_type *pBody)
Set... Similar to assignment.
Definition ref.hxx:138
bool operator==(const reference_type *pBody) const
Returns True if this points to pBody.
Definition ref.hxx:250
reference_type * get() const
Get the body.
Definition ref.hxx:208
bool is() const
Returns True if the handle does point to a valid body.
Definition ref.hxx:234
reference_type & operator*() const
Allows (*handle).someBodyOp().
Definition ref.hxx:225
reference_type * operator->() const
Probably most common used: handle->someBodyOp().
Definition ref.hxx:216
~Reference() COVERITY_NOEXCEPT_FALSE
Destructor...
Definition ref.hxx:128
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:154
Reference()
Constructor...
Definition ref.hxx:55
bool operator<(const Reference< reference_type > &handle) const
Needed to place References into STL collection.
Definition ref.hxx:277
Reference(reference_type *pBody, __sal_NoAcquire)
Constructor...
Definition ref.hxx:62
Reference(reference_type *pBody)
Constructor...
Definition ref.hxx:69