#include <cxxtools/dlloader.h>
Public Member Functions | |
| Library (const char *name) | |
| loads a shared library. | |
| Library () | |
| default constructor. | |
| Library (const Library &src) | |
| Copy-constrcutor - increments reference to the library. | |
| ~Library () | |
| unloads the library if some is referenced. | |
| Library & | operator= (const Library &src) |
| void | open (const char *name) |
| void | close () |
| Symbol | sym (const char *name) const |
| extracts a symbol from the library. | |
| void * | operator[] (const char *name) const |
| extracts a symbol from the library. | |
| bool | isLastRef () const |
| returns true, if this is the only reference. | |
| void * | getHandle () const |
To load a shared-library, just instantiate this class with a shared-library-name. The class is copyable. The library is unloaded (with dlclose) when the last reference is deleted.
| void open | ( | const char * | name | ) |
loads a shared library. If the class references already another library the reference is decremented and unloaded, if the class was the last reference.
| void close | ( | ) |
unloads the library if some is referenced. Does nothing, if no library was referenced.