Kaydet (Commit) 48d64f3c authored tarafından Rüdiger Timm's avatar Rüdiger Timm

INTEGRATION: CWS dba24d (1.5.58); FILE MERGED

2007/11/22 13:03:25 fs 1.5.58.1: #i81658# +OLegacySingleRegistration
üst 7a8df6f0
......@@ -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(
......@@ -309,6 +309,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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment