MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / dukglue_pcall_method

Function dukglue_pcall_method

Source/Utils/dukglue/public_util.h:123–134  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

121
122template <typename RetT, typename ObjT, typename... ArgTs>
123typename std::enable_if<std::is_void<RetT>::value, RetT>::type dukglue_pcall_method(duk_context* ctx, const ObjT& obj, const char* method_name, ArgTs... args)
124{
125 dukglue::detail::SafeMethodCallData<RetT, ObjT, ArgTs...> data {
126 &obj, method_name, std::tuple<ArgTs...>(args...), nullptr
127 };
128
129 duk_idx_t rc = duk_safe_call(ctx, &dukglue::detail::call_method_safe<RetT, ObjT, ArgTs...>, (void*) &data, 0, 1);
130 if (rc != 0)
131 throw DukErrorException(ctx, rc);
132
133 duk_pop(ctx); // remove result from stack
134}
135
136template <typename RetT, typename ObjT, typename... ArgTs>
137typename std::enable_if<!std::is_void<RetT>::value, RetT>::type dukglue_pcall_method(duk_context* ctx, const ObjT& obj, const char* method_name, ArgTs... args)

Callers

nothing calls this directly

Calls 1

DukErrorExceptionClass · 0.85

Tested by

no test coverage detected