Allow Lua bindings up to 10 args
This commit is contained in:
parent
17881b3221
commit
b25cd7683b
@ -191,6 +191,19 @@ struct FuncTraits <R (*) (P1, P2, P3, P4, P5, P6, P7, P8, P9), D>
|
||||
}
|
||||
};
|
||||
|
||||
template <class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class D>
|
||||
struct FuncTraits <R (*) (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10), D>
|
||||
{
|
||||
static bool const isMemberFunction = false;
|
||||
typedef D DeclType;
|
||||
typedef R ReturnType;
|
||||
typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7, TypeList <P8, TypeList <P9, TypeList<P10> > > > > > > > > > Params;
|
||||
static R call (D fp, TypeListValues <Params>& tvl)
|
||||
{
|
||||
return fp (tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.tl.hd);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/* Non-const member function pointers. */
|
||||
|
||||
@ -344,6 +357,21 @@ struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6, P7, P8, P9), D>
|
||||
}
|
||||
};
|
||||
|
||||
template <class T, class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class D>
|
||||
struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10), D>
|
||||
{
|
||||
static bool const isMemberFunction = true;
|
||||
static bool const isConstMemberFunction = false;
|
||||
typedef D DeclType;
|
||||
typedef T ClassType;
|
||||
typedef R ReturnType;
|
||||
typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7, TypeList <P8, TypeList <P9, TypeList<P10> > > > > > > > > > Params;
|
||||
static R call (T* obj, D fp, TypeListValues <Params>& tvl)
|
||||
{
|
||||
return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.tl.hd);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/* Const member function pointers. */
|
||||
|
||||
@ -498,6 +526,21 @@ struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6, P7, P8, P9) const, D>
|
||||
}
|
||||
};
|
||||
|
||||
template <class T, class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class D>
|
||||
struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) const, D>
|
||||
{
|
||||
static bool const isMemberFunction = true;
|
||||
static bool const isConstMemberFunction = true;
|
||||
typedef D DeclType;
|
||||
typedef T ClassType;
|
||||
typedef R ReturnType;
|
||||
typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7, TypeList <P8, TypeList <P9, TypeList<P10> > > > > > > > > > Params;
|
||||
static R call (T const* obj, D fp, TypeListValues <Params>& tvl)
|
||||
{
|
||||
return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.tl.hd);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#if defined (LUABRIDGE_THROWSPEC)
|
||||
|
||||
@ -633,6 +676,19 @@ struct FuncTraits <R (*) (P1, P2, P3, P4, P5, P6, P7, P8, P9) LUABRIDGE_THROWSPE
|
||||
}
|
||||
};
|
||||
|
||||
template <class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class D>
|
||||
struct FuncTraits <R (*) (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) LUABRIDGE_THROWSPEC, D>
|
||||
{
|
||||
static bool const isMemberFunction = false;
|
||||
typedef D DeclType;
|
||||
typedef R ReturnType;
|
||||
typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7, TypeList <P8, TypeList <P9, TypeList<P10> > > > > > > > > > Params;
|
||||
static R call (D fp, TypeListValues <Params>& tvl)
|
||||
{
|
||||
return fp (tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.tl.hd);
|
||||
}
|
||||
};
|
||||
|
||||
/* Non-const member function pointers with THROWSPEC. */
|
||||
|
||||
template <class T, class R, class D>
|
||||
@ -785,6 +841,21 @@ struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6, P7, P8, P9) LUABRIDGE_THROW
|
||||
}
|
||||
};
|
||||
|
||||
template <class T, class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class D>
|
||||
struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) LUABRIDGE_THROWSPEC, D>
|
||||
{
|
||||
static bool const isMemberFunction = true;
|
||||
static bool const isConstMemberFunction = false;
|
||||
typedef D DeclType;
|
||||
typedef T ClassType;
|
||||
typedef R ReturnType;
|
||||
typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7, TypeList <P8, TypeList <P9, TypeList<P10> > > > > > > > > > Params;
|
||||
static R call (T* obj, D fp, TypeListValues <Params>& tvl)
|
||||
{
|
||||
return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.tl.hd);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/* Const member function pointers with THROWSPEC. */
|
||||
|
||||
@ -939,5 +1010,20 @@ struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6, P7, P8, P9) const LUABRIDGE
|
||||
}
|
||||
};
|
||||
|
||||
template <class T, class R, class P1, class P2, class P3, class P4, class P5, class P6, class P7, class P8, class P9, class P10, class D>
|
||||
struct FuncTraits <R (T::*) (P1, P2, P3, P4, P5, P6, P7, P8, P9, P10) const LUABRIDGE_THROWSPEC, D>
|
||||
{
|
||||
static bool const isMemberFunction = true;
|
||||
static bool const isConstMemberFunction = true;
|
||||
typedef D DeclType;
|
||||
typedef T ClassType;
|
||||
typedef R ReturnType;
|
||||
typedef TypeList <P1, TypeList <P2, TypeList <P3, TypeList <P4, TypeList <P5, TypeList <P6, TypeList <P7, TypeList <P8, TypeList <P9, TypeList<P10> > > > > > > > > > Params;
|
||||
static R call (T const* obj, D fp, TypeListValues <Params>& tvl)
|
||||
{
|
||||
return (obj->*fp)(tvl.hd, tvl.tl.hd, tvl.tl.tl.hd, tvl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.hd, tvl.tl.tl.tl.tl.tl.tl.tl.tl.tl.hd);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user