20 #ifndef INCLUDED_RTL_REF_HXX
21 #define INCLUDED_RTL_REF_HXX
43 #if !defined _MSC_VER // public -> protected changes mangled names there
53 template <
class reference_type>
58 reference_type * m_pBody;
82 : m_pBody (handle.m_pBody)
101 SAL_CALL
set (reference_type * pBody)
105 reference_type *
const pOld = m_pBody;
119 return set( handle.m_pBody );
141 reference_type *
const pOld = m_pBody;
153 inline reference_type * SAL_CALL
get()
const
163 OSL_PRECOND(m_pBody,
"Reference::operator->() : null body");
172 OSL_PRECOND(m_pBody,
"Reference::operator*() : null body");
179 inline bool SAL_CALL
is()
const
181 return (m_pBody != 0);
187 inline bool SAL_CALL
operator== (
const reference_type * pBody)
const
189 return (m_pBody == pBody);
198 return (m_pBody == handle.m_pBody);
207 return (m_pBody != handle.m_pBody);
214 SAL_CALL operator< (const Reference<reference_type> & handle)
const
216 return (m_pBody < handle.m_pBody);
225 return (m_pBody > handle.m_pBody);
232 template <
typename T>
233 inline T * get_pointer( Reference<T>
const& r )
sal_Int32 oslInterlockedCount
Definition: interlck.h:32
#define OSL_PRECOND(c, m)
Definition: diagnose.h:111
Definition: bootstrap.hxx:24
Reference()
Constructor...
Definition: ref.hxx:64
bool operator==(const reference_type *pBody) const
Returns True if this points to pBody.
Definition: ref.hxx:187
Reference(reference_type *pBody)
Constructor...
Definition: ref.hxx:71
bool is() const
Returns True if the handle does point to a valid body.
Definition: ref.hxx:179
Template reference class for reference type derived from IReference.
Definition: ref.hxx:54
bool operator>(const Reference< reference_type > &handle) const
Needed to place References into STL collection.
Definition: ref.hxx:223
~Reference()
Destructor...
Definition: ref.hxx:91
~IReference()
Definition: ref.hxx:46
Interface for a reference type.
Definition: ref.hxx:32
Reference< reference_type > & operator=(const Reference< reference_type > &handle)
Assignment.
Definition: ref.hxx:117
Reference< reference_type > & clear()
Unbind the body from this handle.
Definition: ref.hxx:137
reference_type & operator*() const
Allows (*handle).someBodyOp().
Definition: ref.hxx:170
virtual oslInterlockedCount release()=0
virtual oslInterlockedCount acquire()=0
reference_type * operator->() const
Probably most common used: handle->someBodyOp().
Definition: ref.hxx:161
Reference(const Reference< reference_type > &handle)
Copy constructor...
Definition: ref.hxx:81
Reference< reference_type > & set(reference_type *pBody)
Set...
Definition: ref.hxx:101
bool operator!=(const Reference< reference_type > &handle) const
Needed to place References into STL collection.
Definition: ref.hxx:205