Edit: /usr/include/luabind/intrusive_ptr_converter.hpp (1789B)
// Copyright Chsritian Neumüller 2013. 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_INTRUSIVE_PTR_CONVERTER_HPP_INCLUDED
#define LUABIND_INTRUSIVE_PTR_CONVERTER_HPP_INCLUDED
#include
#include
#include
#include
#include
namespace luabind {
namespace detail {
template
struct intrusive_ptr_converter
: default_converter
{
private:
typedef P ptr_t;
typedef typename ptr_t::element_type* rawptr_t;
public:
typedef mpl::false_ is_native;
template
int match(lua_State* L, U, int index)
{
return default_converter::match(
L, LUABIND_DECORATE_TYPE(rawptr_t), index);
}
template
ptr_t apply(lua_State* L, U, int index)
{
rawptr_t raw_ptr = default_converter::apply(
L, LUABIND_DECORATE_TYPE(rawptr_t), index);
return ptr_t(raw_ptr);
}
void apply(lua_State* L, ptr_t const& p)
{
detail::value_converter().apply(L, p);
}
template
void converter_postcall(lua_State*, U const&, int)
{}
};
} // namespace detail
template
struct default_converter >:
detail::intrusive_ptr_converter > {};
template
struct default_converter const&>:
detail::intrusive_ptr_converter > {};
} // namespace luabind
#endif // LUABIND_INTRUSIVE_PTR_CONVERTER_HPP_INCLUDED