From efd89ae564e5e4a63a1b06f8940654e45527e282 Mon Sep 17 00:00:00 2001 From: Joel de Guzman Date: Tue, 17 Sep 2002 23:55:04 +0000 Subject: [PATCH] renamed the stub bases to better reflect the intent. [SVN r15424] --- include/boost/python/detail/defaults_gen.hpp | 50 +++++++++----------- 1 file changed, 23 insertions(+), 27 deletions(-) diff --git a/include/boost/python/detail/defaults_gen.hpp b/include/boost/python/detail/defaults_gen.hpp index 01c22904..78f341f7 100644 --- a/include/boost/python/detail/defaults_gen.hpp +++ b/include/boost/python/detail/defaults_gen.hpp @@ -45,19 +45,17 @@ namespace boost { namespace python { }; } -// func_stubs_with_call_policies is generated by the -// func_stubs_with_default_call_policies operator[] -// (see below). This class holds a user defined call policies -// of the stubs. +// func_stubs_proxy is generated by the func_stubs_common operator[] (see +// below). This class holds a user defined call policies of the stubs. template -struct func_stubs_with_call_policies +struct func_stubs_proxy : public detail::func_stubs_base { typedef typename StubsT::nv_type nv_type; typedef typename StubsT::v_type v_type; - func_stubs_with_call_policies(CallPoliciesT const& policies_, char const* doc) + func_stubs_proxy(CallPoliciesT const& policies_, char const* doc) : detail::func_stubs_base(doc), policies(policies_) {} CallPoliciesT @@ -67,17 +65,15 @@ struct func_stubs_with_call_policies CallPoliciesT policies; }; -// func_stubs_with_default_call_policies is our default -// function stubs base class. This class returns the -// default_call_policies in its call_policies() member function. -// It can generate a func_stubs_with_call_policies however -// through its operator[] +// func_stubs_common is our default function stubs base class. This class +// returns the default_call_policies in its call_policies() member function. +// It can generate a func_stubs_proxy however through its operator[] template -struct func_stubs_with_default_call_policies +struct func_stubs_common : public detail::func_stubs_base { - func_stubs_with_default_call_policies(char const* doc) + func_stubs_common(char const* doc) : detail::func_stubs_base(doc) {} default_call_policies @@ -85,10 +81,10 @@ struct func_stubs_with_default_call_policies { return default_call_policies(); } template - ::boost::python::func_stubs_with_call_policies + ::boost::python::func_stubs_proxy operator[](CallPoliciesT const& policies) const { - return func_stubs_with_call_policies + return func_stubs_proxy (policies, doc); } }; @@ -191,14 +187,14 @@ struct func_stubs_with_default_call_policies BOOST_PYTHON_GEN_FUNCTION \ (fname, BOOST_PP_CAT(fstubs_name, _V), n_args, n_dflts, ;) \ struct fstubs_name \ - : public boost::python::func_stubs_with_default_call_policies \ + : public boost::python::func_stubs_common \ { \ typedef BOOST_PP_CAT(fstubs_name, _NV) nv_type; \ typedef BOOST_PP_CAT(fstubs_name, _V) v_type; \ \ fstubs_name(char const* doc = 0) \ : boost::python:: \ - func_stubs_with_default_call_policies(doc) {} \ + func_stubs_common(doc) {} \ }; \ /////////////////////////////////////////////////////////////////////////////// @@ -208,14 +204,14 @@ struct func_stubs_with_default_call_policies BOOST_PYTHON_GEN_MEM_FUNCTION \ (fname, BOOST_PP_CAT(fstubs_name, _V), n_args, n_dflts, ;) \ struct fstubs_name \ - : public boost::python::func_stubs_with_default_call_policies \ + : public boost::python::func_stubs_common \ { \ typedef BOOST_PP_CAT(fstubs_name, _NV) nv_type; \ typedef BOOST_PP_CAT(fstubs_name, _V) v_type; \ \ fstubs_name(char const* doc = 0) \ : boost::python:: \ - func_stubs_with_default_call_policies(doc) {} \ + func_stubs_common(doc) {} \ }; \ #else @@ -225,14 +221,14 @@ struct func_stubs_with_default_call_policies BOOST_PYTHON_GEN_FUNCTION \ (fname, BOOST_PP_CAT(fstubs_name, _NV), n_args, n_dflts, return) \ struct fstubs_name \ - : public boost::python::func_stubs_with_default_call_policies \ + : public boost::python::func_stubs_common \ { \ typedef BOOST_PP_CAT(fstubs_name, _NV) nv_type; \ typedef BOOST_PP_CAT(fstubs_name, _NV) v_type; \ \ fstubs_name(char const* doc = 0) \ : boost::python:: \ - func_stubs_with_default_call_policies(doc) {} \ + func_stubs_common(doc) {} \ }; \ /////////////////////////////////////////////////////////////////////////////// @@ -240,14 +236,14 @@ struct func_stubs_with_default_call_policies BOOST_PYTHON_GEN_MEM_FUNCTION \ (fname, BOOST_PP_CAT(fstubs_name, _NV), n_args, n_dflts, return) \ struct fstubs_name \ - : public boost::python::func_stubs_with_default_call_policies \ + : public boost::python::func_stubs_common \ { \ typedef BOOST_PP_CAT(fstubs_name, _NV) nv_type; \ typedef BOOST_PP_CAT(fstubs_name, _NV) v_type; \ \ fstubs_name(char const* doc = 0) \ : boost::python:: \ - func_stubs_with_default_call_policies(doc) {} \ + func_stubs_common(doc) {} \ }; \ #endif // defined(BOOST_MSVC) @@ -316,14 +312,14 @@ struct func_stubs_with_default_call_policies // }; // // struct foo_stubs -// : public boost::python::func_stubs_with_default_call_policies +// : public boost::python::func_stubs_common // // typedef foo_stubs_NV nv_type; // typedef foo_stubs_NV v_type; // // fstubs_name(char const* doc = 0) // : boost::python:: -// func_stubs_with_default_call_policies(doc) {} +// func_stubs_common(doc) {} // }; // // The typedefs nv_type and v_type are used to handle compilers that @@ -333,8 +329,8 @@ struct func_stubs_with_default_call_policies // The "V" version is almost identical to the "NV" version except // for the return type (void) and the lack of the return keyword. // -// See the func_stubs_with_default_call_policies above for a description -// of the foo_stubs' base class. +// See the func_stubs_common above for a description of the foo_stubs' +// base class. // /////////////////////////////////////////////////////////////////////////////// #define BOOST_PYTHON_FUNCTION_OVERLOADS(generator_name, fname, min_args, max_args) \