casacore
|
Conversion of Python sequence to C++ container. More...
#include <PycBasicData.h>
Public Types | |
typedef ContainerType::value_type | container_element_type |
Public Member Functions | |
from_python_sequence () | |
Static Public Member Functions | |
static void * | convertible (PyObject *obj_ptr) |
Appears to return obj_ptr if it is type of Python sequence that can be convertible to C++ container. More... | |
static void | construct (PyObject *obj_ptr, boost::python::converter::rvalue_from_python_stage1_data *data) |
Constructs a C++ container from a Python sequence. More... | |
static ContainerType | make_container (PyObject *obj_ptr) |
Constructs a C++ container from a Python sequence. More... | |
Static Private Member Functions | |
static void | fill_container (ContainerType &result, PyObject *obj_ptr) |
static bool | check_convertibility (PyObject *obj_ptr) |
Conversion of Python sequence to C++ container.
Copied from scitbx/include/scitbx/boost_python/container_conversions.h that is described in the Boost.Python FAQ.
Definition at line 414 of file PycBasicData.h.
typedef ContainerType::value_type casacore::python::from_python_sequence< ContainerType, ConversionPolicy >::container_element_type |
Definition at line 416 of file PycBasicData.h.
|
inline |
Definition at line 418 of file PycBasicData.h.
References casacore::python::from_python_sequence< ContainerType, ConversionPolicy >::construct(), and casacore::python::from_python_sequence< ContainerType, ConversionPolicy >::convertible().
|
inlinestaticprivate |
All elements in a range and array have the same type, so need to check the first element only.
Definition at line 540 of file PycBasicData.h.
Referenced by casacore::python::from_python_sequence< ContainerType, ConversionPolicy >::convertible().
|
inlinestatic |
Constructs a C++ container from a Python sequence.
ConversionPolicy::reserve(result, 1); ConversionPolicy::set_value(result, 0, extract<container_element_type>(py_flat.attr("__getitem__")(0)));
Definition at line 476 of file PycBasicData.h.
References casacore::python::from_python_sequence< ContainerType, ConversionPolicy >::fill_container(), casacore::python::getSeqObject(), and casacore::python::PycArrayScalarCheck().
Referenced by casacore::python::from_python_sequence< ContainerType, ConversionPolicy >::from_python_sequence().
|
inlinestatic |
Appears to return obj_ptr if it is type of Python sequence that can be convertible to C++ container.
Accept single values.
An array scalar is accepted.
Get the sequence object. It can be a numarray/numpy scalar in which case it fills py_obj with a flattened array.
Check the sequence. It must be convertible to an iterator.
Definition at line 428 of file PycBasicData.h.
References casacore::python::from_python_sequence< ContainerType, ConversionPolicy >::check_convertibility(), casacore::python::getSeqObject(), and casacore::python::PycArrayScalarCheck().
Referenced by casacore::python::from_python_sequence< ContainerType, ConversionPolicy >::from_python_sequence().
|
inlinestaticprivate |
Definition at line 522 of file PycBasicData.h.
Referenced by casacore::python::from_python_sequence< ContainerType, ConversionPolicy >::construct(), and casacore::python::from_python_sequence< ContainerType, ConversionPolicy >::make_container().
|
inlinestatic |
Constructs a C++ container from a Python sequence.
Definition at line 514 of file PycBasicData.h.
References casacore::python::from_python_sequence< ContainerType, ConversionPolicy >::fill_container().