Loading...
Searching...
No Matches
casacore::python::to_list< ContainerType > Struct Template Reference

A wrapper of a conversion function to convert a STL vector to a Python list. More...

`#include <PycBasicData.h>`

## Static Public Member Functions

static boost::python::object | makeobject (ContainerType const &c)
| Creates and returns a Python list from the elements copied from a STL container.
static PyObject * | convert (ContainerType const &c)

## Detailed Description

template<typename ContainerType>
struct casacore::python::to_list< ContainerType >

A wrapper of a conversion function to convert a STL vector to a Python list.

This class satisfies the requirements of the boost::python::to_python_converter conversion template argument.

Copied from scitbx/include/scitbx/boost_python/container_conversions.h that is described in the Boost.Python FAQ.

Author
  Ralf W. Grosse-Kunstleve rwgk@.nosp@m.yaho.nosp@m.o.com of Lawrence Berkeley National Laboratory

Definition at line 232 of file PycBasicData.h.

## Member Function Documentation

## convert()

template<typename ContainerType>

PyObject * casacore::python::to_list< ContainerType >::convert | ( | ContainerType const & | c | ) |

inline static

Definition at line 249 of file PycBasicData.h.

References makeobject().

## makeobject()

template<typename ContainerType>

boost::python::object casacore::python::to_list< ContainerType >::makeobject | ( | ContainerType const & | c | ) |

inline static

Creates and returns a Python list from the elements copied from a STL container.

The ContainerType must be a container with STL iterators defined on it. It may contain any type of object supported by the boost::python::object constructor.

Definition at line 239 of file PycBasicData.h.

Referenced by convert(), casacore::python::to_list< casacore::Array< casacore::String > >::convert(), casacore::python::to_list< casacore::IPosition >::convert(), casacore::python::to_list< casacore::Vector< casacore::String > >::convert(), casacore::python::to_list< std::vector< bool > >::convert(), and casacore::python::to_list< std::vector< casacore::String > >::convert().

The documentation for this struct was generated from the following file:

- python/Converters/PycBasicData.h