1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/python/long.hpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,68 @@
1.4 +// Copyright David Abrahams 2002.
1.5 +// Distributed under the Boost Software License, Version 1.0. (See
1.6 +// accompanying file LICENSE_1_0.txt or copy at
1.7 +// http://www.boost.org/LICENSE_1_0.txt)
1.8 +#ifndef LONG_DWA2002627_HPP
1.9 +# define LONG_DWA2002627_HPP
1.10 +
1.11 +# include <boost/python/detail/prefix.hpp>
1.12 +
1.13 +# include <boost/python/object.hpp>
1.14 +# include <boost/python/converter/pytype_object_mgr_traits.hpp>
1.15 +
1.16 +namespace boost { namespace python {
1.17 +
1.18 +namespace detail
1.19 +{
1.20 + struct BOOST_PYTHON_DECL long_base : object
1.21 + {
1.22 + protected:
1.23 + long_base(); // new long_
1.24 + explicit long_base(object_cref rhs);
1.25 + explicit long_base(object_cref rhs, object_cref base);
1.26 +
1.27 + BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(long_base, object)
1.28 +
1.29 + private:
1.30 + static detail::new_non_null_reference call(object const&);
1.31 + static detail::new_non_null_reference call(object const&, object const&);
1.32 + };
1.33 +}
1.34 +
1.35 +class long_ : public detail::long_base
1.36 +{
1.37 + typedef detail::long_base base;
1.38 + public:
1.39 + long_() {} // new long_
1.40 +
1.41 + template <class T>
1.42 + explicit long_(T const& rhs)
1.43 + : detail::long_base(object(rhs))
1.44 + {
1.45 + }
1.46 +
1.47 + template <class T, class U>
1.48 + explicit long_(T const& rhs, U const& base)
1.49 + : detail::long_base(object(rhs), object(base))
1.50 + {
1.51 + }
1.52 +
1.53 + public: // implementation detail -- for internal use only
1.54 + BOOST_PYTHON_FORWARD_OBJECT_CONSTRUCTORS(long_, base)
1.55 +};
1.56 +
1.57 +//
1.58 +// Converter Specializations
1.59 +//
1.60 +namespace converter
1.61 +{
1.62 + template <>
1.63 + struct object_manager_traits<long_>
1.64 + : pytype_object_manager_traits<&PyLong_Type,long_>
1.65 + {
1.66 + };
1.67 +}
1.68 +
1.69 +}} // namespace boost::python
1.70 +
1.71 +#endif // LONG_DWA2002627_HPP