diff options
author | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-23 13:44:27 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2017-07-23 21:11:32 +0200 |
commit | 4bb2bca091ffa0cc8a5f4a850eef146bb66feaa0 (patch) | |
tree | e5cbebaf295f857d73ac73a1d3ea9f542961b898 /include | |
parent | 3c077e587d36170be53bad90bd5c87364295426c (diff) |
remove now unnecessary comphelper::OModuleClient stuff
after the great gettext migration of 2017
Change-Id: I704389b1ae1fb34dae0429c98cbfc89c2d3b8e27
Reviewed-on: https://gerrit.libreoffice.org/40322
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'include')
-rw-r--r-- | include/comphelper/componentmodule.hxx | 31 | ||||
-rw-r--r-- | include/unotools/componentresmodule.hxx | 73 |
2 files changed, 0 insertions, 104 deletions
diff --git a/include/comphelper/componentmodule.hxx b/include/comphelper/componentmodule.hxx index 05626ebaecee..9cb07461ce7d 100644 --- a/include/comphelper/componentmodule.hxx +++ b/include/comphelper/componentmodule.hxx @@ -82,7 +82,6 @@ namespace comphelper class COMPHELPER_DLLPUBLIC OModule { private: - oslInterlockedCount m_nClients; /// number of registered clients std::unique_ptr<OModuleImpl> m_pImpl; /// impl class. lives as long as at least one client for the module is registered protected: @@ -126,42 +125,12 @@ namespace comphelper */ void* getComponentFactory( const sal_Char* _pImplementationName ); - public: - class ClientAccess { friend class OModuleClient; private: ClientAccess() { } }; - /// register a client for the module - void registerClient( ClientAccess ); - /// revoke a client for the module - void revokeClient( ClientAccess ); - - protected: - - /** called when the last client has been revoked - @precond - <member>m_aMutex</member> is locked - */ - virtual void onLastClient(); - private: OModule( const OModule& ) = delete; OModule& operator=( const OModule& ) = delete; }; - //= OModuleClient - - /** base class for objects which uses any global module-specific resources - */ - class COMPHELPER_DLLPUBLIC OModuleClient - { - protected: - OModule& m_rModule; - - public: - OModuleClient( OModule& _rModule ) :m_rModule( _rModule ) { m_rModule.registerClient( OModule::ClientAccess() ); } - ~OModuleClient() { m_rModule.revokeClient( OModule::ClientAccess() ); } - }; - - //= OAutoRegistration template <class TYPE> diff --git a/include/unotools/componentresmodule.hxx b/include/unotools/componentresmodule.hxx index 127954d7dfb9..ee19e99f53b0 100644 --- a/include/unotools/componentresmodule.hxx +++ b/include/unotools/componentresmodule.hxx @@ -31,8 +31,6 @@ namespace utl class OComponentResModuleImpl; - //= OComponentResourceModule - /** extends the comphelper::OModule implementation with simply resource access */ @@ -52,77 +50,6 @@ namespace utl const std::locale& getResLocale(); }; - //= defining a concrete module - -#define DEFINE_MODULE( ModuleClass, ClientClass ) \ - /* -------------------------------------------------------------------- */ \ - class ModuleClass : public ::utl::OComponentResourceModule \ - { \ - friend struct CreateModuleClass; \ - typedef ::utl::OComponentResourceModule BaseClass; \ - \ - public: \ - static ModuleClass& getInstance(); \ - \ - private: \ - ModuleClass(); \ - }; \ - \ - /* -------------------------------------------------------------------- */ \ - class ClientClass : public ::comphelper::OModuleClient \ - { \ - private: \ - typedef ::comphelper::OModuleClient BaseClass; \ - \ - public: \ - ClientClass() : BaseClass( ModuleClass::getInstance() ) \ - { \ - } \ - }; \ - \ - /* -------------------------------------------------------------------- */ \ - template < class TYPE > \ - class OAutoRegistration : public ::comphelper::OAutoRegistration< TYPE > \ - { \ - private: \ - typedef ::comphelper::OAutoRegistration< TYPE > BaseClass; \ - \ - public: \ - OAutoRegistration() : BaseClass( ModuleClass::getInstance() ) \ - { \ - } \ - }; - - //= implementing a concrete module - -#define IMPLEMENT_MODULE( ModuleClass, resprefix ) \ - struct CreateModuleClass \ - { \ - ModuleClass* operator()() \ - { \ - static ModuleClass* pModule = new ModuleClass; \ - return pModule; \ - /* yes, in theory, this is a resource leak, since the ModuleClass \ - will never be cleaned up. However, using a non-heap instance of ModuleClass \ - would not work: It would be cleaned up when the module is unloaded. \ - This might happen (and is likely to happen) *after* the tools-library \ - has been unloaded. However, the module's dtor is where we would delete \ - our resource manager (in case not all our clients de-registered) - which \ - would call into the already-unloaded tools-library. */ \ - } \ - }; \ - \ - ModuleClass::ModuleClass() \ - :BaseClass( OString( resprefix ), Application::GetSettings().GetUILanguageTag() ) \ - { \ - } \ - \ - ModuleClass& ModuleClass::getInstance() \ - { \ - return *rtl_Instance< ModuleClass, CreateModuleClass, ::osl::MutexGuard, ::osl::GetGlobalMutex >:: \ - create( CreateModuleClass(), ::osl::GetGlobalMutex() ); \ - } \ - } // namespace utl #endif // INCLUDED_UNOTOOLS_COMPONENTRESMODULE_HXX |