#include <dlSharedLibrary.hpp>

Public Member Functions | |
| dlSharedLibrary (void *libhandle, const String &libName) | |
| virtual | ~dlSharedLibrary () |
Static Public Member Functions | |
| static void | setCallDlclose (bool callDlclose) |
| on some platforms (e.g. | |
| static bool | isFakeLibrary (const String &library_path) |
| Returns if the given path is a fake library or not. | |
Protected Member Functions | |
| virtual bool | doGetFunctionPointer (const String &functionName, void **fp) const |
| Derived classes have to override this function to implement the symbol loading. | |
Private Member Functions | |
| dlSharedLibrary (const dlSharedLibrary &) | |
| dlSharedLibrary & | operator= (const dlSharedLibrary &) |
Private Attributes | |
| void * | m_libhandle |
| String | m_libName |
Static Private Attributes | |
| static bool | s_call_dlclose = true |
Using dlsym & friends.
Definition at line 60 of file dlSharedLibrary.hpp.
| BLOCXX_NAMESPACE::dlSharedLibrary::dlSharedLibrary | ( | void * | libhandle, | |
| const String & | libName | |||
| ) |
| BLOCXX_NAMESPACE::dlSharedLibrary::~dlSharedLibrary | ( | ) | [virtual] |
| BLOCXX_NAMESPACE::dlSharedLibrary::dlSharedLibrary | ( | const dlSharedLibrary & | ) | [private] |
| static void BLOCXX_NAMESPACE::dlSharedLibrary::setCallDlclose | ( | bool | callDlclose | ) | [inline, static] |
on some platforms (e.g.
glibc 2.2.x), there are bugs in the dl* functions, and the workaround is to not call dlclose. Setting this variable to 0 will cause dlclose to never be called. Doing this has some problems: memory mapped to the shared library will never be freed up. New versions of the library can't be loaded (if a provider is updated)
Definition at line 73 of file dlSharedLibrary.hpp.
References s_call_dlclose.
| bool BLOCXX_NAMESPACE::dlSharedLibrary::isFakeLibrary | ( | const String & | library_path | ) | [static] |
Returns if the given path is a fake library or not.
Definition at line 126 of file dlSharedLibrary.cpp.
References BLOCXX_NAMESPACE::String::c_str(), BLOCXX_NAMESPACE::FileSystem::canRead(), BLOCXX_NAMESPACE::FileSystem::close(), and BLOCXX_NAMESPACE::FileSystem::read().
Referenced by dlSharedLibrary(), and BLOCXX_NAMESPACE::dlSharedLibraryLoader::loadSharedLibrary().
| bool BLOCXX_NAMESPACE::dlSharedLibrary::doGetFunctionPointer | ( | const String & | functionName, | |
| void ** | fp | |||
| ) | const [protected, virtual] |
Derived classes have to override this function to implement the symbol loading.
The symbol to be looked up is contained in functionName, and the pointer to the function should be written into *fp. Return true if the function succeeded, false otherwise.
| functionName | The name of the function to resolve. | |
| fp | Where to store the function pointer. |
Implements BLOCXX_NAMESPACE::SharedLibrary.
Definition at line 97 of file dlSharedLibrary.cpp.
References BLOCXX_NAMESPACE::String::c_str(), BLOCXX_NAMESPACE::dlSharedLibrary_guard, BLOCXX_NAMESPACE::Map< Key, T, Compare >::end(), and m_libhandle.
| dlSharedLibrary& BLOCXX_NAMESPACE::dlSharedLibrary::operator= | ( | const dlSharedLibrary & | ) | [private] |
void* BLOCXX_NAMESPACE::dlSharedLibrary::m_libhandle [private] |
Definition at line 96 of file dlSharedLibrary.hpp.
Referenced by doGetFunctionPointer(), and ~dlSharedLibrary().
Definition at line 97 of file dlSharedLibrary.hpp.
bool BLOCXX_NAMESPACE::dlSharedLibrary::s_call_dlclose = true [static, private] |
Definition at line 110 of file dlSharedLibrary.hpp.
Referenced by setCallDlclose(), and ~dlSharedLibrary().
1.5.6