LibreOffice Module filter (master) 1
|
implements the interface css::container::XNameContainer on top of a FilterCache reference. More...
#include <basecontainer.hxx>
Public Member Functions | |
BaseContainer () | |
standard ctor. More... | |
virtual | ~BaseContainer () override |
standard dtor. More... | |
void | init (const OUString &sImplementationName, const css::uno::Sequence< OUString > &lServiceNames, FilterCache::EItemType eType) |
initialize this generic instance with some specialized values from our derived object. More... | |
virtual OUString SAL_CALL | getImplementationName () override |
virtual sal_Bool SAL_CALL | supportsService (const OUString &sServiceName) override |
virtual css::uno::Sequence< OUString > SAL_CALL | getSupportedServiceNames () override |
virtual void SAL_CALL | insertByName (const OUString &sItem, const css::uno::Any &aValue) override |
virtual void SAL_CALL | removeByName (const OUString &sItem) override |
virtual void SAL_CALL | replaceByName (const OUString &sItem, const css::uno::Any &aValue) override |
virtual css::uno::Any SAL_CALL | getByName (const OUString &sItem) override |
virtual css::uno::Sequence< OUString > SAL_CALL | getElementNames () override |
virtual sal_Bool SAL_CALL | hasByName (const OUString &sItem) override |
virtual css::uno::Type SAL_CALL | getElementType () override |
virtual sal_Bool SAL_CALL | hasElements () override |
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL | createSubSetEnumerationByQuery (const OUString &sQuery) override |
virtual css::uno::Reference< css::container::XEnumeration > SAL_CALL | createSubSetEnumerationByProperties (const css::uno::Sequence< css::beans::NamedValue > &lProperties) override |
virtual void SAL_CALL | flush () override |
virtual void SAL_CALL | addFlushListener (const css::uno::Reference< css::util::XFlushListener > &xListener) override |
virtual void SAL_CALL | removeFlushListener (const css::uno::Reference< css::util::XFlushListener > &xListener) override |
Protected Member Functions | |
void | impl_loadOnDemand (std::unique_lock< std::mutex > &rGuard) |
check if the underlying configuration data was already loaded and do it if necessary automatically. More... | |
void | impl_initFlushMode (std::unique_lock< std::mutex > &rGuard) |
it creates the global instance m_pFilterCache, which is a copy of the global instance m_rCache, and will be used to change the configuration. More... | |
FilterCache * | impl_getWorkingCache (std::unique_lock< std::mutex > &rGuard) const |
returns a pointer to the current used cache member. More... | |
Protected Attributes | |
std::mutex | m_aMutex |
OUString | m_sImplementationName |
the implementation name of our derived class, which we provide at the interface XServiceInfo of our class... More... | |
css::uno::Sequence< OUString > | m_lServiceNames |
the list of supported uno service names of our derived class, which we provide at the interface XServiceInfo of our class... More... | |
std::unique_ptr< FilterCache > | m_pFlushCache |
local filter cache, which is used to collect changes on the filter configuration first and flush it later. More... | |
FilterCache::EItemType | m_eType |
specify, which sub container of the used filter cache must be wrapped by this container interface. More... | |
comphelper::OInterfaceContainerHelper4< css::util::XFlushListener > | m_lListener |
holds all listener, which are registered at this instance. More... | |
implements the interface css::container::XNameContainer on top of a FilterCache reference.
@descr This class can be used as base for own service implementations, which must provide read/write access to the filter configuration. Parameters regulate read/write access, which sub set of information should be available etc.
Definition at line 52 of file basecontainer.hxx.
filter::config::BaseContainer::BaseContainer | ( | ) |
standard ctor.
@descr Because mostly this class is used as base class for own service implementations in combination with an ImplInheritanceHelper template... there is no way to provide some initializing data through the ctor :-( This base class will be created inside its default ctor and must be initialized with its needed parameters explicitly by calling: "init()".
Definition at line 32 of file basecontainer.cxx.
References filter::config::FilterCache::E_CONTAINS_STANDARD, filter::config::GetTheFilterCache(), filter::config::FilterCache::load(), and m_eType.
|
overridevirtual |
standard dtor.
Definition at line 39 of file basecontainer.cxx.
|
overridevirtual |
Definition at line 418 of file basecontainer.cxx.
References comphelper::OInterfaceContainerHelper4< class ListenerT >::addInterface(), m_aMutex, and m_lListener.
|
overridevirtual |
Definition at line 336 of file basecontainer.cxx.
References filter::config::FilterCache::getMatchingItemsByProps(), impl_getWorkingCache(), impl_loadOnDemand(), m_aMutex, and m_eType.
Referenced by filter::config::ContentHandlerFactory::createSubSetEnumerationByProperties(), and filter::config::FrameLoaderFactory::createSubSetEnumerationByProperties().
|
overridevirtual |
Definition at line 328 of file basecontainer.cxx.
Referenced by filter::config::ContentHandlerFactory::createSubSetEnumerationByQuery(), and filter::config::FrameLoaderFactory::createSubSetEnumerationByQuery().
|
overridevirtual |
Definition at line 375 of file basecontainer.cxx.
References ex, filter::config::GetTheFilterCache(), m_aMutex, m_lListener, m_pFlushCache, comphelper::OInterfaceContainerHelper4< class ListenerT >::notifyEach(), and filter::config::FilterCache::takeOver().
|
overridevirtual |
Definition at line 208 of file basecontainer.cxx.
References filter::config::FilterCache::getItemWithStateProps(), impl_getWorkingCache(), impl_loadOnDemand(), m_aMutex, and m_eType.
Referenced by filter::config::ContentHandlerFactory::getByName(), and filter::config::FrameLoaderFactory::getByName().
|
overridevirtual |
Definition at line 241 of file basecontainer.cxx.
References comphelper::containerToSequence(), filter::config::FilterCache::getItemNames(), impl_getWorkingCache(), impl_loadOnDemand(), m_aMutex, and m_eType.
Referenced by filter::config::ContentHandlerFactory::getAvailableServiceNames(), filter::config::FrameLoaderFactory::getAvailableServiceNames(), filter::config::ContentHandlerFactory::getElementNames(), and filter::config::FrameLoaderFactory::getElementNames().
|
overridevirtual |
Definition at line 294 of file basecontainer.cxx.
Referenced by filter::config::ContentHandlerFactory::getElementType(), and filter::config::FrameLoaderFactory::getElementType().
|
overridevirtual |
Definition at line 107 of file basecontainer.cxx.
References m_sImplementationName.
|
overridevirtual |
Definition at line 118 of file basecontainer.cxx.
References m_lServiceNames.
|
overridevirtual |
Definition at line 268 of file basecontainer.cxx.
References filter::config::FilterCache::hasItem(), impl_getWorkingCache(), impl_loadOnDemand(), m_aMutex, and m_eType.
Referenced by filter::config::ContentHandlerFactory::hasByName(), and filter::config::FrameLoaderFactory::hasByName().
|
overridevirtual |
Definition at line 302 of file basecontainer.cxx.
References filter::config::FilterCache::hasItems(), impl_getWorkingCache(), impl_loadOnDemand(), m_aMutex, and m_eType.
Referenced by filter::config::ContentHandlerFactory::hasElements(), and filter::config::FrameLoaderFactory::hasElements().
|
protected |
returns a pointer to the current used cache member.
@descr It's a point to the FilterCache instance behind m_pFlushCache or m_rCache.
Use:
Guard aLock(m_aLock); FilterCache* p = impl_getWorkingCache(); p->doSomething(); aLock.clear();
after this point p can't b e guaranteed any longer!
Definition at line 98 of file basecontainer.cxx.
References filter::config::GetTheFilterCache(), and m_pFlushCache.
Referenced by createSubSetEnumerationByProperties(), getByName(), getElementNames(), hasByName(), hasElements(), insertByName(), removeByName(), and replaceByName().
|
protected |
it creates the global instance m_pFilterCache, which is a copy of the global instance m_rCache, and will be used to change the configuration.
@descr If no exception occurs, its guaranteed, that the member m_rFlushCache was initialized right and can be used further.
css::uno::RuntimeException |
Definition at line 88 of file basecontainer.cxx.
References filter::config::FilterCache::clone(), filter::config::GetTheFilterCache(), and m_pFlushCache.
Referenced by insertByName(), removeByName(), and replaceByName().
|
protected |
check if the underlying configuration data was already loaded and do it if necessary automatically.
Definition at line 58 of file basecontainer.cxx.
References filter::config::FilterCache::E_CONTAINS_CONTENTHANDLERS, filter::config::FilterCache::E_CONTAINS_FILTERS, filter::config::FilterCache::E_CONTAINS_FRAMELOADERS, filter::config::FilterCache::E_CONTAINS_NOTHING, filter::config::FilterCache::E_CONTAINS_TYPES, filter::config::FilterCache::E_CONTENTHANDLER, filter::config::FilterCache::E_FILTER, filter::config::FilterCache::E_FRAMELOADER, filter::config::FilterCache::E_TYPE, filter::config::GetTheFilterCache(), filter::config::FilterCache::load(), and m_eType.
Referenced by createSubSetEnumerationByProperties(), getByName(), getElementNames(), hasByName(), hasElements(), insertByName(), removeByName(), and replaceByName().
void filter::config::BaseContainer::init | ( | const OUString & | sImplementationName, |
const css::uno::Sequence< OUString > & | lServiceNames, | ||
FilterCache::EItemType | eType | ||
) |
initialize this generic instance with some specialized values from our derived object.
@descr Because an outside class must use ImplInheritanceHelper template to use us a base class... and there is no way to pass such initializing parameters through a required default ctor... we must be initialized by this special method. Of course this method must be called first before any other interface method is used.
rxContext | reference to the uno service manager, which created this service instance. |
sImplementationName | the implementation name of our derived class, which we provide at the interface XServiceInfo of our class... |
lServiceNames | the list of supported uno service names of our derived class, which we provide at the interface XServiceInfo of our class... |
eType | specify, which sub container of the used filter cache must be wrapped by this container interface. |
Definition at line 44 of file basecontainer.cxx.
References eType, m_aMutex, m_eType, m_lServiceNames, m_sImplementationName, and sImplementationName.
Referenced by filter::config::ContentHandlerFactory::ContentHandlerFactory(), filter::config::FilterFactory::FilterFactory(), filter::config::FrameLoaderFactory::FrameLoaderFactory(), and filter::config::TypeDetection::TypeDetection().
|
overridevirtual |
Definition at line 124 of file basecontainer.cxx.
References ex, filter::config::FilterCache::hasItem(), impl_getWorkingCache(), impl_initFlushMode(), impl_loadOnDemand(), m_aMutex, m_eType, and filter::config::FilterCache::setItem().
|
overridevirtual |
Definition at line 158 of file basecontainer.cxx.
References impl_getWorkingCache(), impl_initFlushMode(), impl_loadOnDemand(), m_aMutex, m_eType, and filter::config::FilterCache::removeItem().
|
overridevirtual |
Definition at line 425 of file basecontainer.cxx.
References m_aMutex, m_lListener, and comphelper::OInterfaceContainerHelper4< class ListenerT >::removeInterface().
|
overridevirtual |
Definition at line 174 of file basecontainer.cxx.
References ex, filter::config::FilterCache::hasItem(), impl_getWorkingCache(), impl_initFlushMode(), impl_loadOnDemand(), m_aMutex, m_eType, and filter::config::FilterCache::setItem().
|
overridevirtual |
Definition at line 113 of file basecontainer.cxx.
References sServiceName, and cppu::supportsService().
|
mutableprotected |
Definition at line 61 of file basecontainer.hxx.
Referenced by addFlushListener(), createSubSetEnumerationByProperties(), flush(), getByName(), getElementNames(), hasByName(), hasElements(), init(), insertByName(), removeByName(), removeFlushListener(), and replaceByName().
|
protected |
specify, which sub container of the used filter cache must be wrapped by this container interface.
Definition at line 90 of file basecontainer.hxx.
Referenced by createSubSetEnumerationByProperties(), getByName(), getElementNames(), hasByName(), hasElements(), impl_loadOnDemand(), init(), insertByName(), removeByName(), and replaceByName().
|
protected |
holds all listener, which are registered at this instance.
Definition at line 93 of file basecontainer.hxx.
Referenced by addFlushListener(), flush(), and removeFlushListener().
|
protected |
the list of supported uno service names of our derived class, which we provide at the interface XServiceInfo of our class...
Definition at line 69 of file basecontainer.hxx.
Referenced by getSupportedServiceNames(), and init().
|
protected |
local filter cache, which is used to collect changes on the filter configuration first and flush it later.
@descr Normally this member isn't used nor initialized. That's true, if this container is used for reading only. The first write access (e.g. by calling insertByName()) creates a copy of the current global cache m_rCache to initialize the m_pFlushCache member.
Afterwards only the flush cache copy is used. Inside flush() this copy will be removed and m_rCache can be used again.
m_pFlushCache and m_rCache must not be synchronized manually here. m_rCache listen on the global configuration, where m_pFlushCache write its data. m_rCache update itself automatically.
Definition at line 86 of file basecontainer.hxx.
Referenced by flush(), impl_getWorkingCache(), and impl_initFlushMode().
|
protected |
the implementation name of our derived class, which we provide at the interface XServiceInfo of our class...
Definition at line 65 of file basecontainer.hxx.
Referenced by getImplementationName(), and init().