• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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 #include <boost/python/long.hpp>
6 
7 namespace boost { namespace python { namespace detail {
8 
call(object const & arg_)9 new_non_null_reference long_base::call(object const& arg_)
10 {
11     return (detail::new_non_null_reference)PyObject_CallFunction(
12         (PyObject*)&PyLong_Type, const_cast<char*>("(O)"),
13         arg_.ptr());
14 }
15 
call(object const & arg_,object const & base)16 new_non_null_reference long_base::call(object const& arg_, object const& base)
17 {
18     return (detail::new_non_null_reference)PyObject_CallFunction(
19         (PyObject*)&PyLong_Type, const_cast<char*>("(OO)"),
20         arg_.ptr(), base.ptr());
21 }
22 
long_base()23 long_base::long_base()
24     : object(
25         detail::new_reference(
26             PyObject_CallFunction((PyObject*)&PyLong_Type, const_cast<char*>("()")))
27         )
28 {}
29 
long_base(object_cref arg)30 long_base::long_base(object_cref arg)
31     : object(long_base::call(arg))
32 {}
33 
long_base(object_cref arg,object_cref base)34 long_base::long_base(object_cref arg, object_cref base)
35     : object(long_base::call(arg, base))
36 {}
37 
38 
39 }}} // namespace boost::python
40