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 InterfaceContainerHelper. 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
 
bool const bIsList
 
detail::element_alias2 aData
 
sal_Int32 nRemain
 

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

Definition at line 62 of file interfacecontainer2.hxx.

Constructor & Destructor Documentation

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 38 of file interfacecontainer2.cxx.

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

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

Member Function Documentation

bool comphelper::OInterfaceIteratorHelper2::hasMoreElements ( ) const
inline
XInterface * comphelper::OInterfaceIteratorHelper2::next ( )
OInterfaceIteratorHelper2& comphelper::OInterfaceIteratorHelper2::operator= ( const OInterfaceIteratorHelper2 )
privatedelete
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 100 of file interfacecontainer2.cxx.

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

Referenced by comphelper::OInterfaceContainerHelper2::forEach(), and comphelper::OListenerContainer::impl_notify().

Member Data Documentation

detail::element_alias2 comphelper::OInterfaceIteratorHelper2::aData
private
bool const comphelper::OInterfaceIteratorHelper2::bIsList
private
sal_Int32 comphelper::OInterfaceIteratorHelper2::nRemain
private

Definition at line 105 of file interfacecontainer2.hxx.

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

OInterfaceContainerHelper2& comphelper::OInterfaceIteratorHelper2::rCont
private

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