/usr/include/luabind/detail
NameSizeModeActions
call.hpp91580644editdlrm
call_function.hpp187260644editdlrm
call_member.hpp137210644editdlrm
call_operator_iterate.hpp21940644editdlrm
class_registry.hpp29400644editdlrm
class_rep.hpp62350644editdlrm
constructor.hpp36910644editdlrm
convert_to_lua.hpp29240644editdlrm
debug.hpp22730644editdlrm
decorate_type.hpp65920644editdlrm
deduce_signature.hpp20160644editdlrm
enum_maker.hpp35420644editdlrm
format_signature.hpp36090644editdlrm
garbage_collector.hpp18620644editdlrm
has_get_pointer.hpp29600644editdlrm
inheritance.hpp41970644editdlrm
instance_holder.hpp31080644editdlrm
link_compatibility.hpp19940644editdlrm
make_instance.hpp28110644editdlrm
most_derived.hpp16020644editdlrm
object.hpp333940644editdlrm
object_call.hpp18990644editdlrm
object_rep.hpp44710644editdlrm
operator_id.hpp24650644editdlrm
other.hpp32900644editdlrm
pcall.hpp14580644editdlrm
pointee_sizeof.hpp18400644editdlrm
policy.hpp283400644editdlrm
primitives.hpp18560644editdlrm
property.hpp7820644editdlrm
signature_match.hpp21710644editdlrm
stack_utils.hpp16400644editdlrm
typetraits.hpp54390644editdlrm
yes_no.hpp13240644editdlrm
Edit: /usr/include/luabind/detail/instance_holder.hpp (3108B)
// 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_INSTANCE_HOLDER_081024_HPP # define LUABIND_INSTANCE_HOLDER_081024_HPP # include # include # include # include # include namespace luabind { namespace detail { class instance_holder { public: instance_holder(bool is_pointee_const) : m_pointee_const(is_pointee_const) {} virtual ~instance_holder() {} virtual std::pair get( cast_graph const& casts, class_id target) const = 0; virtual void release() = 0; bool pointee_const() const { return m_pointee_const; } private: bool m_pointee_const; }; namespace mpl = boost::mpl; inline mpl::false_ check_const_pointer(void*) { return mpl::false_(); } inline mpl::true_ check_const_pointer(void const*) { return mpl::true_(); } template #ifdef LUABIND_USE_CXX11 void release_ownership(std::unique_ptr& p) #else void release_ownership(std::auto_ptr& p) #endif { p.release(); } template void release_ownership(P const&) { throw std::runtime_error( "luabind: smart pointer does not allow ownership transfer"); } template class_id static_class_id(T*) { return registered_class::id; } template class pointer_holder : public instance_holder { public: pointer_holder( P p, class_id dynamic_id, void* dynamic_ptr ) : instance_holder(check_const_pointer(false ? get_pointer(p) : 0)) #ifdef LUABIND_USE_CXX11 , m_p(std::move(p)) #else , m_p(p) #endif , m_weak(0) , m_dynamic_id(dynamic_id) , m_dynamic_ptr(dynamic_ptr) {} std::pair get(cast_graph const& casts, class_id target) const { if (target == registered_class

::id) return std::pair(&this->m_p, 0); void* naked_ptr = const_cast(static_cast( m_weak ? m_weak : get_pointer(m_p))); if (!naked_ptr) return std::pair(static_cast(0), 0); return casts.cast( naked_ptr , static_class_id(false ? get_pointer(m_p) : 0) , target , m_dynamic_id , m_dynamic_ptr ); } void release() { m_weak = const_cast(static_cast( get_pointer(m_p))); release_ownership(m_p); } private: mutable P m_p; // weak will hold a possibly stale pointer to the object owned // by p once p has released it's owership. This is a workaround // to make adopt() work with virtual function wrapper classes. void* m_weak; class_id m_dynamic_id; void* m_dynamic_ptr; }; }} // namespace luabind::detail #endif // LUABIND_INSTANCE_HOLDER_081024_HPP