LibreOffice Module connectivity (master) 1
Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
connectivity::sdbcx::OCollection Class Referenceabstract

#include <VCollection.hxx>

Inheritance diagram for connectivity::sdbcx::OCollection:
[legend]
Collaboration diagram for connectivity::sdbcx::OCollection:
[legend]

Public Member Functions

virtual ~OCollection ()
 
 DECLARE_SERVICE_INFO ()
 
void reFill (const ::std::vector< OUString > &_rVector)
 
bool isCaseSensitive () const
 
void renameObject (const OUString &_sOldName, const OUString &_sNewName)
 
virtual void disposing ()
 
virtual void SAL_CALL acquire () noexcept override
 
virtual void SAL_CALL release () noexcept override
 
virtual css::uno::Any SAL_CALL queryInterface (const css::uno::Type &rType) override
 
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () override
 
virtual css::uno::Type SAL_CALL getElementType () override
 
virtual sal_Bool SAL_CALL hasElements () override
 
virtual sal_Int32 SAL_CALL getCount () override
 
virtual css::uno::Any SAL_CALL getByIndex (sal_Int32 Index) override
 
virtual css::uno::Any SAL_CALL getByName (const OUString &aName) override
 
virtual css::uno::Sequence< OUString > SAL_CALL getElementNames () override
 
virtual sal_Bool SAL_CALL hasByName (const OUString &aName) override
 
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL createEnumeration () override
 
virtual void SAL_CALL refresh () override
 
virtual void SAL_CALL addRefreshListener (const css::uno::Reference< css::util::XRefreshListener > &l) override
 
virtual void SAL_CALL removeRefreshListener (const css::uno::Reference< css::util::XRefreshListener > &l) override
 
virtual css::uno::Reference< css::beans::XPropertySet > SAL_CALL createDataDescriptor () override
 
virtual void SAL_CALL appendByDescriptor (const css::uno::Reference< css::beans::XPropertySet > &descriptor) override
 
virtual void SAL_CALL dropByName (const OUString &elementName) override
 
virtual void SAL_CALL dropByIndex (sal_Int32 index) override
 
virtual sal_Int32 SAL_CALL findColumn (const OUString &columnName) override
 
virtual void SAL_CALL addContainerListener (const css::uno::Reference< css::container::XContainerListener > &xListener) override
 
virtual void SAL_CALL removeContainerListener (const css::uno::Reference< css::container::XContainerListener > &xListener) override
 
- Public Member Functions inherited from cppu::ImplHelper10< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 >
virtual css::uno::Any SAL_CALL queryInterface (css::uno::Type const &rType) SAL_OVERRIDE
 
virtual css::uno::Sequence< css::uno::Type > SAL_CALL getTypes () SAL_OVERRIDE
 
virtual css::uno::Sequence< sal_Int8 > SAL_CALL getImplementationId () SAL_OVERRIDE
 

Protected Member Functions

virtual void impl_refresh ()=0
 
virtual ObjectType createObject (const OUString &_rName)=0
 
virtual css::uno::Reference< css::beans::XPropertySetcreateDescriptor ()
 
virtual ObjectType appendObject (const OUString &_rForName, const css::uno::Reference< css::beans::XPropertySet > &descriptor)
 appends an object described by a descriptor, under a given name More...
 
virtual void dropObject (sal_Int32 _nPos, const OUString &_sElementName)
 
virtual OUString getNameForObject (const ObjectType &_xObject)
 returns the name for the object. More...
 
ObjectType cloneDescriptor (const ObjectType &_descriptor)
 clones the given descriptor More...
 
 OCollection (::cppu::OWeakObject &_rParent, bool _bCase, ::osl::Mutex &_rMutex, const ::std::vector< OUString > &_rVector, bool _bUseIndexOnly=false, bool _bUseHardRef=true)
 
void clear_NoDispose ()
 clear the name map More...
 
void insertElement (const OUString &_sElementName, const ObjectType &_xElement)
 insert a new element into the collection More...
 
ObjectType getObject (sal_Int32 _nIndex)
 return the object, if not existent it creates it. More...
 
