10 #include "underlying_type.hpp" 24 explicit SharedLib(ConstructorAccess ca, std::shared_ptr<Loop> ref, std::string filename) noexcept
27 opened = (0 == uv_dlopen(filename.data(),
get()));
38 explicit operator bool() const noexcept {
return opened; }
50 F *
sym(std::string name) {
51 static_assert(std::is_function<F>::value,
"!");
53 auto err = uv_dlsym(
get(), name.data(),
reinterpret_cast<void**
>(&func));
54 if(err) { func =
nullptr; }
62 const char *
error() const noexcept {
63 return uv_dlerror(
get());
Wrapper class for underlying types.
const char * error() const noexcept
Returns the last error message, if any.
F * sym(std::string name)
Retrieves a data pointer from a dynamic library.