summaryrefslogtreecommitdiff
path: root/comphelper
diff options
context:
space:
mode:
authorRüdiger Timm <rt@openoffice.org>2008-01-30 08:34:45 +0000
committerRüdiger Timm <rt@openoffice.org>2008-01-30 08:34:45 +0000
commit48d64f3c5deb44008a3ceffff360c210bf596a91 (patch)
treea07c5e8447c79f25c2dc7a8e2b2a5e5be5c07093 /comphelper
parent7a8df6f0ae7ef72250551199d75ba9e47979f976 (diff)
INTEGRATION: CWS dba24d (1.5.58); FILE MERGED
2007/11/22 13:03:25 fs 1.5.58.1: #i81658# +OLegacySingleRegistration
Diffstat (limited to 'comphelper')
-rw-r--r--comphelper/inc/comphelper/componentmodule.hxx43
1 files changed, 39 insertions, 4 deletions
diff --git a/comphelper/inc/comphelper/componentmodule.hxx b/comphelper/inc/comphelper/componentmodule.hxx
index 5fa19bbf5819..f6853288219e 100644
--- a/comphelper/inc/comphelper/componentmodule.hxx
+++ b/comphelper/inc/comphelper/componentmodule.hxx
@@ -4,9 +4,9 @@
*
* $RCSfile: componentmodule.hxx,v $
*
- * $Revision: 1.5 $
+ * $Revision: 1.6 $
*
- * last change: $Author: hr $ $Date: 2007-06-27 14:53:24 $
+ * last change: $Author: rt $ $Date: 2008-01-30 09:34:45 $
*
* The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1.
@@ -35,9 +35,8 @@
#ifndef COMPHELPER_INC_COMPHELPER_COMPONENTMODULE_HXX
#define COMPHELPER_INC_COMPHELPER_COMPONENTMODULE_HXX
-#ifndef INCLUDED_COMPHELPERDLLAPI_H
#include <comphelper/comphelperdllapi.h>
-#endif
+#include <comphelper/legacysingletonfactory.hxx>
/** === begin UNO includes === **/
#ifndef _COM_SUN_STAR_LANG_XMULTISERVICEFACTORY_HPP_
@@ -298,6 +297,7 @@ namespace comphelper
};
template <class TYPE>
+ //--------------------------------------------------------------------------
OSingletonRegistration<TYPE>::OSingletonRegistration( OModule& _rModule )
{
_rModule.registerImplementation( ComponentDescription(
@@ -310,6 +310,29 @@ namespace comphelper
}
//==========================================================================
+ //= OLegacySingletonRegistration
+ //==========================================================================
+ template <class TYPE>
+ class OLegacySingletonRegistration
+ {
+ public:
+ OLegacySingletonRegistration( OModule& _rModule );
+ };
+
+ //--------------------------------------------------------------------------
+ template <class TYPE>
+ OLegacySingletonRegistration<TYPE>::OLegacySingletonRegistration( OModule& _rModule )
+ {
+ _rModule.registerImplementation( ComponentDescription(
+ TYPE::getImplementationName_static(),
+ TYPE::getSupportedServiceNames_static(),
+ ::rtl::OUString(),
+ &TYPE::Create,
+ &::comphelper::createLegacySingletonFactory
+ ) );
+ }
+
+ //==========================================================================
//= helpers
//==========================================================================
@@ -366,6 +389,18 @@ namespace comphelper
{ \
} \
}; \
+ /* -------------------------------------------------------------------- */ \
+ template < class TYPE > \
+ class OLegacySingletonRegistration : public ::comphelper::OLegacySingletonRegistration< TYPE > \
+ { \
+ private: \
+ typedef ::comphelper::OLegacySingletonRegistration< TYPE > BaseClass; \
+ \
+ public: \
+ OLegacySingletonRegistration() : BaseClass( ModuleClass::getInstance() ) \
+ { \
+ } \
+ }; \
//==========================================================================
//= implementing a OModule for a component library