- Protected Member Functions inherited from cppu::ImplHelper10< class Ifc1, class Ifc2, class Ifc3, class Ifc4, class Ifc5, class Ifc6, class Ifc7, class Ifc8, class Ifc9, class Ifc10 >
 ~ImplHelper10 () SAL_NOEXCEPT
 

Protected Attributes

::std::unique_ptr< IObjectCollectionm_pElements
 
::comphelper::OInterfaceContainerHelper3< css::container::XContainerListener > m_aContainerListeners
 
::comphelper::OInterfaceContainerHelper3< css::util::XRefreshListener > m_aRefreshListeners
 
::cppu::OWeakObjectm_rParent
 
::osl::Mutex & m_rMutex
 
bool m_bUseIndexOnly
 

Private Member Functions

void notifyElementRemoved (const OUString &_sName)
 
void disposeElements ()
 
void dropImpl (sal_Int32 _nIndex, bool _bReallyDrop=true)
 

Detailed Description

Definition at line 87 of file VCollection.hxx.

Constructor & Destructor Documentation

◆ OCollection()

OCollection::OCollection ( ::cppu::OWeakObject _rParent,
bool  _bCase,
::osl::Mutex &  _rMutex,
const ::std::vector< OUString > &  _rVector,
bool  _bUseIndexOnly = false,
bool  _bUseHardRef = true 
)
protected

Definition at line 221 of file VCollection.cxx.

References reFill().

◆ ~OCollection()

OCollection::~OCollection ( )
virtual

Definition at line 244 of file VCollection.cxx.

Member Function Documentation

◆ acquire()

void SAL_CALL OCollection::acquire ( )
overridevirtualnoexcept

Definition at line 461 of file VCollection.cxx.

References cppu::OWeakObject::acquire(), and m_rParent.

◆ addContainerListener()

void SAL_CALL OCollection::addContainerListener ( const css::uno::Reference< css::container::XContainerListener > &  xListener)
overridevirtual

◆ addRefreshListener()

void SAL_CALL OCollection::addRefreshListener ( const css::uno::Reference< css::util::XRefreshListener > &  l)
overridevirtual

◆ appendByDescriptor()

void SAL_CALL OCollection::appendByDescriptor ( const css::uno::Reference< css::beans::XPropertySet > &  descriptor)
overridevirtual

◆ appendObject()

ObjectType OCollection::appendObject ( const OUString &  _rForName,
const css::uno::Reference< css::beans::XPropertySet > &  descriptor 
)
protectedvirtual

appends an object described by a descriptor, under a given name

Parameters
_rForNameis the name under which the object should be appended. Guaranteed to not be empty. This is passed for convenience only, since it's the result of a call of getNameForObject for the given descriptor
descriptordescribes the object to append
Returns
the new object which is to be inserted into the collection. This might be the result of a call of createObject( _rForName ), or a clone of the descriptor.

Reimplemented in connectivity::firebird::Views, connectivity::mysqlc::Views, connectivity::ado::OColumns, connectivity::ado::OGroups, connectivity::ado::OIndexes, connectivity::ado::OKeys, connectivity::ado::OTables, connectivity::ado::OUsers, connectivity::ado::OViews, connectivity::dbase::ODbaseColumns, connectivity::dbase::ODbaseIndexColumns, connectivity::dbase::ODbaseIndexes, connectivity::dbase::ODbaseTables, connectivity::hsqldb::OTables, connectivity::hsqldb::OUsers, connectivity::hsqldb::HViews, connectivity::mysql::OTables, connectivity::mysql::OUsers, connectivity::mysql::OViews, connectivity::OColumnsHelper, connectivity::OIndexesHelper, connectivity::OKeysHelper, connectivity::firebird::Tables, connectivity::firebird::Users, and connectivity::mysqlc::Tables.

Definition at line 572 of file VCollection.cxx.

References cloneDescriptor().

Referenced by appendByDescriptor().

◆ clear_NoDispose()

void OCollection::clear_NoDispose ( )
protected

