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
89 : m_pBody (handle.m_pBody)
91 handle.m_pBody =
nullptr;
95#if defined LIBO_INTERNAL_ONLY
102 template<
class derived_type >
104 const Reference< derived_type > & rRef,
105 std::enable_if_t<std::is_base_of_v<reference_type, derived_type>,
int> = 0 )
106 : m_pBody (rRef.
get())
116 template<
class super_type,
117 std::enable_if_t<std::is_base_of_v<super_type, reference_type>,
int> = 0 >
118 inline operator css::uno::Reference<super_type>()
const
120 return css::uno::Reference<super_type>(m_pBody);
136 SAL_CALL
set (reference_type * pBody)
140 reference_type *
const pOld = m_pBody;
154 return set( handle.m_pBody );
157#ifdef LIBO_INTERNAL_ONLY
169 m_pBody = handle.m_pBody;
170 handle.m_pBody =
nullptr;
177 Reference<reference_type> &
194 reference_type *
const pOld = m_pBody;
206 reference_type * SAL_CALL
get()
const
216 assert(m_pBody != NULL);
225 assert(m_pBody != NULL);
232 bool SAL_CALL
is()
const
234 return (m_pBody != NULL);
237#if defined LIBO_INTERNAL_ONLY
240 explicit operator bool()
const
248 bool SAL_CALL
operator== (
const reference_type * pBody)
const
250 return (m_pBody == pBody);
259 return (m_pBody == handle.m_pBody);
268 return (m_pBody != handle.m_pBody);
277 return (m_pBody < handle.m_pBody);
286 return (m_pBody > handle.m_pBody);
292#if defined LIBO_INTERNAL_ONLY
306 {
return std::size_t(s.
get()); }
__sal_NoAcquire
Definition types.h:353
#define COVERITY_NOEXCEPT_FALSE
To markup destructors that coverity warns might throw exceptions which won't throw in practice,...
Definition types.h:349
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:266
bool operator>(const Reference< reference_type > &handle) const
Needed to place References into STL collection.
Definition ref.hxx:284
Reference< reference_type > & clear()
Unbind the body from this handle.
Definition ref.hxx:190
Reference< reference_type > & set(reference_type *pBody)
Set... Similar to assignment.
Definition ref.hxx:136
bool operator==(const reference_type *pBody) const
Returns True if this points to pBody.
Definition ref.hxx:248
reference_type * get() const
Get the body.
Definition ref.hxx:206
bool is() const
Returns True if the handle does point to a valid body.
Definition ref.hxx:232
reference_type & operator*() const
Allows (*handle).someBodyOp().
Definition ref.hxx:223
reference_type * operator->() const
Probably most common used: handle->someBodyOp().
Definition ref.hxx:214
~Reference() COVERITY_NOEXCEPT_FALSE
Destructor...
Definition ref.hxx:126
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:152
Reference()
Constructor...
Definition ref.hxx:55
bool operator<(const Reference< reference_type > &handle) const
Needed to place References into STL collection.
Definition ref.hxx:275
Reference(reference_type *pBody, __sal_NoAcquire)
Constructor...
Definition ref.hxx:62
Reference(reference_type *pBody)
Constructor...
Definition ref.hxx:69