4 #ifndef INCLUDED_SALHELPER_DYNLOAD_HXX 5 #define INCLUDED_SALHELPER_DYNLOAD_HXX 29 const ::rtl::OUString& strModuleName,
30 const ::rtl::OUString& strInitFunction );
33 sal_uInt32 SAL_CALL acquire();
35 sal_uInt32 SAL_CALL release();
38 void* SAL_CALL getApi()
const;
51 const ::rtl::OUString& strModuleName,
52 const ::rtl::OUString& strInitFunction,
105 const ::rtl::OUString& strInitFunction )
107 if (!m_pStaticLoader)
116 m_pStaticLoader->acquire();
119 m_pLoader = m_pStaticLoader;
127 m_pLoader->acquire();
134 if (m_pLoader->release()==0)
135 m_pStaticLoader = NULL;
149 m_pLoader->release();
160 return static_cast<API*
>(m_pLoader->getApi());
166 return static_cast<API*
>(m_pLoader->getApi());
172 return (m_pLoader != NULL);
API * operator->() const
cast operator, which cast to a pointer with the initialized API function structure.
Definition: dynload.hxx:164
::rtl::OUString m_strInitFunction
stores the name of the initialization function.
Definition: dynload.hxx:68
~ODynamicLoader()
Destructor, decrease the reference count and unload the library if it is the last instance...
Definition: dynload.hxx:131
static ORealDynamicLoader * m_pStaticLoader
stores the real loader helper instance
Definition: dynload.hxx:177
ORealDynamicLoader * m_pLoader
Definition: dynload.hxx:178
static ORealDynamicLoader * newInstance(ORealDynamicLoader **ppSetToZeroInDestructor, const ::rtl::OUString &strModuleName, const ::rtl::OUString &strInitFunction)
initializes the loader, loads the library and call the initialization function.
::rtl::OUString m_strModuleName
stores the library name.
Definition: dynload.hxx:66
The ORealDynamicLoader is an implementation helper class for the template loader ODynamicLoader.
Definition: dynload.hxx:17
ODynamicLoader(const ::rtl::OUString &strModuleName, const ::rtl::OUString &strInitFunction)
Constructor, loads the library if necessary otherwise the reference count will be increased...
Definition: dynload.hxx:104
void * oslModule
Definition: module.h:39
oslModule m_pModule
stores the library handle.
Definition: dynload.hxx:64
This String class provides base functionality for C++ like Unicode character array handling...
Definition: ustring.hxx:183
#define SALHELPER_DLLPUBLIC
Definition: salhelperdllapi.h:12
API * getApi() const
returns a pointer to the initialized API function structure.
Definition: dynload.hxx:158
The ODynamicLoader provides a special load on call mechanism for dynamic libraries which support a C-...
Definition: dynload.hxx:89
ODynamicLoader(const ODynamicLoader< API > &toCopy)
Copy constructor.
Definition: dynload.hxx:123
ODynamicLoader()
Default constructor.
Definition: dynload.hxx:93
void * m_pApi
points to the structure with the initialized API function pointers.
Definition: dynload.hxx:60
Definition: condition.hxx:13
sal_uInt32 m_refCount
stores the reference count.
Definition: dynload.hxx:62
bool isLoaded() const
checks if the loader works on a loaded and initialized library.
Definition: dynload.hxx:170
ORealDynamicLoader ** ppSetToZeroInDestructor
stores a pointer to itself, which must be reset in the destructor to signal that the loader is invali...
Definition: dynload.hxx:72