OW_NAMESPACE::dlSharedLibrary Class Reference

dlSharedLibrary loads and queries shared libraries. More...

#include <OW_dlSharedLibrary.hpp>

Inheritance diagram for OW_NAMESPACE::dlSharedLibrary:

Inheritance graph
[legend]
Collaboration diagram for OW_NAMESPACE::dlSharedLibrary:

Collaboration graph
[legend]
List of all members.

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 &)
dlSharedLibraryoperator= (const dlSharedLibrary &)

Private Attributes

void * m_libhandle
String m_libName

Static Private Attributes

static bool s_call_dlclose = true

Detailed Description

dlSharedLibrary loads and queries shared libraries.

Using dlsym & friends.

Definition at line 57 of file OW_dlSharedLibrary.hpp.


Constructor & Destructor Documentation

OW_NAMESPACE::dlSharedLibrary::dlSharedLibrary void *  libhandle,
const String libName
 

Definition at line 86 of file OW_dlSharedLibrary.cpp.

References isFakeLibrary().

OW_NAMESPACE::dlSharedLibrary::~dlSharedLibrary  )  [virtual]
 

Definition at line 100 of file OW_dlSharedLibrary.cpp.

References m_libhandle, and s_call_dlclose.

OW_NAMESPACE::dlSharedLibrary::dlSharedLibrary const dlSharedLibrary  )  [private]
 


Member Function Documentation

bool OW_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.

Parameters:
functionName The name of the function to resolve.
fp Where to store the function pointer.
Returns:
true if function succeeded, false otherwise.

Implements OW_NAMESPACE::SharedLibrary.

Definition at line 109 of file OW_dlSharedLibrary.cpp.

References OW_NAMESPACE::dlSharedLibrary_guard, and OW_NAMESPACE::Map< Key, T, Compare >::end().

bool OW_NAMESPACE::dlSharedLibrary::isFakeLibrary const String library_path  )  [static]
 

Returns if the given path is a fake library or not.

Definition at line 138 of file OW_dlSharedLibrary.cpp.

References OW_NAMESPACE::FileSystem::canRead(), OW_NAMESPACE::FileSystem::openFile(), and OW_NAMESPACE::File::read().

Referenced by dlSharedLibrary(), and OW_NAMESPACE::dlSharedLibraryLoader::loadSharedLibrary().

dlSharedLibrary& OW_NAMESPACE::dlSharedLibrary::operator= const dlSharedLibrary  )  [private]
 

static void OW_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 70 of file OW_dlSharedLibrary.hpp.

References s_call_dlclose.


Member Data Documentation

void* OW_NAMESPACE::dlSharedLibrary::m_libhandle [private]
 

Definition at line 93 of file OW_dlSharedLibrary.hpp.

Referenced by ~dlSharedLibrary().

String OW_NAMESPACE::dlSharedLibrary::m_libName [private]
 

Definition at line 94 of file OW_dlSharedLibrary.hpp.

bool OW_NAMESPACE::dlSharedLibrary::s_call_dlclose = true [static, private]
 

Definition at line 107 of file OW_dlSharedLibrary.hpp.

Referenced by setCallDlclose(), and ~dlSharedLibrary().


The documentation for this class was generated from the following files:
Generated on Thu Feb 9 09:13:40 2006 for openwbem by  doxygen 1.4.6