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

provides a com.sun.star.container::XEnumeration access based on an object implementing the com.sun.star.container::XNameAccess interface More...

#include <enumhelper.hxx>

Inheritance diagram for comphelper::OEnumerationByName:
[legend]
Collaboration diagram for comphelper::OEnumerationByName:
[legend]

Public Member Functions

 OEnumerationByName (const css::uno::Reference< css::container::XNameAccess > _xAccess)
 
 OEnumerationByName (const css::uno::Reference< css::container::XNameAccess > _xAccess, std::vector< OUString > _aNames)
 
virtual ~OEnumerationByName () override
 
virtual sal_Bool SAL_CALL hasMoreElements () override
 
virtual css::uno::Any SAL_CALL nextElement () override
 
virtual void SAL_CALL disposing (const css::lang::EventObject &aEvent) override
 

Private Member Functions

sal_Int32 getLength () const
 
const OUString & getElement (sal_Int32 nIndex) const
 
COMPHELPER_DLLPRIVATE void impl_startDisposeListening ()
 
COMPHELPER_DLLPRIVATE void impl_stopDisposeListening ()
 

Private Attributes

std::variant< css::uno::Sequence< OUString >, std::vector< OUString > > m_aNames
 
css::uno::Reference< css::container::XNameAccess > m_xAccess
 
sal_Int32 m_nPos
 
bool m_bListening
 
std::mutex m_aLock
 

Detailed Description

provides a com.sun.star.container::XEnumeration access based on an object implementing the com.sun.star.container::XNameAccess interface

Definition at line 40 of file enumhelper.hxx.

Constructor & Destructor Documentation

◆ OEnumerationByName() [1/2]

comphelper::OEnumerationByName::OEnumerationByName ( const css::uno::Reference< css::container::XNameAccess >  _xAccess)

Definition at line 29 of file enumhelper.cxx.

References impl_startDisposeListening(), and m_nPos.

◆ OEnumerationByName() [2/2]

comphelper::OEnumerationByName::OEnumerationByName ( const css::uno::Reference< css::container::XNameAccess >  _xAccess,
std::vector< OUString >  _aNames 
)

Definition at line 39 of file enumhelper.cxx.

References impl_startDisposeListening(), and m_nPos.

◆ ~OEnumerationByName()

comphelper::OEnumerationByName::~OEnumerationByName ( )
overridevirtual

Definition at line 49 of file enumhelper.cxx.

References aLock, impl_stopDisposeListening(), and m_aLock.

Member Function Documentation

◆ disposing()

void SAL_CALL comphelper::OEnumerationByName::disposing ( const css::lang::EventObject &  aEvent)
overridevirtual

Definition at line 94 of file enumhelper.cxx.

References aEvent, aLock, m_aLock, and m_xAccess.

◆ getElement()

const OUString & comphelper::OEnumerationByName::getElement ( sal_Int32  nIndex) const
private

Definition at line 142 of file enumhelper.cxx.

References m_aNames, and nIndex.

Referenced by nextElement().

◆ getLength()

sal_Int32 comphelper::OEnumerationByName::getLength ( ) const
private

Definition at line 134 of file enumhelper.cxx.

References getLength(), m_aNames, and size.

Referenced by getLength(), hasMoreElements(), and nextElement().

◆ hasMoreElements()

sal_Bool SAL_CALL comphelper::OEnumerationByName::hasMoreElements ( )
overridevirtual

Definition at line 57 of file enumhelper.cxx.

References aLock, getLength(), impl_stopDisposeListening(), m_aLock, m_nPos, and m_xAccess.

◆ impl_startDisposeListening()

void comphelper::OEnumerationByName::impl_startDisposeListening ( )
private

Definition at line 103 of file enumhelper.cxx.

References m_bListening, m_refCount, and m_xAccess.

Referenced by OEnumerationByName().

◆ impl_stopDisposeListening()

void comphelper::OEnumerationByName::impl_stopDisposeListening ( )
private

Definition at line 119 of file enumhelper.cxx.

References m_bListening, m_refCount, and m_xAccess.

Referenced by hasMoreElements(), nextElement(), and ~OEnumerationByName().

◆ nextElement()

css::uno::Any SAL_CALL comphelper::OEnumerationByName::nextElement ( )
overridevirtual

Member Data Documentation

◆ m_aLock

std::mutex comphelper::OEnumerationByName::m_aLock
private

Definition at line 48 of file enumhelper.hxx.

Referenced by disposing(), hasMoreElements(), nextElement(), and ~OEnumerationByName().

◆ m_aNames

std::variant<css::uno::Sequence< OUString >, std::vector<OUString> > comphelper::OEnumerationByName::m_aNames
private

Definition at line 44 of file enumhelper.hxx.

Referenced by getElement(), and getLength().

◆ m_bListening

bool comphelper::OEnumerationByName::m_bListening
private

Definition at line 47 of file enumhelper.hxx.

Referenced by impl_startDisposeListening(), and impl_stopDisposeListening().

◆ m_nPos

sal_Int32 comphelper::OEnumerationByName::m_nPos
private

Definition at line 46 of file enumhelper.hxx.

Referenced by hasMoreElements(), and nextElement().

◆ m_xAccess

css::uno::Reference< css::container::XNameAccess > comphelper::OEnumerationByName::m_xAccess
private

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