MCPcopy Create free account
hub / github.com/OAID/Tengine / GetFunction

Method GetFunction

include/share_lib_parser.hpp:65–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

63 };
64
65 template <typename F> std::function<F> GetFunction(const std::string func_name)
66 {
67 auto it = func_map.find(func_name);
68 if(it == func_map.end())
69 {
70 auto f = dlsym(sl, func_name.c_str());
71 if(!f)
72 {
73 throw te_error_shared_function_not_found(func_name);
74 // return nullptr;
75 }
76 func_map.emplace(func_name, ( func* )f);
77 it = func_map.find(func_name);
78 }
79 return std::function<F>(( F* )(it->second));
80 }
81
82 template <typename F, typename... Args>
83 typename std::result_of<std::function<F>(Args...)>::type ExecuteFunc(const std::string& func_name, Args&&... args)

Callers

nothing calls this directly

Calls 3

endMethod · 0.80
c_strMethod · 0.45

Tested by

no test coverage detected