clear the name map

Does not dispose the objects hold by the collection.

Definition at line 278 of file VCollection.cxx.

References m_pElements, and m_rMutex.

◆ cloneDescriptor()

ObjectType OCollection::cloneDescriptor ( const ObjectType _descriptor)
protected

clones the given descriptor

The method calls createDescriptor to create a new, empty descriptor, and then copies all properties from _descriptor to the new object, which is returned.

This method might come handy in derived classes for implementing appendObject, when the object is not actually appended to any backend (e.g. for the columns collection of a descriptor object itself, where there is not yet a database backend to append the column to).

Definition at line 565 of file VCollection.cxx.

References createDescriptor().

Referenced by appendObject(), connectivity::dbase::ODbaseColumns::appendObject(), connectivity::dbase::ODbaseIndexColumns::appendObject(), connectivity::OColumnsHelper::appendObject(), connectivity::OIndexesHelper::appendObject(), and connectivity::OKeysHelper::appendObject().

◆ createDataDescriptor()

Reference< XPropertySet > SAL_CALL OCollection::createDataDescriptor ( )
overridevirtual

Definition at line 348 of file VCollection.cxx.

References createDescriptor(), and m_rMutex.

◆ createDescriptor()

Reference< XPropertySet > OCollection::createDescriptor ( )
protectedvirtual

◆ createEnumeration()

Reference< XEnumeration > SAL_CALL OCollection::createEnumeration ( )
overridevirtual

Definition at line 444 of file VCollection.cxx.

References m_rMutex.

◆ createObject()

virtual ObjectType connectivity::sdbcx::OCollection::createObject ( const OUString &  _rName)
protectedpure virtual

◆ DECLARE_SERVICE_INFO()

connectivity::sdbcx::OCollection::DECLARE_SERVICE_INFO ( )

◆ disposeElements()

void OCollection::disposeElements ( )
private

Definition at line 554 of file VCollection.cxx.

References m_pElements.

Referenced by disposing(), and refresh().

◆ disposing()

void OCollection::disposing ( )
virtual

◆ dropByIndex()

void SAL_CALL OCollection::dropByIndex ( sal_Int32  index)
overridevirtual

Definition at line 402 of file VCollection.cxx.

References dropImpl(), getCount(), index, and m_rMutex.

◆ dropByName()

void SAL_CALL OCollection::dropByName ( const OUString &  elementName)
overridevirtual

◆ dropImpl()

void OCollection::dropImpl ( sal_Int32  _nIndex,
bool  _bReallyDrop = true 
)
private

Definition at line 411 of file VCollection.cxx.

References dropObject(), m_pElements, and notifyElementRemoved().

Referenced by dropByIndex(), dropByName(), and getObject().

◆ dropObject()

void OCollection::dropObject ( sal_Int32  _nPos,
const OUString &  _sElementName 
)
protectedvirtual

◆ findColumn()

sal_Int32 SAL_CALL OCollection::findColumn ( const OUString &  columnName)
overridevirtual

◆ getByIndex()

Any SAL_CALL OCollection::getByIndex ( sal_Int32  Index)
overridevirtual

Definition at line 299 of file VCollection.cxx.

References Any, getObject(), m_pElements, and m_rMutex.

◆ getByName()

Any SAL_CALL OCollection::getByName ( const OUString &  aName)
overridevirtual

◆ getCount()

sal_Int32 SAL_CALL OCollection::getCount ( )
overridevirtual

Definition at line 482 of file VCollection.cxx.

References m_pElements, and m_rMutex.

Referenced by dropByIndex().

◆ getElementNames()

Sequence< OUString > SAL_CALL OCollection::getElementNames ( )
overridevirtual

Definition at line 325 of file VCollection.cxx.

References m_pElements, and m_rMutex.

◆ getElementType()

Type SAL_CALL OCollection::getElementType ( )
overridevirtual

Definition at line 471 of file VCollection.cxx.

References cppu::UnoType< typename T >::get().

◆ getNameForObject()

OUString OCollection::getNameForObject ( const ObjectType _xObject)
protectedvirtual

