29#ifndef PT_SYSTEM_LIBRARY_H
30#define PT_SYSTEM_LIBRARY_H
32#include <Pt/System/Api.h>
33#include <Pt/System/SystemError.h>
34#include <Pt/System/Path.h>
169 {
return this->
resolve(symbol); }
178 operator const void*()
const;
212 class LibraryImpl* _impl;
234 : _lib(lib), _sym(
sym)
249 operator void*()
const
Shared library loader.
Definition Library.h:123
Library & open(const Path &path)
Loads a shared library.
Library & operator=(const Library &other)
Assignment operator.
Symbol getSymbol(const char *symbol) const
Resolves the symbol symbol from the shared library.
Library()
Default Constructor which does not load a library.
void * operator[](const char *symbol) const
Resolves the symbol symbol from the shared library Returns the address of the symbol or 0 if it was n...
Definition Library.h:168
const Path & path() const
Returns the path to the shared library image.
~Library()
The destructor unloads the shared library from memory.
void close()
Closes the shared library.
static const char * suffix()
Returns the extension for shared libraries.
bool operator!() const
Returns true if invalid.
void * resolve(const char *symbol) const
Resolves the symbol symbol from the shared library Returns the address of the symbol or 0 if it was n...
Library(const Path &path)
Loads a shared library.
static const char * prefix()
Returns the prefix for shared libraries.
Library(const Library &other)
Copy constructor.
Represents a path in the file-system.
Definition Path.h:48
SymbolNotFound(const std::string &sym)
Construct with symbol.
SymbolNotFound(const char *sym)
Construct with symbol.
~SymbolNotFound()
Destructor.
Definition Library.h:59
const std::string & symbol() const
Returns the symbol, which was not found.
Definition Library.h:63
Symbol resolved from a shared library.
Definition Library.h:223
void * sym() const
Returns the symbol address.
Definition Library.h:239
Symbol()
Default constructor.
Definition Library.h:227
const Library & library() const
Returns the library where the symbol was resolved.
Definition Library.h:244
Symbol(const Library &lib, void *sym)
Construct with library and symbol address.
Definition Library.h:233
SystemError(const std::string &what)
Construct with error message.
System programming
Definition Connection.h:26
Core module.
Definition Allocator.h:33