/
usr
/
include
/
luabind
/
/usr/include/luabind
mkdir
upload
Name
Size
Mode
Actions
detail/
-
0755
rm
adopt_policy.hpp
5091
0644
edit
dl
rm
back_reference.hpp
3111
0644
edit
dl
rm
back_reference_fwd.hpp
1495
0644
edit
dl
rm
build_information.hpp
2015
0644
edit
dl
rm
class.hpp
27490
0644
edit
dl
rm
class_info.hpp
1704
0644
edit
dl
rm
config.hpp
5232
0644
edit
dl
rm
container_policy.hpp
4951
0644
edit
dl
rm
copy_policy.hpp
1313
0644
edit
dl
rm
dependency_policy.hpp
2691
0644
edit
dl
rm
discard_result_policy.hpp
2512
0644
edit
dl
rm
error.hpp
3345
0644
edit
dl
rm
error_callback_fun.hpp
1750
0644
edit
dl
rm
exception_handler.hpp
2086
0644
edit
dl
rm
from_stack.hpp
1485
0644
edit
dl
rm
function.hpp
1519
0644
edit
dl
rm
function_converter.hpp
4021
0644
edit
dl
rm
function_introspection.hpp
1949
0644
edit
dl
rm
get_main_thread.hpp
522
0644
edit
dl
rm
get_pointer.hpp
1554
0644
edit
dl
rm
handle.hpp
4218
0644
edit
dl
rm
intrusive_ptr_converter.hpp
1789
0644
edit
dl
rm
iterator_policy.hpp
2982
0644
edit
dl
rm
luabind.hpp
1356
0644
edit
dl
rm
lua_include.hpp
2665
0644
edit
dl
rm
lua_state_fwd.hpp
1357
0644
edit
dl
rm
make_function.hpp
3238
0644
edit
dl
rm
nil.hpp
1368
0644
edit
dl
rm
no_dependency.hpp
903
0644
edit
dl
rm
object.hpp
1291
0644
edit
dl
rm
object_fwd.hpp
331
0644
edit
dl
rm
open.hpp
1371
0644
edit
dl
rm
operator.hpp
8993
0644
edit
dl
rm
out_value_policy.hpp
12029
0644
edit
dl
rm
prefix.hpp
1265
0644
edit
dl
rm
raw_policy.hpp
2426
0644
edit
dl
rm
return_reference_to_policy.hpp
2661
0644
edit
dl
rm
scope.hpp
2944
0644
edit
dl
rm
set_package_preload.hpp
2452
0644
edit
dl
rm
shared_ptr_converter.hpp
5274
0644
edit
dl
rm
stack.hpp
4016
0644
edit
dl
rm
std_shared_ptr_converter.hpp
2271
0644
edit
dl
rm
tag_function.hpp
1622
0644
edit
dl
rm
typeid.hpp
2498
0644
edit
dl
rm
value_wrapper.hpp
4241
0644
edit
dl
rm
version.hpp
513
0644
edit
dl
rm
weak_ref.hpp
1834
0644
edit
dl
rm
wrapper_base.hpp
5987
0644
edit
dl
rm
yield_policy.hpp
1734
0644
edit
dl
rm
Edit:
/usr/include/luabind/make_function.hpp
(3238B)
// Copyright Daniel Wallin 2008. Use, modification and distribution is // subject to the Boost Software License, Version 1.0. (See accompanying // file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) #ifndef LUABIND_MAKE_FUNCTION_081014_HPP # define LUABIND_MAKE_FUNCTION_081014_HPP # include <luabind/config.hpp> # include <luabind/detail/call.hpp> # include <luabind/detail/deduce_signature.hpp> # include <luabind/detail/format_signature.hpp> # include <luabind/exception_handler.hpp> # include <luabind/object.hpp> namespace luabind { namespace detail { LUABIND_API bool is_luabind_function(lua_State* L, int index); // MSVC complains about member being sensitive to alignment (C4121) // when F is a pointer to member of a class with virtual bases. # ifdef BOOST_MSVC # pragma pack(push) # pragma pack(16) # endif template <class F, class Signature, class Policies> struct function_object_impl : function_object { function_object_impl(F f_, Policies const& policies_) : function_object(&entry_point) , f(f_) , policies(policies_) {} int call(lua_State* L, invoke_context& ctx) const { return invoke(L, *this, ctx, f, Signature(), policies); } void format_signature(lua_State* L, char const* function) const { detail::format_signature(L, function, Signature()); } static int entry_point(lua_State* L) { function_object_impl const* impl = *static_cast<function_object_impl const**>( lua_touserdata(L, lua_upvalueindex(1))); int results = 0; bool error = false; # ifndef LUABIND_NO_EXCEPTIONS try #endif // Scope neeeded to destroy invoke_context before calling lua_error() { invoke_context ctx; results = invoke( L, *impl, ctx, impl->f, Signature(), impl->policies); if (!ctx) { ctx.format_error(L, impl); error = true; } } #ifndef LUABIND_NO_EXCEPTIONS catch (...) { error = true; handle_exception_aux(L); } #endif if (error) { assert(results >= 0); return lua_error(L); } if (results < 0) { return lua_yield(L, -results - 1); } return results; } F f; Policies policies; }; # ifdef BOOST_MSVC # pragma pack(pop) # endif LUABIND_API object make_function_aux( lua_State* L, function_object* impl ); LUABIND_API void add_overload(object const&, char const*, object const&); } // namespace detail template <class F, class Signature, class Policies> object make_function(lua_State* L, F f, Signature, Policies) { return detail::make_function_aux( L , new detail::function_object_impl<F, Signature, Policies>( f, Policies() ) ); } template <class F> object make_function(lua_State* L, F f) { return make_function(L, f, detail::deduce_signature(f), detail::null_type()); } } // namespace luabind #endif // LUABIND_MAKE_FUNCTION_081014_HPP
Save
cmd:
run