/** The ORealDynamicLoader is an implementation helper class for the template loader ODynamicLoader.
*/ class SALHELPER_DLLPUBLIC ORealDynamicLoader
{ public: /** initializes the loader, loads the library and call the initialization function.
/// increase the reference count.
sal_uInt32 SAL_CALL acquire(); /// decrease the reference count and delete the last instance.
sal_uInt32 SAL_CALL release();
/// returns a pointer to the initialized API function structure. void* SAL_CALL getApi() const;
/// Destructor, try to unload the library. virtual ~ORealDynamicLoader();
/// points to the structure with the initialized API function pointers. void* m_pApi; /// stores the reference count.
sal_uInt32 m_refCount; /// stores the library handle.
oslModule m_pModule; /// stores the library name.
::rtl::OUString m_strModuleName; /// stores the name of the initialization function.
::rtl::OUString m_strInitFunction; /** stores a pointer to itself, which must be reset in the destructor to signal thattheloaderisinvalid.
*/
ORealDynamicLoader ** ppSetToZeroInDestructor;
};
/** The ODynamicLoader provides a special load on call mechanism for dynamic libraries whichsupportaC-API.
/// Destructor, decrease the reference count and unload the library if it is the last instance.
~ODynamicLoader()
{ if( m_pLoader ) if (m_pLoader->release()==0)
m_pStaticLoader = NULL;
}
/// returns a pointer to the initialized API function structure.
API* SAL_CALL getApi() const
{ returnstatic_cast<API*>(m_pLoader->getApi());
}
/// cast operator, which cast to a pointer with the initialized API function structure.
API* SAL_CALL operator->() const
{ returnstatic_cast<API*>(m_pLoader->getApi());
}
/// checks if the loader works on a loaded and initialized library. bool SAL_CALL isLoaded() const
{ return (m_pLoader != NULL);
}
protected: /// stores the real loader helper instance static ORealDynamicLoader* m_pStaticLoader;
ORealDynamicLoader* m_pLoader;
};
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.