/
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/stack.hpp
(4016B)
#ifndef LUABIND_STACK_HPP_INCLUDED #define LUABIND_STACK_HPP_INCLUDED #include <luabind/detail/convert_to_lua.hpp> #include <luabind/detail/policy.hpp> #include <luabind/detail/primitives.hpp> #include <luabind/error.hpp> #include <boost/implicit_cast.hpp> #include <boost/mpl/if.hpp> #include <boost/mpl/apply_wrap.hpp> #include <boost/optional/optional.hpp> namespace luabind { namespace detail { namespace mpl = boost::mpl; template<class T, class ConverterGenerator> void push_aux(lua_State* L, T& value, ConverterGenerator*) { typedef typename boost::mpl::if_< boost::is_reference_wrapper<T> , BOOST_DEDUCED_TYPENAME boost::unwrap_reference<T>::type& , T >::type unwrapped_type; typename mpl::apply_wrap2< ConverterGenerator,unwrapped_type,cpp_to_lua >::type cv; cv.apply( L , boost::implicit_cast< BOOST_DEDUCED_TYPENAME boost::unwrap_reference<T>::type& >(value) ); } } // namespace detail template<class T, class Policies> void push(lua_State* L, T& value, Policies const&) { typedef typename detail::find_conversion_policy< 0 , Policies >::type converter_policy; push_aux(L, value, static_cast<converter_policy*>(0)); } template<class T> void push(lua_State* L, T& value) { push(L, value, detail::null_type()); } namespace detail { template< class T , class Policies , class ErrorPolicy , class ReturnType > ReturnType from_lua_aux( lua_State* L , int idx , T* , Policies* , ErrorPolicy* , ReturnType* ) { #ifndef LUABIND_NO_ERROR_CHECKING if (!L) return ErrorPolicy::handle_error(L, typeid(void)); #endif typedef typename detail::find_conversion_policy< 0 , Policies >::type converter_generator; typename mpl::apply_wrap2<converter_generator, T, lua_to_cpp>::type cv; if (cv.match(L, LUABIND_DECORATE_TYPE(T), idx) < 0) { return ErrorPolicy::handle_error(L, typeid(T)); } return cv.apply(L, LUABIND_DECORATE_TYPE(T), idx); } # ifdef BOOST_MSVC # pragma warning(push) # pragma warning(disable:4702) // unreachable code # endif template<class T> struct throw_error_policy { static T handle_error(lua_State* L, type_id const& type_info) { #ifndef LUABIND_NO_EXCEPTIONS throw cast_failed(L, type_info); #else cast_failed_callback_fun e = get_cast_failed_callback(); if (e) e(L, type_info); assert(0 && "object_cast failed. If you want to handle this error use " "luabind::set_error_callback()"); std::terminate(); return *(typename boost::remove_reference<T>::type*)0; #endif } }; # ifdef BOOST_MSVC # pragma warning(pop) # endif template<class T> struct nothrow_error_policy { static boost::optional<T> handle_error(lua_State*, type_id const&) { return boost::optional<T>(); } }; } // namespace detail template<class T, class Policies> T from_lua(lua_State* L, int idx, Policies const&) { return detail::from_lua_aux( L , idx , static_cast<T*>(0) , static_cast<Policies*>(0) , static_cast<detail::throw_error_policy<T>*>(0) , static_cast<T*>(0) ); } template<class T> T from_lua(lua_State* L, int idx) { return from_lua<T>(L, idx, detail::null_type()); } template<class T, class Policies> boost::optional<T> from_lua_nothrow(lua_State* L, int idx, Policies const&) { return detail::from_lua_aux( L , idx , static_cast<T*>(0) , static_cast<Policies*>(0) , static_cast<detail::nothrow_error_policy<T>*>(0) , static_cast<boost::optional<T>*>(0) ); } template<class T> boost::optional<T> from_lua_nothrow(lua_State* L, int idx) { return from_lua_nothrow<T>(L, idx, detail::null_type()); } } // namespace luabind #endif // LUABIND_STACK_HPP_INCLUDED
Save
cmd:
run