|
Last change
on this file since 30 was
29,
checked in by landauf, 17 years ago
|
|
updated boost from 1_33_1 to 1_34_1
|
|
File size:
908 bytes
|
| Line | |
|---|
| 1 | #include "boost/python/slice.hpp" |
|---|
| 2 | |
|---|
| 3 | // Copyright (c) 2004 Jonathan Brandmeyer |
|---|
| 4 | // Use, modification and distribution are subject to the |
|---|
| 5 | // Boost Software License, Version 1.0. (See accompanying file |
|---|
| 6 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
|---|
| 7 | |
|---|
| 8 | |
|---|
| 9 | namespace boost { namespace python { namespace detail { |
|---|
| 10 | |
|---|
| 11 | slice_base::slice_base(PyObject* start, PyObject* stop, PyObject* step) |
|---|
| 12 | : object(detail::new_reference( PySlice_New(start, stop, step))) |
|---|
| 13 | { |
|---|
| 14 | } |
|---|
| 15 | |
|---|
| 16 | object |
|---|
| 17 | slice_base::start() const |
|---|
| 18 | { |
|---|
| 19 | return object( detail::borrowed_reference( |
|---|
| 20 | ((PySliceObject*)this->ptr())->start)); |
|---|
| 21 | } |
|---|
| 22 | |
|---|
| 23 | object |
|---|
| 24 | slice_base::stop() const |
|---|
| 25 | { |
|---|
| 26 | return object( detail::borrowed_reference( |
|---|
| 27 | ((PySliceObject*)this->ptr())->stop)); |
|---|
| 28 | } |
|---|
| 29 | |
|---|
| 30 | object |
|---|
| 31 | slice_base::step() const |
|---|
| 32 | { |
|---|
| 33 | return object( detail::borrowed_reference( |
|---|
| 34 | ((PySliceObject*)this->ptr())->step)); |
|---|
| 35 | } |
|---|
| 36 | |
|---|
| 37 | } } } // !namespace boost::python::detail |
|---|
Note: See
TracBrowser
for help on using the repository browser.