Lolly 1.4.27
Loading...
Searching...
No Matches
shared_lib.hpp
Go to the documentation of this file.
1
2/** \file shared_lib.hpp
3 * \copyright GPLv3
4 * \details dynamic (shared) library related routines
5 * \author jingkaimori
6 * \date 2024
7 */
8
9#pragma once
10
11#include "resource.hpp"
12#include "url.hpp"
13#include <stdint.h>
14#include <tbox/tbox.h>
15
16#ifndef OS_WASM
17namespace lolly {
18namespace system {
19
20RESOURCE (shared_lib);
21
22struct shared_lib_rep : rep<shared_lib> {
23private:
24 tb_dynamic_ref_t dynamic_ref;
25
26public:
27 shared_lib_rep (string dynamic_name, url path);
28 virtual ~shared_lib_rep ();
29 template <typename Ret, typename... Args>
30 auto get_function (string function_name) -> Ret (*) (Args...) {
31 return (Ret (*) (Args...)) tb_dynamic_func (dynamic_ref,
33 }
34 friend struct shared_lib;
35};
36
37shared_lib load_shared_library (string name, url path);
38
39} // namespace system
40} // namespace lolly
41#endif
The list class represents a linked list.
Definition list.hpp:48
Definition url.hpp:37
shared_lib load_shared_library(string name, url path)
#define RESOURCE(PTR)
Definition resource.hpp:45
shared_lib_rep(string dynamic_name, url path)
auto get_function(string function_name) -> Ret(*)(Args...)
base class of resources
Definition resource.hpp:23