![]() |
Spicy
|
#include <library.h>
Public Member Functions | |
| Library (const hilti::rt::filesystem::path &path) | |
| Library (const Library &)=delete | |
| Library & | operator= (const Library &)=delete |
| Library (Library &&)=default | |
| Library & | operator= (Library &&)=default |
| hilti::rt::Result< hilti::rt::library::Version > | open () const |
| hilti::rt::Result< Nothing > | save (const hilti::rt::filesystem::path &path) const |
| hilti::rt::Result< void * > | symbol (const char *name) const |
| hilti::rt::Result< Nothing > | remove () const |
Static Public Member Functions | |
| static void | setScope (uint64_t *scope) |
Container for storing code compiled into a native shared library.
This class loads the underlying library it wraps into its internal store on construction and subsequently does not depend on it anymore.
| hilti::rt::Library::Library | ( | const hilti::rt::filesystem::path & | path | ) |
Makes a library available for opening.
| path | full path to the library file |
| <em>std::runtime_error</em> | if library does not exist, or any other I/O operation failed |
| hilti::rt::Result< hilti::rt::library::Version > hilti::rt::Library::open | ( | ) | const |
Load the library into the current process
| hilti::rt::Result< hilti::rt::Nothing > hilti::rt::Library::save | ( | const hilti::rt::filesystem::path & | path | ) | const |
Save this library under a different path.
| path | the path where this library should be stored |
|
static |
Sets the passed linker scope.
If a library is currently being loaded through open(), the scope is (stable) hash of that library's absolute path. If we're outside of library loading, this returns a scope that's guaranteed to be unique across all calls to this method.
This method is meant to be called only from the generated linker code to set a module's global scope variable. Its semantics are tailored to that use case.
| a | non-null pointer to the scope to update. |