Otclient  14/8/2020
luabinder.h File Reference
#include "luainterface.h"
#include "luaexception.h"
#include <framework/stdext/traits.h>
#include <tuple>
Include dependency graph for luabinder.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  luabinder::pack_values_into_tuple< N >
 Pack arguments from lua stack into a tuple recursively. More...
 
struct  luabinder::pack_values_into_tuple< 0 >
 
struct  luabinder::expand_fun_arguments< N, Ret >
 Expand arguments from tuple for later calling the C++ function. More...
 
struct  luabinder::expand_fun_arguments< 0, Ret >
 
struct  luabinder::bind_lambda_fun< F >
 Specialization for lambdas. More...
 
struct  luabinder::bind_lambda_fun< Ret(Lambda::*)(Args...) const >
 

Namespaces

 luabinder
 

Functions

template<typename Ret , typename F , typename... Args>
std::enable_if<!std::is_void< Ret >::value, int >::type luabinder::call_fun_and_push_result (const F &f, LuaInterface *lua, const Args &... args)
 C++ function caller that can push results to lua. More...
 
template<typename Ret , typename F , typename... Args>
std::enable_if< std::is_void< Ret >::value, int >::type luabinder::call_fun_and_push_result (const F &f, LuaInterface *lua, const Args &... args)
 C++ void function caller. More...
 
template<typename Ret , typename F , typename Tuple >
LuaCppFunction luabinder::bind_fun_specializer (const F &f)
 Bind different types of functions generating a lambda. More...
 
LuaCppFunction luabinder::bind_fun (const std::function< int(LuaInterface *)> &f)
 Bind a customized function. More...
 
template<typename Ret , typename... Args>
LuaCppFunction luabinder::bind_fun (const std::function< Ret(Args...)> &f)
 Bind a std::function. More...
 
template<typename Lambda >
std::enable_if< std::is_constructible< decltype(&Lambda::operator())>::value, LuaCppFunction >::type luabinder::bind_fun (const Lambda &f)
 
template<typename Ret , typename... Args>
LuaCppFunction luabinder::bind_fun (Ret(*f)(Args...))
 Convert to C++ functions pointers to std::function then bind. More...
 
template<typename Ret , typename C , typename... Args>
std::function< Ret(const stdext::shared_object_ptr< C > &, const Args &...)> luabinder::make_mem_func (Ret(C::*f)(Args...))
 Create member function lambdas. More...
 
template<typename C , typename... Args>
std::function< void(const stdext::shared_object_ptr< C > &, const Args &...)> luabinder::make_mem_func (void(C::*f)(Args...))
 
template<typename Ret , typename C , typename... Args>
std::function< Ret(const Args &...)> luabinder::make_mem_func_singleton (Ret(C::*f)(Args...), C *instance)
 Create member function lambdas for singleton classes. More...
 
template<typename C , typename... Args>
std::function< void(const Args &...)> luabinder::make_mem_func_singleton (void(C::*f)(Args...), C *instance)
 
template<typename C , typename Ret , class FC , typename... Args>
LuaCppFunction luabinder::bind_mem_fun (Ret(FC::*f)(Args...))
 Bind member functions. More...
 
template<typename C , typename Ret , class FC , typename... Args>
LuaCppFunction luabinder::bind_singleton_mem_fun (Ret(FC::*f)(Args...), C *instance)
 Bind singleton member functions. More...
 
template<typename C >
LuaCppFunction luabinder::bind_mem_fun (int(C::*f)(LuaInterface *))
 Bind customized member functions. More...