MCPcopy Create free account
hub / github.com/WasmEdge/WasmEdge / createModule

Function createModule

test/plugins/wasm_bpf/wasm_bpf.cpp:42–54  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

40}
41
42std::unique_ptr<WasmEdge::Host::WasmBpfModule> createModule() {
43 using namespace std::literals::string_view_literals;
44 WasmEdge::Plugin::Plugin::load(
45 std::filesystem::u8path("../../../plugins/wasm_bpf/" WASMEDGE_LIB_PREFIX
46 "wasmedgePluginWasmBpf" WASMEDGE_LIB_EXTENSION));
47 if (const auto *Plugin = WasmEdge::Plugin::Plugin::find("wasm_bpf"sv)) {
48 if (const auto *Module = Plugin->findModule("wasm_bpf"sv)) {
49 return dynamicPointerCast<WasmEdge::Host::WasmBpfModule>(
50 Module->create());
51 }
52 }
53 return {};
54}
55
56std::filesystem::path getAssertsPath() {
57 std::filesystem::path thisFile(__FILE__);

Callers 1

TESTFunction · 0.70

Calls 3

loadFunction · 0.50
findModuleMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected