LibreOffice: cppu::OInterfaceIteratorHelper Class Reference

LibreOffice LibreOffice 26.8 SDK C/C++ API Reference

Loading...
Searching...
No Matches
cppu::OInterfaceIteratorHelper Class Reference

This is the iterator of an InterfaceContainerHelper. More...

`#include <interfacecontainer.h>`

## Public Member Functions
| OInterfaceIteratorHelper (OInterfaceContainerHelper &rCont)
| Create an iterator over the elements of the container.
| ~OInterfaceIteratorHelper ()
| Releases the connection to the container.
bool | hasMoreElements () const
| Return true, if there are more elements in the iterator.
css::uno::XInterface * | next ()
| Return the next element of the iterator.
void | remove ()
| Removes the current element (the last one returned by next()) from the underlying container.

## Detailed Description

This is the iterator of an InterfaceContainerHelper.

Typically one constructs an instance on the stack for one firing session. It is not allowed to assign or copy an instance of this class.

See also
  OInterfaceContainerHelper

## Constructor & Destructor Documentation

## ◆ OInterfaceIteratorHelper()

cppu::OInterfaceIteratorHelper::OInterfaceIteratorHelper | ( | OInterfaceContainerHelper & | rCont | ) |

Create an iterator over the elements of the container.

The iterator copies the elements of the container. A change to the container during the lifetime of an iterator is allowed and does not affect the iterator-instance. The iterator and the container take cares themself for concurrent access, no additional guarding is necessary.

Remark: The copy is on demand. The iterator copy the elements only if the container change the contents. It is not allowed to destroy the container as long as an iterator exist.

Parameters

  rCont | the container of the elements.

## ◆ ~OInterfaceIteratorHelper()

cppu::OInterfaceIteratorHelper::~OInterfaceIteratorHelper | ( |  | ) |

Releases the connection to the container.

## Member Function Documentation

## ◆ hasMoreElements()

bool cppu::OInterfaceIteratorHelper::hasMoreElements | ( |  | ) | const
| inline

Return true, if there are more elements in the iterator.

## ◆ next()

css::uno::XInterface * cppu::OInterfaceIteratorHelper::next | ( |  | ) |

Return the next element of the iterator.

Calling this method if hasMoreElements() has returned false, is an error. Cast the returned pointer to the

## ◆ remove()

void cppu::OInterfaceIteratorHelper::remove | ( |  | ) |

Removes the current element (the last one returned by next()) from the underlying container.

Calling this method before next() has been called or calling it twice with no next() inbetween is an error.

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

- cppuhelper/interfacecontainer.h