LibreOffice: rtl::Reference< reference_type > Class Template Reference

LibreOffice LibreOffice 26.8 SDK C/C++ API Reference

Loading...
Searching...
No Matches
rtl::Reference< reference_type > Class Template Reference

Template reference class for reference type. More...

`#include <ref.hxx>`

## Public Member Functions
| Reference ()
| Constructor...
| Reference (reference_type *pBody, __sal_NoAcquire)
| Constructor...
| Reference (reference_type *pBody)
| Constructor...
| Reference (const Reference< reference_type > &handle)
| Copy constructor...
| ~Reference () COVERITY_NOEXCEPT_FALSE
| Destructor...
Reference< reference_type > & | set (reference_type *pBody)
| Set... Similar to assignment.
Reference< reference_type > & | operator= (const Reference< reference_type > &handle)
| Assignment.
Reference< reference_type > & | operator= (reference_type *pBody)
| Assignment...
Reference< reference_type > & | clear ()
| Unbind the body from this handle.
reference_type * | get () const
| Get the body.
reference_type * | operator-> () const
| Probably most common used: handle->someBodyOp().
reference_type & | operator* () const
| Allows (*handle).someBodyOp().
bool | is () const
| Returns True if the handle does point to a valid body.
bool | operator== (const reference_type *pBody) const
| Returns True if this points to pBody.
bool | operator== (const Reference< reference_type > &handle) const
| Returns True if handle points to the same body.
bool | operator!= (const Reference< reference_type > &handle) const
| Needed to place References into STL collection.
bool | operator< (const Reference< reference_type > &handle) const
| Needed to place References into STL collection.
bool | operator> (const Reference< reference_type > &handle) const
| Needed to place References into STL collection.

## Detailed Description

template<class reference_type>
class rtl::Reference< reference_type >

Template reference class for reference type.

## Constructor & Destructor Documentation

## ◆ Reference() [1/4]

template<class reference_type>

rtl::Reference< reference_type >::Reference | ( |  | ) |
| inline

Constructor...

## ◆ Reference() [2/4]

template<class reference_type>

rtl::Reference< reference_type >::Reference | ( | reference_type * | pBody,
|  | __sal_NoAcquire | )
| inline

Constructor...

## ◆ Reference() [3/4]

template<class reference_type>

rtl::Reference< reference_type >::Reference | ( | reference_type * | pBody | ) |
| inline

Constructor...

## ◆ Reference() [4/4]

template<class reference_type>

rtl::Reference< reference_type >::Reference | ( | const Reference< reference_type > & | handle | ) |
| inline

Copy constructor...

## ◆ ~Reference()

template<class reference_type>

rtl::Reference< reference_type >::~Reference | ( |  | ) |
| inline

Destructor...

## Member Function Documentation

## ◆ clear()

template<class reference_type>

Reference< reference_type > & rtl::Reference< reference_type >::clear | ( |  | ) |
| inline

Unbind the body from this handle.

Note that for a handle representing a large body, "handle.clear().set(new body());" might perform a little bit better than "handle.set(new body());", since in the second case two large objects exist in memory (the old body and the new body).

## ◆ get()

template<class reference_type>

reference_type * rtl::Reference< reference_type >::get | ( |  | ) | const
| inline

Get the body.

Can be used instead of operator->(). I.e. handle->someBodyOp() and handle.get()->someBodyOp() are the same.

## ◆ is()

template<class reference_type>

bool rtl::Reference< reference_type >::is | ( |  | ) | const
| inline

Returns True if the handle does point to a valid body.

## ◆ operator!=()

template<class reference_type>

bool rtl::Reference< reference_type >::operator!= | ( | const Reference< reference_type > & | handle | ) | const
| inline

Needed to place References into STL collection.

## ◆ operator*()

template<class reference_type>

reference_type & rtl::Reference< reference_type >::operator* | ( |  | ) | const
| inline

Allows (*handle).someBodyOp().

## ◆ operator->()

template<class reference_type>

reference_type * rtl::Reference< reference_type >::operator-> | ( |  | ) | const
| inline

Probably most common used: handle->someBodyOp().

## ◆ operator<()

template<class reference_type>

bool rtl::Reference< reference_type >::operator< | ( | const Reference< reference_type > & | handle | ) | const
| inline

Needed to place References into STL collection.

## ◆ operator=() [1/2]

template<class reference_type>

Reference< reference_type > & rtl::Reference< reference_type >::operator= | ( | const Reference< reference_type > & | handle | ) |
| inline

Assignment.

Unbinds this instance from its body (if bound) and bind it to the body represented by the handle.

## ◆ operator=() [2/2]

template<class reference_type>

Reference< reference_type > & rtl::Reference< reference_type >::operator= | ( | reference_type * | pBody | ) |
| inline

Assignment...

## ◆ operator==() [1/2]

template<class reference_type>

bool rtl::Reference< reference_type >::operator== | ( | const Reference< reference_type > & | handle | ) | const
| inline

Returns True if handle points to the same body.

## ◆ operator==() [2/2]

template<class reference_type>

bool rtl::Reference< reference_type >::operator== | ( | const reference_type * | pBody | ) | const
| inline

Returns True if this points to pBody.

## ◆ operator>()

template<class reference_type>

bool rtl::Reference< reference_type >::operator> | ( | const Reference< reference_type > & | handle | ) | const
| inline

Needed to place References into STL collection.

## ◆ set()

template<class reference_type>

Reference< reference_type > & rtl::Reference< reference_type >::set | ( | reference_type * | pBody | ) |
| inline

Set... Similar to assignment.

The documentation for this class was generated from the following file:

- rtl/ref.hxx