Chris@16: // Copyright David Abrahams 2002. Chris@16: // Distributed under the Boost Software License, Version 1.0. (See Chris@16: // accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: #ifndef LONG_DWA2002627_HPP Chris@16: # define LONG_DWA2002627_HPP Chris@16: Chris@16: # include Chris@16: Chris@16: # include Chris@16: # include Chris@16: Chris@16: namespace boost { namespace python { Chris@16: Chris@16: namespace detail Chris@16: { Chris@16: struct BOOST_PYTHON_DECL long_base : object Chris@16: { Chris@16: protected: Chris@16: long_base(); // new long_ Chris@16: explicit long_base(object_cref rhs); Chris@16: explicit long_base(object_cref rhs, object_cref base); Chris@16: Chris@16: BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(long_base, object) Chris@16: Chris@16: private: Chris@16: static detail::new_non_null_reference call(object const&); Chris@16: static detail::new_non_null_reference call(object const&, object const&); Chris@16: }; Chris@16: } Chris@16: Chris@16: class long_ : public detail::long_base Chris@16: { Chris@16: typedef detail::long_base base; Chris@16: public: Chris@16: long_() {} // new long_ Chris@16: Chris@16: template Chris@16: explicit long_(T const& rhs) Chris@16: : detail::long_base(object(rhs)) Chris@16: { Chris@16: } Chris@16: Chris@16: template Chris@16: explicit long_(T const& rhs, U const& base) Chris@16: : detail::long_base(object(rhs), object(base)) Chris@16: { Chris@16: } Chris@16: Chris@16: public: // implementation detail -- for internal use only Chris@16: BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(long_, base) Chris@16: }; Chris@16: Chris@16: // Chris@16: // Converter Specializations Chris@16: // Chris@16: namespace converter Chris@16: { Chris@16: template <> Chris@16: struct object_manager_traits Chris@16: : pytype_object_manager_traits<&PyLong_Type,long_> Chris@16: { Chris@16: }; Chris@16: } Chris@16: Chris@16: }} // namespace boost::python Chris@16: Chris@16: #endif // LONG_DWA2002627_HPP