diff options
author | Vladimir Glazounov <vg@openoffice.org> | 2007-10-15 11:27:25 +0000 |
---|---|---|
committer | Vladimir Glazounov <vg@openoffice.org> | 2007-10-15 11:27:25 +0000 |
commit | bcf9063e9660e9820c588fc0c7aee83a36f7e7d4 (patch) | |
tree | e96d2a76e26063485b14d893d37739970085637c /registry/inc | |
parent | d8e8de98b79e4444f8ac5b97e41dfad905d3e84a (diff) |
INTEGRATION: CWS sb71 (1.9.46); FILE MERGED
2007/06/22 09:34:22 sb 1.9.46.1: #i75466# Support for dynamic loading of the reg shared library has been dropped.
Diffstat (limited to 'registry/inc')
-rw-r--r-- | registry/inc/registry/reflwrit.hxx | 116 |
1 files changed, 14 insertions, 102 deletions
diff --git a/registry/inc/registry/reflwrit.hxx b/registry/inc/registry/reflwrit.hxx index 4ed2a596c3cc..a40a494bc49c 100644 --- a/registry/inc/registry/reflwrit.hxx +++ b/registry/inc/registry/reflwrit.hxx @@ -4,9 +4,9 @@ * * $RCSfile: reflwrit.hxx,v $ * - * $Revision: 1.9 $ + * $Revision: 1.10 $ * - * last change: $Author: rt $ $Date: 2005-09-09 05:12:41 $ + * last change: $Author: vg $ $Date: 2007-10-15 12:27:25 $ * * The Contents of this file are made available subject to * the terms of GNU Lesser General Public License Version 2.1. @@ -42,8 +42,8 @@ #ifndef _REGISTRY_REGTYPE_H_ #include <registry/regtype.h> #endif -#ifndef _SALHELPER_DYNLOAD_HXX_ -#include <salhelper/dynload.hxx> +#ifndef _RTL_USTRING_HXX_ +#include <rtl/ustring.hxx> #endif /// Implememetation handle @@ -51,7 +51,7 @@ typedef void* TypeWriterImpl; /**************************************************************************** - C-Api for load on call + C-Api *****************************************************************************/ @@ -61,9 +61,7 @@ extern "C" { /** specifies a collection of function pointers which represents the complete registry type writer C-API. - The function pointers of this struct will be initialized when the library is loaded over - the load on call mechanism specified in 'salhelper/dynload.hxx'. This funtions pointers are - used by the C++ wrapper to call the C-API. + This funtions pointers are used by the C++ wrapper to call the C-API. */ struct RegistryTypeWriter_Api { @@ -83,54 +81,19 @@ struct RegistryTypeWriter_Api void (TYPEREG_CALLTYPE *setReferenceData) (TypeWriterImpl, sal_uInt16, rtl_uString*, RTReferenceType, rtl_uString*, RTFieldAccess); }; -/** specifies a function pointer of the initialization function which is called to initialize - the RegistryTypeWriter_Api struct. - - */ -typedef RegistryTypeWriter_Api* (TYPEREG_CALLTYPE *InitRegistryTypeWriter_Api)(void); - -/** spedifies the name of the API initialization function. - - This function will be searched by the load on call mechanism specified - in 'salhelper/dynload.hxx'. +/** the API initialization function. */ -#define REGISTRY_TYPE_WRITER_INIT_FUNCTION_NAME "initRegistryTypeWriter_Api" +RegistryTypeWriter_Api* TYPEREG_CALLTYPE initRegistryTypeWriter_Api(void); #ifdef __cplusplus } #endif - -/** The RegistryTypeWriterLoader provides a load on call mechanism for the library - used for the registry type writer api. - - Furthermore it provides a reference counter for the library. When the last reference will be - destroyed the RegisteryTypeWriterLoader will unload the library. If the library is loaded the loader - provides a valid Api for the type writer. - @see salhelper::ODynamicLoader<> -*/ -class RegistryTypeWriterLoader - : public ::salhelper::ODynamicLoader<RegistryTypeWriter_Api> -{ -public: - /// Default constructor, try to load the registry library and initialize the needed Api. - RegistryTypeWriterLoader() - : ::salhelper::ODynamicLoader<RegistryTypeWriter_Api> - (::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM( SAL_MODULENAME_WITH_VERSION( "reg", LIBRARY_VERSION ) ) ), - ::rtl::OUString( RTL_CONSTASCII_USTRINGPARAM(REGISTRY_TYPE_WRITER_INIT_FUNCTION_NAME) )) - {} - - /// Destructor, decrease the refcount and unload the library if the refcount is 0. - ~RegistryTypeWriterLoader() - {} -}; - - /** RegistryTypeWriter writes/creates a binary type blob. This class provides the necessary functions to write type informations for all kinds of types into a blob. - The class is inline and use a load on call C-Api. + The class is inline and use a C-Api. @deprecated use typereg::Writer instead @@ -139,32 +102,8 @@ class RegistryTypeWriter { public: - /** Constructor using the registry Api directly. - - The constructor is used if the api is known. - @param RTTypeClass specifies the type of the new blob. - @param typeName specifies the full qualified type name with '/' as separator. - @param superTypeName specifies the full qualified type name of the base type - with '/' as separator. - @param fieldCount specifies the number of fields (eg. number of attrbutes/properties, - enum values or constants). - @param methodCount specifies the number of methods. - @param referenceCount specifies the number of references (eg. number of supported interfaces, - exported services ...) - */ - inline RegistryTypeWriter(const RegistryTypeWriter_Api* pApi, - RTTypeClass RTTypeClass, - const ::rtl::OUString& typeName, - const ::rtl::OUString& superTypeName, - sal_uInt16 fieldCount, - sal_uInt16 methodCount, - sal_uInt16 referenceCount); - - /** Constructor using the loader mechanism. + /** Constructor. - This constructor is called with a RegistryTypeWriterLoader. - The RegistryTypeWriterLoader loads the needed DLL and provides the needed - Api for the registry type writer. @param RTTypeClass specifies the type of the new blob. @param typeName specifies the full qualified type name with '/' as separator. @param superTypeName specifies the full qualified type name of the base type @@ -175,8 +114,7 @@ public: @param referenceCount specifies the number of references (eg. number of supported interfaces, exported services ...) */ - inline RegistryTypeWriter(const RegistryTypeWriterLoader& rLoader, - RTTypeClass RTTypeClass, + inline RegistryTypeWriter(RTTypeClass RTTypeClass, const ::rtl::OUString& typeName, const ::rtl::OUString& superTypeName, sal_uInt16 fieldCount, @@ -305,46 +243,21 @@ protected: /// stores the registry type writer Api. const RegistryTypeWriter_Api* m_pApi; - /// stores the dynamic loader which is used to hold the library. - const ::salhelper::ODynamicLoader< RegistryTypeWriter_Api > m_Api; /// stores the handle of an implementation class TypeWriterImpl m_hImpl; }; -inline RegistryTypeWriter::RegistryTypeWriter(const RegistryTypeWriter_Api* pApi, - RTTypeClass RTTypeClass, - const ::rtl::OUString& typeName, - const ::rtl::OUString& superTypeName, - sal_uInt16 fieldCount, - sal_uInt16 methodCount, - sal_uInt16 referenceCount) - : m_pApi(pApi) - , m_Api() - , m_hImpl(NULL) -{ - m_hImpl = m_pApi->createEntry(RTTypeClass, - typeName.pData, - superTypeName.pData, - fieldCount, - methodCount, - referenceCount); -} - - -inline RegistryTypeWriter::RegistryTypeWriter(const RegistryTypeWriterLoader& rLoader, - RTTypeClass RTTypeClass, +inline RegistryTypeWriter::RegistryTypeWriter(RTTypeClass RTTypeClass, const ::rtl::OUString& typeName, const ::rtl::OUString& superTypeName, sal_uInt16 fieldCount, sal_uInt16 methodCount, sal_uInt16 referenceCount) - : m_pApi(NULL) - , m_Api(rLoader) + : m_pApi(initRegistryTypeWriter_Api()) , m_hImpl(NULL) { - m_pApi = m_Api.getApi(); m_hImpl = m_pApi->createEntry(RTTypeClass, typeName.pData, superTypeName.pData, @@ -356,10 +269,9 @@ inline RegistryTypeWriter::RegistryTypeWriter(const RegistryTypeWriterLoader& rL inline RegistryTypeWriter::RegistryTypeWriter(const RegistryTypeWriter& toCopy) : m_pApi(toCopy.m_pApi) - , m_Api(toCopy.m_Api) , m_hImpl(toCopy.m_hImpl) { - m_Api->acquire(m_hImpl); + m_pApi->acquire(m_hImpl); } inline RegistryTypeWriter::~RegistryTypeWriter() |