returns the name for the object.

The default implementation ask for the property NAME. If this doesn't satisfy, it has to be overridden.

Parameters
_xObjectThe object where the name should be extracted.
Returns
The name of the object.

Reimplemented in connectivity::mysqlc::Tables, connectivity::hsqldb::OTables, and connectivity::mysql::OTables.

Definition at line 355 of file VCollection.cxx.

References connectivity::OMetaConnection::getPropMap(), PROPERTY_ID_NAME, and sName.

Referenced by appendByDescriptor().

◆ getObject()

ObjectType OCollection::getObject ( sal_Int32  _nIndex)
protected

◆ getTypes()

Sequence< Type > SAL_CALL OCollection::getTypes ( )
overridevirtual

◆ hasByName()

sal_Bool SAL_CALL OCollection::hasByName ( const OUString &  aName)
overridevirtual

◆ hasElements()

sal_Bool SAL_CALL OCollection::hasElements ( )
overridevirtual

Definition at line 476 of file VCollection.cxx.

References m_pElements, and m_rMutex.

◆ impl_refresh()

virtual void connectivity::sdbcx::OCollection::impl_refresh ( )
protectedpure virtual

◆ insertElement()

void OCollection::insertElement ( const OUString &  _sElementName,
const ObjectType _xElement 
)
protected

insert a new element into the collection

Definition at line 504 of file VCollection.cxx.

References m_pElements.

Referenced by connectivity::firebird::Tables::appendNew(), connectivity::ado::OTables::appendNew(), and connectivity::hsqldb::OTables::appendNew().

◆ isCaseSensitive()

bool connectivity::sdbcx::OCollection::isCaseSensitive ( ) const
inline

◆ notifyElementRemoved()

void OCollection::notifyElementRemoved ( const OUString &  _sName)
private

◆ queryInterface()

Any SAL_CALL OCollection::queryInterface ( const css::uno::Type &  rType)
overridevirtual

◆ reFill()

void OCollection::reFill ( const ::std::vector< OUString > &  _rVector)

Definition at line 342 of file VCollection.cxx.

References m_pElements.

Referenced by OCollection().

◆ refresh()

void SAL_CALL OCollection::refresh ( )
overridevirtual

◆ release()

void SAL_CALL OCollection::release ( )
overridevirtualnoexcept

Definition at line 466 of file VCollection.cxx.

References m_rParent, and cppu::OWeakObject::release().

◆ removeContainerListener()

void SAL_CALL OCollection::removeContainerListener ( const css::uno::Reference< css::container::XContainerListener > &  xListener)
overridevirtual

◆ removeRefreshListener()

void SAL_CALL OCollection::removeRefreshListener ( const css::uno::Reference< css::util::XRefreshListener > &  l)
overridevirtual

◆ renameObject()

void OCollection::renameObject ( const OUString &  _sOldName,
const OUString &  _sNewName 
)

Member Data Documentation

◆ m_aContainerListeners

::comphelper::OInterfaceContainerHelper3<css::container::XContainerListener> connectivity::sdbcx::OCollection::m_aContainerListeners
protected

◆ m_aRefreshListeners

::comphelper::OInterfaceContainerHelper3<css::util::XRefreshListener> connectivity::sdbcx::OCollection::m_aRefreshListeners
protected

Definition at line 94 of file VCollection.hxx.

Referenced by addRefreshListener(), disposing(), refresh(), and removeRefreshListener().

◆ m_bUseIndexOnly

bool connectivity::sdbcx::OCollection::m_bUseIndexOnly
protected

Definition at line 99 of file VCollection.hxx.

Referenced by getTypes(), and queryInterface().

◆ m_pElements

::std::unique_ptr<IObjectCollection> connectivity::sdbcx::OCollection::m_pElements
protected

◆ m_rMutex

::osl::Mutex& connectivity::sdbcx::OCollection::m_rMutex
protected

◆ m_rParent

::cppu::OWeakObject& connectivity::sdbcx::OCollection::m_rParent
protected

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