Update of /cvsroot/luabind/luabind/luabind/luabind/detail
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29574/luabind/detail
Modified Files:
Tag: daniel-refactoring
call.hpp class_rep.hpp constructor.hpp object_rep.hpp
other.hpp overload_rep.hpp policy.hpp signature_match.hpp
Added Files:
Tag: daniel-refactoring
has_get_pointer.hpp most_derived.hpp
Log Message:
merged_beta7-devel2_into_daniel-refactoring_051024
Index: overload_rep.hpp
===================================================================
RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/overload_rep.hpp,v
retrieving revision 1.6.2.2
retrieving revision 1.6.2.2.2.1
diff -u -d -r1.6.2.2 -r1.6.2.2.2.1
--- overload_rep.hpp 1 Aug 2005 17:24:32 -0000 1.6.2.2
+++ overload_rep.hpp 24 Oct 2005 00:31:35 -0000 1.6.2.2.2.1
@@ -32,12 +32,15 @@
#include <boost/preprocessor/iteration/iterate.hpp>
#include <boost/preprocessor/repetition/enum_trailing_params.hpp>
#include <boost/preprocessor/repeat.hpp>
+#include <vector>
#include <luabind/detail/overload_rep_base.hpp>
-#include <luabind/detail/class_rep.hpp>
#include <luabind/detail/is_indirect_const.hpp>
+
+#ifndef BOOST_MSVC
#include <luabind/detail/policy.hpp>
+#endif
namespace luabind { namespace detail
{
Index: other.hpp
===================================================================
RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/other.hpp,v
retrieving revision 1.2
retrieving revision 1.2.6.1
diff -u -d -r1.2 -r1.2.6.1
--- other.hpp 14 Jun 2003 21:05:02 -0000 1.2
+++ other.hpp 24 Oct 2005 00:31:35 -0000 1.2.6.1
@@ -74,7 +74,7 @@
no_other_t is_other_test(...);
template<typename T>
- yes_other_t is_other_test(type< other<T> >);
+ yes_other_t is_other_test(type_< other<T> >);
template<bool wrapped>
struct other_unwrapper
@@ -102,7 +102,7 @@
public:
BOOST_STATIC_CONSTANT(
bool, value = (
- sizeof(detail::is_other_test(type<T>()))
+ sizeof(detail::is_other_test(type_<T>()))
== sizeof(detail::yes_other_t)));
};
Index: signature_match.hpp
===================================================================
RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/signature_match.hpp,v
retrieving revision 1.3.2.1
retrieving revision 1.3.2.1.2.1
diff -u -d -r1.3.2.1 -r1.3.2.1.2.1
--- signature_match.hpp 27 Jul 2005 21:25:40 -0000 1.3.2.1
+++ signature_match.hpp 24 Oct 2005 00:31:35 -0000 1.3.2.1.2.1
@@ -48,6 +48,7 @@
#include <luabind/detail/primitives.hpp>
#include <luabind/detail/object_rep.hpp>
#include <luabind/detail/class_rep.hpp>
+#include <luabind/detail/most_derived.hpp>
namespace luabind
{
@@ -189,7 +190,7 @@
, Policies const*)
{
typedef constructor<
- T&
+ BOOST_DEDUCED_TYPENAME most_derived<T,WrappedClass>::type&
BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
> params_t;
@@ -213,7 +214,7 @@
, Policies const* policies)
{
typedef constructor<
- T const&
+ BOOST_DEDUCED_TYPENAME most_derived<T,WrappedClass>::type const&
BOOST_PP_ENUM_TRAILING_PARAMS(N, A)
> params_t;
return match_params(
@@ -245,6 +246,10 @@
#if N
int current_index = 0;
#endif
+ // Removes unreferenced local variable warning on VC7.
+ (void)start_index;
+ (void)L;
+
BOOST_PP_REPEAT(N, LUABIND_MATCH_DECL, _)
return m;
}
Index: call.hpp
===================================================================
RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/call.hpp,v
retrieving revision 1.6
retrieving revision 1.6.4.1
diff -u -d -r1.6 -r1.6.4.1
--- call.hpp 7 Aug 2004 13:37:10 -0000 1.6
+++ call.hpp 24 Oct 2005 00:31:35 -0000 1.6.4.1
@@ -41,6 +41,8 @@
#include <luabind/detail/policy.hpp>
#include <luabind/yield_policy.hpp>
+#include <luabind/detail/most_derived.hpp>
+
#define LUABIND_DECL(z, n, off) \
typedef typename find_conversion_policy< \
n + off \
@@ -92,16 +94,6 @@
}
};
- template<class Class, class WrappedClass>
- struct most_derived
- {
- typedef typename boost::mpl::if_<
- boost::is_base_and_derived<Class, WrappedClass>
- , WrappedClass
- , Class
- >::type type;
- };
-
template<class T>
struct returns
{
Index: class_rep.hpp
===================================================================
RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/class_rep.hpp,v
retrieving revision 1.41.2.3.2.2
retrieving revision 1.41.2.3.2.3
diff -u -d -r1.41.2.3.2.2 -r1.41.2.3.2.3
--- class_rep.hpp 10 Oct 2005 08:55:05 -0000 1.41.2.3.2.2
+++ class_rep.hpp 24 Oct 2005 00:31:35 -0000 1.41.2.3.2.3
@@ -42,6 +42,15 @@
#include <luabind/handle.hpp>
#include <luabind/detail/primitives.hpp>
+#ifdef BOOST_MSVC
+// msvc doesn't have two-phase, but requires
+// method_rep (and overload_rep) to be complete
+// because of its std::list implementation.
+// gcc on the other hand has two-phase but doesn't
+// require method_rep to be complete.
+#include <luabind/detail/method_rep.hpp>
+#endif
+
namespace luabind { namespace detail
{
--- NEW FILE: has_get_pointer.hpp ---
// Copyright (c) 2005 Daniel Wallin
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
// ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
// SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
// ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
// OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef LUABIND_HAS_GET_POINTER_051022_HPP
# define LUABIND_HAS_GET_POINTER_051022_HPP
# include <boost/type_traits/add_reference.hpp>
# ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
# include <memory>
# endif
namespace luabind { namespace detail {
namespace has_get_pointer_
{
struct any
{
template<class T> any(T const&);
};
struct no_overload_tag
{};
typedef char (&yes)[1];
typedef char (&no)[2];
no_overload_tag operator,(no_overload_tag, int);
//
// On compilers with ADL, we need these generic overloads in this
// namespace as well as in luabind::. Otherwise get_pointer(any)
// will be found before them.
//
# ifndef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
template<class T>
T* get_pointer(T*);
template<class T>
T* get_pointer(std::auto_ptr<T> const&);
# endif
//
// On compilers that doesn't support ADL, the overload below has to
// live in luabind::.
//
# ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
}} // namespace detail::has_get_pointer_
# endif
detail::has_get_pointer_::no_overload_tag
get_pointer(detail::has_get_pointer_::any);
# ifdef BOOST_NO_ARGUMENT_DEPENDENT_LOOKUP
namespace detail { namespace has_get_pointer_
{
# endif
template<class T>
yes check(T const&);
no check(no_overload_tag);
template<class T>
struct impl
{
static typename boost::add_reference<T>::type x;
BOOST_STATIC_CONSTANT(bool,
value = sizeof(has_get_pointer_::check( (get_pointer(x),0) )) == 1
);
typedef boost::mpl::bool_<value> type;
};
} // namespace has_get_pointer_
template<class T>
struct has_get_pointer
: has_get_pointer_::impl<T>::type
{};
}} // namespace luabind::detail
#endif // LUABIND_HAS_GET_POINTER_051022_HPP
Index: constructor.hpp
===================================================================
RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/constructor.hpp,v
retrieving revision 1.7
retrieving revision 1.7.4.1
diff -u -d -r1.7 -r1.7.4.1
--- constructor.hpp 7 Aug 2004 13:37:10 -0000 1.7
+++ constructor.hpp 24 Oct 2005 00:31:35 -0000 1.7.4.1
@@ -104,7 +104,7 @@
template<class T, class Policies, BOOST_PP_ENUM_PARAMS(LUABIND_MAX_ARITY, class A)>
static T* execute(
lua_State* L
- , weak_ref const& ref
+ , weak_ref const&
, T*
, constructor<BOOST_PP_ENUM_PARAMS(LUABIND_MAX_ARITY,A)>*
, Policies*)
Index: object_rep.hpp
===================================================================
RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/object_rep.hpp,v
retrieving revision 1.19
retrieving revision 1.19.4.1
diff -u -d -r1.19 -r1.19.4.1
--- object_rep.hpp 7 Aug 2004 13:37:10 -0000 1.19
+++ object_rep.hpp 24 Oct 2005 00:31:35 -0000 1.19.4.1
@@ -99,6 +99,8 @@
{
static void apply(void* ptr)
{
+ // Removes unreferenced formal parameter warning on VC7.
+ (void)ptr;
#ifndef NDEBUG
int completeness_check[sizeof(T)];
(void)completeness_check;
--- NEW FILE: most_derived.hpp ---
// Copyright (c) 2005 Daniel Wallin and Arvid Norberg
// Permission is hereby granted, free of charge, to any person obtaining a
// copy of this software and associated documentation files (the "Software"),
// to deal in the Software without restriction, including without limitation
// the rights to use, copy, modify, merge, publish, distribute, sublicense,
// and/or sell copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following conditions:
// The above copyright notice and this permission notice shall be included
// in all copies or substantial portions of the Software.
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF
// ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
// TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT
// SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR
// ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
// ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
// OR OTHER DEALINGS IN THE SOFTWARE.
#ifndef MOST_DERIVED_051018_HPP
# define MOST_DERIVED_051018_HPP
# include <boost/mpl/if.hpp>
# include <boost/type_traits/is_base_and_derived.hpp>
namespace luabind { namespace detail {
template<class Class, class WrappedClass>
struct most_derived
{
typedef typename boost::mpl::if_<
boost::is_base_and_derived<Class, WrappedClass>
, WrappedClass
, Class
>::type type;
};
}} // namespace luabind::detail
#endif // MOST_DERIVED_051018_HPP
Index: policy.hpp
===================================================================
RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/policy.hpp,v
retrieving revision 1.50.2.6
retrieving revision 1.50.2.6.2.1
diff -u -d -r1.50.2.6 -r1.50.2.6.2.1
--- policy.hpp 29 Sep 2005 14:58:31 -0000 1.50.2.6
+++ policy.hpp 24 Oct 2005 00:31:35 -0000 1.50.2.6.2.1
@@ -471,7 +471,7 @@
return;
}
- if (back_reference<T>::extract(L, ptr))
+ if (luabind::get_back_reference(L, ptr))
return;
class_rep* crep = get_class_rep<T>(L);
@@ -565,7 +565,7 @@
template<class T>
void apply(lua_State* L, const T& ref)
{
- if (back_reference<T>::extract(L, &ref))
+ if (luabind::get_back_reference(L, ref))
return;
class_rep* crep = get_class_rep<T>(L);
@@ -711,7 +711,7 @@
return;
}
- if (back_reference<T>::extract(L, ptr))
+ if (luabind::get_back_reference(L, ptr))
return;
class_rep* crep = get_class_rep<T>(L);
@@ -782,7 +782,7 @@
template<class T>
void apply(lua_State* L, T& ref)
{
- if (back_reference<T>::extract(L, &ref))
+ if (luabind::get_back_reference(L, ref))
return;
class_rep* crep = get_class_rep<T>(L);
@@ -840,7 +840,7 @@
template<class T>
void apply(lua_State* L, const T& ref)
{
- if (back_reference<T>::extract(L, &ref))
+ if (luabind::get_back_reference(L, ref))
return;
class_rep* crep = get_class_rep<T>(L);
|