luabind-cvs Mailing List for luabind (Page 6)
Brought to you by:
arvidn,
daniel_wallin
You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(7) |
Oct
(53) |
Nov
(13) |
Dec
(14) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(15) |
Feb
(1) |
Mar
(6) |
Apr
|
May
(5) |
Jun
(7) |
Jul
(5) |
Aug
|
Sep
(2) |
Oct
(5) |
Nov
|
Dec
|
From: Daniel W. <dan...@us...> - 2005-10-02 21:53:36
|
Update of /cvsroot/luabind/luabind/luabind/luabind/detail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25461/detail Modified Files: Tag: daniel-refactoring class_rep.hpp Added Files: Tag: daniel-refactoring class_aux.hpp unspecified.hpp Log Message: Moved parameter deduction metacode to a separate file detail/class_aux.hpp. --- NEW FILE: class_aux.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 LUABIND_CLASS_AUX_051001_HPP #define LUABIND_CLASS_AUX_051001_HPP #include <luabind/config.hpp> #include <boost/mpl/vector.hpp> #include <boost/mpl/find_if.hpp> #include <boost/mpl/not.hpp> #include <boost/mpl/and.hpp> #include <boost/mpl/or.hpp> #include <boost/mpl/end.hpp> #include <boost/mpl/deref.hpp> #include <boost/mpl/identity.hpp> #include <boost/type_traits/is_same.hpp> #include <boost/type_traits/is_base_and_derived.hpp> #include <boost/preprocessor/repetition/enum_params_with_a_default.hpp> namespace luabind { namespace mpl = boost::mpl; namespace detail { struct null_type; } template< BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT( LUABIND_MAX_BASES, class T, detail::null_type ) > struct bases {}; namespace detail { BOOST_PYTHON_IS_XXX_DEF(bases, bases, LUABIND_MAX_BASES) template<class T> struct is_unspecified : mpl::false_ {}; template<> struct is_unspecified<unspecified> : mpl::true_ {}; template<class Parameters, class Predicate, class DefaultValue> struct get_parameter { typedef typename boost::mpl::find_if< Parameters , boost::mpl::and_< boost::mpl::not_<is_unspecified<boost::mpl::_> > , Predicate > >::type iterator; typedef typename boost::mpl::eval_if< boost::is_same< iterator , typename boost::mpl::end<Parameters>::type > , boost::mpl::identity<DefaultValue> , boost::mpl::deref<iterator> >::type type; }; template<class T, class X1, class X2, class X3> struct class_aux { typedef boost::mpl::vector3<X1,X2,X3> arguments; typedef typename get_parameter< arguments , boost::is_base_and_derived<T, boost::mpl::_> , null_type >::type wrapped_type; typedef typename get_parameter< arguments , boost::mpl::not_< boost::mpl::or_< boost::mpl::or_< is_bases<boost::mpl::_> , boost::is_base_and_derived<boost::mpl::_, T> > , boost::is_base_and_derived<T, boost::mpl::_> > > , null_type >::type held_type; typedef typename get_parameter< arguments , boost::mpl::or_< is_bases<boost::mpl::_> , boost::is_base_and_derived<boost::mpl::_, T> > , bases<> >::type bases0; typedef typename boost::mpl::if_< is_bases<bases0> , bases0 , bases<bases0> >::type bases_type; }; }} // namespace luabind::detail #endif // LUABIND_CLASS_AUX_051001_HPP --- NEW FILE: unspecified.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 LUABIND_UNSPECIFIED_051001_HPP #define LUABIND_UNSPECIFIED_051001_HPP namespace luabind { namespace detail { struct unspecified; }} // namespace luabind::detail #endif // LUABIND_UNSPECIFIED_051001_HPP Index: class_rep.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/detail/class_rep.hpp,v retrieving revision 1.41.2.3 retrieving revision 1.41.2.3.2.1 diff -u -d -r1.41.2.3 -r1.41.2.3.2.1 --- class_rep.hpp 29 Sep 2005 14:58:31 -0000 1.41.2.3 +++ class_rep.hpp 2 Oct 2005 00:19:11 -0000 1.41.2.3.2.1 @@ -40,18 +40,10 @@ #include <luabind/detail/find_best_match.hpp> #include <luabind/detail/get_overload_signature.hpp> #include <luabind/error.hpp> -#include <luabind/detail/method_rep.hpp> +//#include <luabind/detail/method_rep.hpp> #include <luabind/handle.hpp> #include <luabind/detail/primitives.hpp> -namespace luabind -{ - - template<BOOST_PP_ENUM_PARAMS_WITH_A_DEFAULT(LUABIND_MAX_BASES, class A, detail::null_type)> - struct bases {}; - typedef bases<detail::null_type> no_bases; -} - namespace luabind { namespace detail { |
From: Daniel W. <dan...@us...> - 2005-09-30 11:28:52
|
Update of /cvsroot/luabind/luabind/luabind/luabind In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22517 Modified Files: Tag: beta7-devel2 object.hpp Log Message: Removed fwd-declaration Index: object.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/object.hpp,v retrieving revision 1.34.2.16 retrieving revision 1.34.2.17 diff -u -d -r1.34.2.16 -r1.34.2.17 --- object.hpp 30 Sep 2005 11:19:53 -0000 1.34.2.16 +++ object.hpp 30 Sep 2005 11:28:42 -0000 1.34.2.17 @@ -44,9 +44,6 @@ namespace luabind { -template<class Derived> -class object_interface; - namespace detail { |
From: Daniel W. <dan...@us...> - 2005-09-30 11:20:05
|
Update of /cvsroot/luabind/luabind/luabind/luabind In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21211 Modified Files: Tag: beta7-devel2 object.hpp Log Message: Operator fix for GCC and VC7.0. ETI fix in is_value_wrapper. Index: object.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/object.hpp,v retrieving revision 1.34.2.15 retrieving revision 1.34.2.16 diff -u -d -r1.34.2.15 -r1.34.2.16 --- object.hpp 29 Sep 2005 23:35:24 -0000 1.34.2.15 +++ object.hpp 30 Sep 2005 11:19:53 -0000 1.34.2.16 @@ -110,13 +110,13 @@ return binary_interpreter( x , y - , BOOST_DEDUCED_TYPENAME value_wrapper_traits<T>::is_specialized() - , BOOST_DEDUCED_TYPENAME value_wrapper_traits<U>::is_specialized() + , is_value_wrapper<T>() + , is_value_wrapper<U>() ); } #define LUABIND_BINARY_OP_DEF(op, fn) \ - template <class LHS, class RHS> \ + template<class LHS, class RHS> \ bool operator op(LHS const& lhs, RHS const& rhs) \ { \ lua_State* L = binary_interpreter(lhs, rhs); \ @@ -135,7 +135,31 @@ LUABIND_BINARY_OP_DEF(<, lua_lessthan) #undef LUABIND_BINARY_OP_DEF - + + template<class LHS, class RHS> + bool operator>(LHS const& lhs, RHS const& rhs) + { + return !(lhs < rhs || lhs == rhs); + } + + template<class LHS, class RHS> + bool operator<=(LHS const& lhs, RHS const& rhs) + { + return lhs < rhs || lhs == rhs; + } + + template<class LHS, class RHS> + bool operator>=(LHS const& lhs, RHS const& rhs) + { + return !(lhs < rhs); + } + + template<class LHS, class RHS> + bool operator!=(LHS const& lhs, RHS const& rhs) + { + return !(lhs < rhs); + } + template<class ValueWrapper, class Arguments> struct call_proxy; @@ -389,22 +413,29 @@ handle m_key; }; -// TODO this should test for VC7<.. -#ifdef __GNUC__ +#if defined(__GNUC__) || BOOST_WORKAROUND(BOOST_MSVC, == 1300) // Needed because of GCC's and VC7's strange ADL - inline bool operator==( - basic_iterator<basic_access> const& x - , basic_iterator<basic_access> const& y) - { - return boost::operator==(x, y); - } - inline bool operator==( - basic_iterator<raw_access> const& x - , basic_iterator<raw_access> const& y) - { - return boost::operator==(x, y); +# define LUABIND_OPERATOR_ADL_WKND(op) \ + inline bool operator op( \ + basic_iterator<basic_access> const& x \ + , basic_iterator<basic_access> const& y) \ + { \ + return boost::operator op(x, y); \ + } \ + \ + inline bool operator op( \ + basic_iterator<raw_access> const& x \ + , basic_iterator<raw_access> const& y) \ + { \ + return boost::operator op(x, y); \ } + + LUABIND_OPERATOR_ADL_WKND(==) + LUABIND_OPERATOR_ADL_WKND(!=) + +# undef LUABIND_OPERATOR_ADL_WKND + #endif } // namespace detail |
From: Daniel W. <dan...@us...> - 2005-09-30 11:19:49
|
Update of /cvsroot/luabind/luabind/luabind/luabind In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21198 Modified Files: Tag: beta7-devel2 value_wrapper.hpp Log Message: Operator fix for GCC and VC7.0. ETI fix in is_value_wrapper. Index: value_wrapper.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/Attic/value_wrapper.hpp,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -d -r1.1.2.6 -r1.1.2.7 --- value_wrapper.hpp 30 Sep 2005 09:22:30 -0000 1.1.2.6 +++ value_wrapper.hpp 30 Sep 2005 11:19:41 -0000 1.1.2.7 @@ -101,7 +101,7 @@ struct is_value_wrapper : boost::mpl::aux::msvc_eti_base< typename value_wrapper_traits<T>::is_specialized - > + >::type {}; } // namespace luabind |
From: Daniel W. <dan...@us...> - 2005-09-30 09:22:38
|
Update of /cvsroot/luabind/luabind/luabind/luabind In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29566 Modified Files: Tag: beta7-devel2 value_wrapper.hpp Log Message: ETI fix for VC7.0. Fixed bug in is_value_wrapper_arg<> for conforming compilers. Index: value_wrapper.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/Attic/value_wrapper.hpp,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -u -d -r1.1.2.5 -r1.1.2.6 --- value_wrapper.hpp 29 Sep 2005 14:58:30 -0000 1.1.2.5 +++ value_wrapper.hpp 30 Sep 2005 09:22:30 -0000 1.1.2.6 @@ -25,6 +25,7 @@ #include <boost/mpl/integral_c.hpp> #include <boost/mpl/bool.hpp> +#include <boost/mpl/aux_/msvc_eti_base.hpp> #ifdef BOOST_NO_TEMPLATE_PARTIAL_SPECIALIZATION # define LUABIND_USE_VALUE_WRAPPER_TAG @@ -97,10 +98,11 @@ #endif template<class T> -struct is_value_wrapper -{ - typedef typename value_wrapper_traits<T>::is_specialized type; -}; +struct is_value_wrapper + : boost::mpl::aux::msvc_eti_base< + typename value_wrapper_traits<T>::is_specialized + > +{}; } // namespace luabind @@ -114,8 +116,8 @@ template<class T> struct is_value_wrapper_arg : is_value_wrapper< - typename boost::remove_reference< - typename boost::remove_const<T>::type + typename boost::remove_const< + typename boost::remove_reference<T>::type >::type > {}; |
From: Daniel W. <dan...@us...> - 2005-09-30 09:19:37
|
Update of /cvsroot/luabind/luabind/luabind/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28775 Modified Files: Tag: beta7-devel2 Jamfile test_object.cpp Added Files: Tag: beta7-devel2 test_value_wrapper.cpp Log Message: Added value_wrapper tests --- NEW FILE: test_value_wrapper.cpp --- // 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. #include <luabind/value_wrapper.hpp> #include <boost/mpl/assert.hpp> struct X_tag; struct X { typedef X_tag value_wrapper_tag; }; namespace luabind { template<> struct value_wrapper_traits<X_tag> { typedef boost::mpl::true_ is_specialized; }; } // namespace luabind BOOST_MPL_ASSERT(( luabind::is_value_wrapper<X> )); BOOST_MPL_ASSERT(( luabind::is_value_wrapper_arg<X> )); BOOST_MPL_ASSERT(( luabind::is_value_wrapper_arg<X const> )); BOOST_MPL_ASSERT(( luabind::is_value_wrapper_arg<X&> )); BOOST_MPL_ASSERT(( luabind::is_value_wrapper_arg<X const&> )); BOOST_MPL_ASSERT_NOT(( luabind::is_value_wrapper_arg<int> )); BOOST_MPL_ASSERT_NOT(( luabind::is_value_wrapper_arg<int[4]> )); BOOST_MPL_ASSERT_NOT(( luabind::is_value_wrapper<X&> )); BOOST_MPL_ASSERT_NOT(( luabind::is_value_wrapper<X const&> )); int main() { } Index: test_object.cpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/test/test_object.cpp,v retrieving revision 1.27.2.5 retrieving revision 1.27.2.6 diff -u -d -r1.27.2.5 -r1.27.2.6 --- test_object.cpp 4 Sep 2005 20:57:04 -0000 1.27.2.5 +++ test_object.cpp 30 Sep 2005 09:19:29 -0000 1.27.2.6 @@ -20,6 +20,7 @@ // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE // OR OTHER DEALINGS IN THE SOFTWARE. + #include "test.hpp" #include <luabind/luabind.hpp> #include <luabind/adopt_policy.hpp> @@ -240,4 +241,3 @@ TEST_CHECK(inner_sum == 1 + 2 + 3 + 4 + 5 + 6 + 7 + 8); TEST_CHECK(object_cast<int>(globals(L)["t"][2][2]) == 4); } - Index: Jamfile =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/test/Jamfile,v retrieving revision 1.15.2.2 retrieving revision 1.15.2.3 diff -u -d -r1.15.2.2 -r1.15.2.3 --- Jamfile 27 Jul 2005 21:25:40 -0000 1.15.2.2 +++ Jamfile 30 Sep 2005 09:19:29 -0000 1.15.2.3 @@ -21,6 +21,7 @@ test_separation.cpp test_simple_class.cpp test_yield.cpp + test_value_wrapper.cpp ; project : default-build <link>static ; |
From: Daniel W. <dan...@us...> - 2005-09-29 23:35:32
|
Update of /cvsroot/luabind/luabind/luabind/luabind In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19975 Modified Files: Tag: beta7-devel2 object.hpp Log Message: Refactored binary operator defintions into a macro Index: object.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/object.hpp,v retrieving revision 1.34.2.14 retrieving revision 1.34.2.15 diff -u -d -r1.34.2.14 -r1.34.2.15 --- object.hpp 29 Sep 2005 22:18:36 -0000 1.34.2.14 +++ object.hpp 29 Sep 2005 23:35:24 -0000 1.34.2.15 @@ -115,36 +115,27 @@ ); } - template <class LHS, class RHS> - bool operator==(LHS const& lhs, RHS const& rhs) - { - lua_State* L = binary_interpreter(lhs, rhs); - - assert(L); - - detail::stack_pop pop1(L, 1); - detail::push(L, lhs); - detail::stack_pop pop2(L, 1); - detail::push(L, rhs); - - return lua_equal(L, -1, -2) != 0; +#define LUABIND_BINARY_OP_DEF(op, fn) \ + template <class LHS, class RHS> \ + bool operator op(LHS const& lhs, RHS const& rhs) \ + { \ + lua_State* L = binary_interpreter(lhs, rhs); \ +\ + assert(L); \ +\ + detail::stack_pop pop1(L, 1); \ + detail::push(L, lhs); \ + detail::stack_pop pop2(L, 1); \ + detail::push(L, rhs); \ +\ + return fn(L, -1, -2) != 0; \ } - template <class LHS, class RHS> - bool operator<(LHS const& lhs, RHS const& rhs) - { - lua_State* L = binary_interpreter(lhs, rhs); - - assert(L); - - detail::stack_pop pop1(L, 1); - detail::push(L, lhs); - detail::stack_pop pop2(L, 1); - detail::push(L, rhs); + LUABIND_BINARY_OP_DEF(==, lua_equal) + LUABIND_BINARY_OP_DEF(<, lua_lessthan) - return lua_lessthan(L, -1, -2); - } - +#undef LUABIND_BINARY_OP_DEF + template<class ValueWrapper, class Arguments> struct call_proxy; |
From: Daniel W. <dan...@us...> - 2005-09-29 22:18:44
|
Update of /cvsroot/luabind/luabind/luabind/luabind In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2695 Modified Files: Tag: beta7-devel2 object.hpp Log Message: testing commit list, third try Index: object.hpp =================================================================== RCS file: /cvsroot/luabind/luabind/luabind/luabind/object.hpp,v retrieving revision 1.34.2.13 retrieving revision 1.34.2.14 diff -u -d -r1.34.2.13 -r1.34.2.14 --- object.hpp 29 Sep 2005 22:16:41 -0000 1.34.2.13 +++ object.hpp 29 Sep 2005 22:18:36 -0000 1.34.2.14 @@ -398,7 +398,7 @@ handle m_key; }; -// TODO this should test for VC7< +// TODO this should test for VC7<.. #ifdef __GNUC__ // Needed because of GCC's and VC7's strange ADL inline bool operator==( |