LibreOffice Module comphelper (master) 1
Public Member Functions | Private Member Functions | Private Attributes | List of all members
comphelper::OInterfaceIteratorHelper2 Class Reference

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

#include <interfacecontainer2.hxx>

Collaboration diagram for comphelper::OInterfaceIteratorHelper2:
[legend]

Public Member Functions

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

Private Member Functions

 OInterfaceIteratorHelper2 (const OInterfaceIteratorHelper2 &)=delete
 
OInterfaceIteratorHelper2operator= (const OInterfaceIteratorHelper2 &)=delete
 

Private Attributes

OInterfaceContainerHelper2rCont
 
detail::element_alias2 aData
 
sal_Int32 nRemain
 
bool bIsList
 

Detailed Description

This is the iterator of an OInterfaceContainerHelper2.

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
OInterfaceContainerHelper2

Definition at line 61 of file interfacecontainer2.hxx.

Constructor & Destructor Documentation

◆ OInterfaceIteratorHelper2() [1/2]

comphelper::OInterfaceIteratorHelper2::OInterfaceIteratorHelper2 ( OInterfaceContainerHelper2 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
rContthe container of the elements.

Definition at line 40 of file interfacecontainer2.cxx.

References aData, comphelper::OInterfaceContainerHelper2::aData, comphelper::OInterfaceContainerHelper2::bInUse, bIsList, comphelper::OInterfaceContainerHelper2::bIsList, comphelper::OInterfaceContainerHelper2::copyAndResetInUse(), nRemain, comphelper::detail::element_alias2::pAsInterface, comphelper::detail::element_alias2::pAsVector, rCont, and comphelper::OInterfaceContainerHelper2::rMutex.

◆ ~OInterfaceIteratorHelper2()

comphelper::OInterfaceIteratorHelper2::~OInterfaceIteratorHelper2 ( )

◆ OInterfaceIteratorHelper2() [2/2]

comphelper::OInterfaceIteratorHelper2::OInterfaceIteratorHelper2 ( const OInterfaceIteratorHelper2 )
privatedelete

Member Function Documentation

◆ hasMoreElements()

bool comphelper::OInterfaceIteratorHelper2::hasMoreElements ( ) const
inline

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

Definition at line 85 of file interfacecontainer2.hxx.

Referenced by comphelper::OInterfaceContainerHelper2::disposeAndClear(), and comphelper::OInterfaceContainerHelper2::forEach().

◆ next()

XInterface * comphelper::OInterfaceIteratorHelper2::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

Definition at line 88 of file interfacecontainer2.cxx.

References aData, bIsList, nRemain, comphelper::detail::element_alias2::pAsInterface, and comphelper::detail::element_alias2::pAsVector.

Referenced by comphelper::OInterfaceContainerHelper2::disposeAndClear(), and comphelper::OInterfaceContainerHelper2::forEach().

◆ operator=()

OInterfaceIteratorHelper2 & comphelper::OInterfaceIteratorHelper2::operator= ( const OInterfaceIteratorHelper2 )
privatedelete

◆ remove()

void comphelper::OInterfaceIteratorHelper2::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.

Definition at line 102 of file interfacecontainer2.cxx.

References aData, bIsList, o3tl::make_unsigned(), nRemain, comphelper::detail::element_alias2::pAsInterface, comphelper::detail::element_alias2::pAsVector, rCont, and comphelper::OInterfaceContainerHelper2::removeInterface().

Referenced by comphelper::OInterfaceContainerHelper2::forEach().

Member Data Documentation

◆ aData

detail::element_alias2 comphelper::OInterfaceIteratorHelper2::aData
private

◆ bIsList

bool comphelper::OInterfaceIteratorHelper2::bIsList
private

◆ nRemain

sal_Int32 comphelper::OInterfaceIteratorHelper2::nRemain
private

Definition at line 103 of file interfacecontainer2.hxx.

Referenced by next(), OInterfaceIteratorHelper2(), and remove().

◆ rCont

OInterfaceContainerHelper2& comphelper::OInterfaceIteratorHelper2::rCont
private

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