LibreOffice Module salhelper (master) 1
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
salhelper::ORealDynamicLoader Class Reference

The ORealDynamicLoader is an implementation helper class for the template loader ODynamicLoader. More...

#include <dynload.hxx>

Collaboration diagram for salhelper::ORealDynamicLoader:
[legend]

Public Member Functions

sal_uInt32 SAL_CALL acquire ()
 increase the reference count. More...
 
sal_uInt32 SAL_CALL release ()
 decrease the reference count and delete the last instance. More...
 
void *SAL_CALL getApi () const
 returns a pointer to the initialized API function structure. More...
 

Static Public Member Functions

static ORealDynamicLoader *SAL_CALL newInstance (ORealDynamicLoader **ppSetToZeroInDestructor, const ::rtl::OUString &strModuleName, const ::rtl::OUString &strInitFunction)
 initializes the loader, loads the library and call the initialization function. More...
 

Protected Member Functions

 ORealDynamicLoader (ORealDynamicLoader **ppSetToZeroInDestructor, const ::rtl::OUString &strModuleName, const ::rtl::OUString &strInitFunction, void *pApi, oslModule pModule)
 Constructor. More...
 
virtual ~ORealDynamicLoader ()
 Destructor, try to unload the library. More...
 

Protected Attributes

void * m_pApi
 points to the structure with the initialized API function pointers. More...
 
sal_uInt32 m_refCount
 stores the reference count. More...
 
oslModule m_pModule
 stores the library handle. More...
 
::rtl::OUString m_strModuleName
 stores the library name. More...
 
::rtl::OUString m_strInitFunction
 stores the name of the initialization function. More...
 
ORealDynamicLoader ** ppSetToZeroInDestructor
 stores a pointer to itself, which must be reset in the destructor to signal that the loader is invalid. More...
 

Detailed Description

The ORealDynamicLoader is an implementation helper class for the template loader ODynamicLoader.

Definition at line 37 of file dynload.hxx.

Constructor & Destructor Documentation

◆ ORealDynamicLoader()

salhelper::ORealDynamicLoader::ORealDynamicLoader ( ORealDynamicLoader **  ppSetToZeroInDestructor,
const ::rtl::OUString &  strModuleName,
const ::rtl::OUString &  strInitFunction,
void *  pApi,
oslModule  pModule 
)
protected

Constructor.

Parameters
ppSetToZeroInDestructorpoints to the loader instance which must be set to NULL if the loader will be destroyed.
strModuleNamespecifies the library name.
strInitFunctionspecifies the name of the initialization function.
pApipoints to a structure with the initialized API function pointers.
pModulepoints to the loaded library handle.

Definition at line 27 of file dynload.cxx.

References m_refCount.

Referenced by newInstance().

◆ ~ORealDynamicLoader()

salhelper::ORealDynamicLoader::~ORealDynamicLoader ( )
protectedvirtual

Destructor, try to unload the library.

Definition at line 76 of file dynload.cxx.

References m_pModule, and ppSetToZeroInDestructor.

Member Function Documentation

◆ acquire()

sal_uInt32 salhelper::ORealDynamicLoader::acquire ( )

increase the reference count.

Definition at line 91 of file dynload.cxx.

References m_refCount.

Referenced by salhelper::ODynamicLoader< API >::ODynamicLoader(), and salhelper::ODynamicLoader< API >::operator=().

◆ getApi()

void * salhelper::ORealDynamicLoader::getApi ( ) const

returns a pointer to the initialized API function structure.

Definition at line 105 of file dynload.cxx.

References m_pApi.

Referenced by salhelper::ODynamicLoader< API >::getApi(), and salhelper::ODynamicLoader< API >::operator->().

◆ newInstance()

ORealDynamicLoader * salhelper::ORealDynamicLoader::newInstance ( ORealDynamicLoader **  ppSetToZeroInDestructor,
const ::rtl::OUString &  strModuleName,
const ::rtl::OUString &  strInitFunction 
)
static

initializes the loader, loads the library and call the initialization function.

Parameters
ppSetToZeroInDestructorpoints to the loader instance which must be set to NULL if the loader will be destroyed.
strModuleNamespecifies the library name.
strInitFunctionspecifies the name of the initialization function.

Definition at line 41 of file dynload.cxx.

References NULL, ORealDynamicLoader(), and ppSetToZeroInDestructor.

Referenced by salhelper::ODynamicLoader< API >::ODynamicLoader().

◆ release()

sal_uInt32 salhelper::ORealDynamicLoader::release ( )

decrease the reference count and delete the last instance.

Definition at line 96 of file dynload.cxx.

References m_refCount.

Referenced by salhelper::ODynamicLoader< API >::operator=(), and salhelper::ODynamicLoader< API >::~ODynamicLoader().

Member Data Documentation

◆ m_pApi

void* salhelper::ORealDynamicLoader::m_pApi
protected

points to the structure with the initialized API function pointers.

Definition at line 80 of file dynload.hxx.

Referenced by getApi().

◆ m_pModule

oslModule salhelper::ORealDynamicLoader::m_pModule
protected

stores the library handle.

Definition at line 84 of file dynload.hxx.

Referenced by ~ORealDynamicLoader().

◆ m_refCount

sal_uInt32 salhelper::ORealDynamicLoader::m_refCount
protected

stores the reference count.

Definition at line 82 of file dynload.hxx.

Referenced by acquire(), and release().

◆ m_strInitFunction

::rtl::OUString salhelper::ORealDynamicLoader::m_strInitFunction
protected

stores the name of the initialization function.

Definition at line 88 of file dynload.hxx.

◆ m_strModuleName

::rtl::OUString salhelper::ORealDynamicLoader::m_strModuleName
protected

stores the library name.

Definition at line 86 of file dynload.hxx.

◆ ppSetToZeroInDestructor

ORealDynamicLoader** salhelper::ORealDynamicLoader::ppSetToZeroInDestructor
protected

stores a pointer to itself, which must be reset in the destructor to signal that the loader is invalid.

Definition at line 92 of file dynload.hxx.

Referenced by newInstance(), and ~ORealDynamicLoader().


The documentation for this class was generated from the following files: