8#include "molybden/js/js_return_value.hpp"
13template <
class C,
class R,
class... T>
14using MethodSignature = R (C::*)(T...);
16template <
class C,
class R,
class... T>
17class JsAccessibleMethodImplBase :
public JsAccessibleMethod {
19 JsAccessibleMethodImplBase(C*
object, MethodSignature<C, R, T...> method);
22 JsReturnValue call(
const std::vector<JsValue>& values)
override;
25 R callInternal(T... args);
28 template <std::size_t... I>
29 JsReturnValue checkedCall(
const std::vector<JsValue>& values,
30 index_sequence<I...>);
31 virtual JsValue wrappedCall(T... args) = 0;
34 MethodSignature<C, R, T...> call_;
38template <
class C,
class R,
class... T>
39class JsAccessibleMethodImpl :
public JsAccessibleMethodImplBase<C, R, T...> {
41 JsAccessibleMethodImpl(C*
object, MethodSignature<C, R, T...> method);
44 JsValue wrappedCall(T... args)
override;
47template <
class C,
class... T>
48class JsAccessibleMethodImpl<C, void, T...>
49 :
public JsAccessibleMethodImplBase<C, void, T...> {
51 JsAccessibleMethodImpl(C*
object, MethodSignature<C, void, T...> method);
54 JsValue wrappedCall(T... args)
override;