The ODynamicLoader provides a special load on call mechanism for dynamic libraries which support a C-API. More...
#include <dynload.hxx>
| Public Member Functions | |
| ODynamicLoader () | |
| Default constructor. | |
| ODynamicLoader (const ::rtl::OUString &strModuleName, const ::rtl::OUString &strInitFunction) | |
| Constructor, loads the library if necessary otherwise the reference count will be increased. | |
| ODynamicLoader (const ODynamicLoader< API > &toCopy) | |
| Copy constructor. | |
| ~ODynamicLoader () | |
| Destructor, decrease the reference count and unload the library if it is the last instance. | |
| ODynamicLoader< API > & | operator= (const ODynamicLoader< API > &toAssign) | 
| Assign operator. | |
| API * | getApi () const | 
| returns a pointer to the initialized API function structure. | |
| API * | operator-> () const | 
| cast operator, which cast to a pointer with the initialized API function structure. | |
| bool | isLoaded () const | 
| checks if the loader works on a loaded and initialized library. | |
| Protected Attributes | |
| ORealDynamicLoader * | m_pLoader | 
| Static Protected Attributes | |
| static ORealDynamicLoader * | m_pStaticLoader | 
| stores the real loader helper instance | |
The ODynamicLoader provides a special load on call mechanism for dynamic libraries which support a C-API.
The libraries must provide a struct with function pointers for all supported C functions. The loader loads the specified library and call the specified initialization function to initialize the function pointers with the real functions. Furthermore provides the loader a reference counter for the library. When the last instance of the loader will be destroyed the loader will unload the library.
| 
 | inline | 
Default constructor.
| 
 | inline | 
Constructor, loads the library if necessary otherwise the reference count will be increased.
| strModuleName | specifies the library name. | 
| strInitFunction | specifies the name of the initialization function. | 
| 
 | inline | 
Copy constructor.
| 
 | inline | 
Destructor, decrease the reference count and unload the library if it is the last instance.
| 
 | inline | 
returns a pointer to the initialized API function structure.
| 
 | inline | 
checks if the loader works on a loaded and initialized library.
| 
 | inline | 
cast operator, which cast to a pointer with the initialized API function structure.
| 
 | inline | 
Assign operator.
| 
 | protected | 
| 
 | staticprotected | 
stores the real loader helper instance