55 #ifdef PLATFORM_WINDOWS
103 bool mismatch =
false;
168 L,
"%s expected, got %s", expected, got);
190 void const* baseClassKey,
192 bool errorOnMismatch =
true)
197 bool mismatch =
false;
234 if (isConst && !canBeConst)
284 if (mismatch && errorOnMismatch)
295 L,
"%s expected, got %s", expected, got);
336 return static_cast <T*
> (
getClass (L, index,
374 return reinterpret_cast <T*
> (&
m_storage [0]);
415 new (
place (L)) U (u);
542 m_p =
const_cast <void*
> (
reinterpret_cast <void const*
> (
552 m_p =
const_cast <void*
> (
reinterpret_cast <void const*
> (
559 template <
class C,
bool makeObjectConst>
574 if constexpr (makeObjectConst) {
594 if constexpr (makeObjectConst) {
654 int v =
static_cast <int> (t);
666 std::conditional_t<passByValueNotEnum, T const&, T>
671 return *Userdata::get <T> (L, index,
true);
683 return Userdata::get <U> (L, index,
true);
710 return Userdata::get <T> (L, index,
false);
725 return Userdata::get <T> (L, index,
false);
740 return Userdata::get <T> (L, index,
true);
755 return Userdata::get <T> (L, index,
true);
771 return Userdata::get <T> (L, index,
true);
786 T*
const t = Userdata::get <T> (L, index,
false);
818 std::conditional_t<passByContainer, T, T const&>
826 return Userdata::get <U> (L, index,
true);
830 T
const*
const t = Userdata::get <T> (L, index,
true);
void rawgetfield(lua_State *L, int index, char const *key)
static void push(lua_State *const L, T *const p)
static void push_raw(lua_State *const L, void *p, const void *classkey)
static void push(lua_State *const L, T const *const p)
static void push(lua_State *L, void const *const p, void const *const key)
static void push(lua_State *L, void *const p, void const *const key)
UserdataPtr(void *const p)
UserdataPtr operator=(UserdataPtr const &)
UserdataPtr(UserdataPtr const &)
UserdataShared(U const &u)
UserdataShared(UserdataShared< C > const &)
TypeTraits::removeConst< typename ContainerTraits< C >::Type >::Type T
UserdataShared< C > & operator=(UserdataShared< C > const &)
UserdataValue(UserdataValue< T > const &)
char m_storage[sizeof(T)]
static void * place(lua_State *const L)
static void push(lua_State *const L, U const &u)
UserdataValue< T > operator=(UserdataValue< T > const &)
static Userdata * getExactClass(lua_State *L, int narg, void const *classKey)
static T * get(lua_State *L, int index, bool canBeConst)
static Userdata * getClass(lua_State *L, int index, void const *baseClassKey, bool canBeConst, bool errorOnMismatch=true)
static T * try_get(lua_State *L, int index, bool canBeConst)
static Userdata * getExact(lua_State *L, int index)
void * getPointer() const
static void * get_ptr(lua_State *L, int index)
int() luaL_error(lua_State *L, const char *fmt,...)
lua_Integer() luaL_checkinteger(lua_State *L, int arg)
int() luaL_argerror(lua_State *L, int arg, const char *extramsg)
int() lua_absindex(lua_State *L, int idx)
#define lua_replace(L, idx)
#define lua_istable(L, n)
#define lua_insert(L, idx)
int() lua_rawgetp(lua_State *L, int idx, const void *p)
int() lua_error(lua_State *L)
#define LUA_REGISTRYINDEX
int() lua_rawequal(lua_State *L, int idx1, int idx2)
int() lua_setmetatable(lua_State *L, int objindex)
void *() lua_newuserdata(lua_State *L, size_t sz)
const char *() lua_pushfstring(lua_State *L, const char *fmt,...)
void() lua_pushinteger(lua_State *L, lua_Integer n)
int() lua_type(lua_State *L, int idx)
#define lua_remove(L, idx)
void *() lua_touserdata(lua_State *L, int idx)
void() lua_pushnil(lua_State *L)
int() lua_getmetatable(lua_State *L, int objindex)
int() lua_isuserdata(lua_State *L, int idx)
#define lua_tostring(L, i)
const char *() lua_typename(lua_State *L, int tp)
#define lua_isboolean(L, n)
void push(lua_State *L, T t)
static T * get(lua_State *L, int index)
static void push(lua_State *L, T *const p)
static T * get(lua_State *L, int index)
static void push(lua_State *L, T *const p)
static T * get(lua_State *L, int index)
static void push(lua_State *L, T *const &p)
static T & get(lua_State *L, int index)
static void push(lua_State *L, T &t)
static void push(lua_State *L, T const *const p)
static T const * get(lua_State *L, int index)
static T const * get(lua_State *L, int index)
static void push(lua_State *L, T const *const p)
static std::conditional_t< passByContainer, T, T const & > get(lua_State *L, int index)
static void push(lua_State *L, T const &t)
static constexpr bool passByContainer
static constexpr bool passByValueEnum
static std::conditional_t< passByValueNotEnum, T const &, T > get(lua_State *L, int index)
static void push(lua_State *L, T const &t)
static constexpr bool passByValueNotEnum
static void push(lua_State *L, C const &c)
TypeTraits::removeConst< typename ContainerTraits< C >::Type >::Type T
static void push(lua_State *L, T *const t)