First public contribution.
1 // Copyright David Abrahams 2002.
2 // Distributed under the Boost Software License, Version 1.0. (See
3 // accompanying file LICENSE_1_0.txt or copy at
4 // http://www.boost.org/LICENSE_1_0.txt)
5 #ifndef LONG_DWA2002627_HPP
6 # define LONG_DWA2002627_HPP
8 # include <boost/python/detail/prefix.hpp>
10 # include <boost/python/object.hpp>
11 # include <boost/python/converter/pytype_object_mgr_traits.hpp>
13 namespace boost { namespace python {
17 struct BOOST_PYTHON_DECL long_base : object
20 long_base(); // new long_
21 explicit long_base(object_cref rhs);
22 explicit long_base(object_cref rhs, object_cref base);
24 BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(long_base, object)
27 static detail::new_non_null_reference call(object const&);
28 static detail::new_non_null_reference call(object const&, object const&);
32 class long_ : public detail::long_base
34 typedef detail::long_base base;
36 long_() {} // new long_
39 explicit long_(T const& rhs)
40 : detail::long_base(object(rhs))
44 template <class T, class U>
45 explicit long_(T const& rhs, U const& base)
46 : detail::long_base(object(rhs), object(base))
50 public: // implementation detail -- for internal use only
51 BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(long_, base)
55 // Converter Specializations
60 struct object_manager_traits<long_>
61 : pytype_object_manager_traits<&PyLong_Type,long_>
66 }} // namespace boost::python
68 #endif // LONG_DWA2002627_HPP