From 75a0da31fbe71be938d7c9963dad55da1ea42990 Mon Sep 17 00:00:00 2001 From: uid30600 Date: Mon, 9 Sep 2002 20:05:17 +0000 Subject: [PATCH] Reduce header interdependencies [SVN r15242] --- include/boost/python/back_reference.hpp | 2 +- include/boost/python/class.hpp | 6 ++++-- include/boost/python/converter/arg_to_python.hpp | 3 ++- .../boost/python/converter/return_from_python.hpp | 3 ++- include/boost/python/detail/void_return.hpp | 2 ++ include/boost/python/enum.hpp | 1 + include/boost/python/extract.hpp | 1 + include/boost/python/object/class.hpp | 3 ++- include/boost/python/object/enum_base.hpp | 2 ++ include/boost/python/object/instance.hpp | 5 +++++ include/boost/python/object/make_holder.hpp | 2 ++ include/boost/python/object/pickle_support.hpp | 10 +++++++--- include/boost/python/object_core.hpp | 14 ++++++-------- include/boost/python/object_operators.hpp | 1 + include/boost/python/object_slices.hpp | 1 + src/object_operators.cpp | 6 +++++- test/data_members.cpp | 1 - test/object_manager.cpp | 1 + 18 files changed, 45 insertions(+), 19 deletions(-) diff --git a/include/boost/python/back_reference.hpp b/include/boost/python/back_reference.hpp index 29ad6163..75a14525 100644 --- a/include/boost/python/back_reference.hpp +++ b/include/boost/python/back_reference.hpp @@ -6,9 +6,9 @@ #ifndef BACK_REFERENCE_DWA2002510_HPP # define BACK_REFERENCE_DWA2002510_HPP -# include # include # include +# include namespace boost { namespace python { diff --git a/include/boost/python/class.hpp b/include/boost/python/class.hpp index 918de0ec..918cf4d2 100644 --- a/include/boost/python/class.hpp +++ b/include/boost/python/class.hpp @@ -7,10 +7,12 @@ # define CLASS_DWA200216_HPP # include +# include # include # include -# include -# include + +# include + # include # include # include diff --git a/include/boost/python/converter/arg_to_python.hpp b/include/boost/python/converter/arg_to_python.hpp index c936b81d..7abb274c 100755 --- a/include/boost/python/converter/arg_to_python.hpp +++ b/include/boost/python/converter/arg_to_python.hpp @@ -10,7 +10,6 @@ # include # include # include -# include # include # include # include @@ -26,6 +25,8 @@ namespace boost { namespace python { namespace converter { +template struct is_object_manager; + namespace detail { BOOST_PYTHON_DECL void throw_no_class_registered(); diff --git a/include/boost/python/converter/return_from_python.hpp b/include/boost/python/converter/return_from_python.hpp index 490d4bf7..f02f01d9 100755 --- a/include/boost/python/converter/return_from_python.hpp +++ b/include/boost/python/converter/return_from_python.hpp @@ -6,7 +6,6 @@ #ifndef RETURN_FROM_PYTHON_DWA200265_HPP # define RETURN_FROM_PYTHON_DWA200265_HPP -# include # include # include # include @@ -17,6 +16,8 @@ namespace boost { namespace python { namespace converter { +template struct is_object_manager; + namespace detail { template diff --git a/include/boost/python/detail/void_return.hpp b/include/boost/python/detail/void_return.hpp index 28e919d7..512aa636 100644 --- a/include/boost/python/detail/void_return.hpp +++ b/include/boost/python/detail/void_return.hpp @@ -6,6 +6,8 @@ #ifndef VOID_RETURN_DWA200274_HPP # define VOID_RETURN_DWA200274_HPP +# include + namespace boost { namespace python { namespace detail { struct void_return diff --git a/include/boost/python/enum.hpp b/include/boost/python/enum.hpp index d09c1b68..f7d06075 100644 --- a/include/boost/python/enum.hpp +++ b/include/boost/python/enum.hpp @@ -8,6 +8,7 @@ # include # include +# include namespace boost { namespace python { diff --git a/include/boost/python/extract.hpp b/include/boost/python/extract.hpp index 16efb3bf..fdcaac28 100644 --- a/include/boost/python/extract.hpp +++ b/include/boost/python/extract.hpp @@ -16,6 +16,7 @@ # include # include # include +# include namespace boost { namespace python { diff --git a/include/boost/python/object/class.hpp b/include/boost/python/object/class.hpp index 69bc5b20..e97f8edd 100644 --- a/include/boost/python/object/class.hpp +++ b/include/boost/python/object/class.hpp @@ -11,6 +11,7 @@ # include # include # include +# include # include namespace boost { namespace python { @@ -24,7 +25,7 @@ struct BOOST_PYTHON_DECL class_base : python::api::object char const* name // The name of the class , std::size_t num_types // A list of class_ids. The first is the type - , class_id const*const types // this is wrapping. The rest are the types of + , type_info const*const types // this is wrapping. The rest are the types of // any bases. , char const* doc = 0 // Docstring, if any. diff --git a/include/boost/python/object/enum_base.hpp b/include/boost/python/object/enum_base.hpp index 60bd49b1..37cd8f17 100644 --- a/include/boost/python/object/enum_base.hpp +++ b/include/boost/python/object/enum_base.hpp @@ -9,6 +9,8 @@ # include # include # include +# include +# include namespace boost { namespace python { namespace objects { diff --git a/include/boost/python/object/instance.hpp b/include/boost/python/object/instance.hpp index c64ce33d..94e526b2 100644 --- a/include/boost/python/object/instance.hpp +++ b/include/boost/python/object/instance.hpp @@ -10,6 +10,11 @@ # include # include +namespace boost { namespace python +{ + struct instance_holder; +}} // namespace boost::python + namespace boost { namespace python { namespace objects { // Each extension instance will be one of these diff --git a/include/boost/python/object/make_holder.hpp b/include/boost/python/object/make_holder.hpp index 933159da..429704a3 100644 --- a/include/boost/python/object/make_holder.hpp +++ b/include/boost/python/object/make_holder.hpp @@ -9,6 +9,8 @@ # ifndef MAKE_HOLDER_DWA20011215_HPP # define MAKE_HOLDER_DWA20011215_HPP +# include + # include # include # include diff --git a/include/boost/python/object/pickle_support.hpp b/include/boost/python/object/pickle_support.hpp index bae05138..a5a67cc2 100644 --- a/include/boost/python/object/pickle_support.hpp +++ b/include/boost/python/object/pickle_support.hpp @@ -6,11 +6,15 @@ #ifndef BOOST_PYTHON_OBJECT_PICKLE_SUPPORT_RWGK20020603_HPP #define BOOST_PYTHON_OBJECT_PICKLE_SUPPORT_RWGK20020603_HPP -#include -#include - namespace boost { namespace python { +namespace api +{ + class object; +} +using api::object; +class tuple; + BOOST_PYTHON_DECL object const& make_instance_reduce_function(); struct pickle_suite; diff --git a/include/boost/python/object_core.hpp b/include/boost/python/object_core.hpp index 5d95946c..6b07d659 100755 --- a/include/boost/python/object_core.hpp +++ b/include/boost/python/object_core.hpp @@ -8,13 +8,13 @@ # include -# include -# include +# include +# include # include # include # include # include -# include +# include # include # include @@ -222,7 +222,7 @@ namespace api } // Throw error_already_set() if the handle is null. - explicit object(handle<> const&); + BOOST_PYTHON_DECL explicit object(handle<> const&); public: // implementation detail -- for internal use only explicit object(detail::borrowed_reference); @@ -312,10 +312,6 @@ template struct extract; // implementation // -inline object::object(handle<> const& x) - : object_base(python::incref(python::expect_non_null(x.get()))) -{} - inline object::object() : object_base(python::incref(Py_None)) {} @@ -364,6 +360,8 @@ inline PyObject* api::object_base::ptr() const // namespace converter { + template struct object_manager_traits; + template <> struct object_manager_traits { diff --git a/include/boost/python/object_operators.hpp b/include/boost/python/object_operators.hpp index 801218e6..fb14d484 100644 --- a/include/boost/python/object_operators.hpp +++ b/include/boost/python/object_operators.hpp @@ -7,6 +7,7 @@ # define OBJECT_OPERATORS_DWA2002617_HPP # include +# include namespace boost { namespace python { namespace api { diff --git a/include/boost/python/object_slices.hpp b/include/boost/python/object_slices.hpp index a4348efc..eb8dcb0b 100644 --- a/include/boost/python/object_slices.hpp +++ b/include/boost/python/object_slices.hpp @@ -9,6 +9,7 @@ # include # include # include +# include # include namespace boost { namespace python { namespace api { diff --git a/src/object_operators.cpp b/src/object_operators.cpp index 471f01ad..b7c984ef 100644 --- a/src/object_operators.cpp +++ b/src/object_operators.cpp @@ -49,5 +49,9 @@ BOOST_PYTHON_INPLACE_OPERATOR(&, And) BOOST_PYTHON_INPLACE_OPERATOR(^, Xor) BOOST_PYTHON_INPLACE_OPERATOR(|, Or) #undef BOOST_PYTHON_INPLACE_OPERATOR - + +BOOST_PYTHON_DECL object::object(handle<> const& x) + : object_base(python::incref(python::expect_non_null(x.get()))) +{} + }}} // namespace boost::python diff --git a/test/data_members.cpp b/test/data_members.cpp index 5ab73438..99459dff 100644 --- a/test/data_members.cpp +++ b/test/data_members.cpp @@ -5,7 +5,6 @@ // to its suitability for any purpose. #include #include -#include #include "test_class.hpp" #if defined(_AIX) && defined(__EDG_VERSION__) && __EDG_VERSION__ < 245 diff --git a/test/object_manager.cpp b/test/object_manager.cpp index 0f1851c5..44005aeb 100755 --- a/test/object_manager.cpp +++ b/test/object_manager.cpp @@ -6,6 +6,7 @@ #include #include #include +#include using namespace boost::python; using namespace boost::python::converter;