knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
knowrob::py::list_to_pylist< T > Struct Template Reference

#include <list.h>

Static Public Member Functions

static PyObject * convert (const std::list< T > &list)
 
static PyObject * convert (const std::list< T > &list)
 

Detailed Description

template<typename T>
struct knowrob::py::list_to_pylist< T >

handling of std::list, map to Python list.

Definition at line 16 of file list.h.

Member Function Documentation

◆ convert() [1/2]

template<typename T >
static PyObject* knowrob::py::list_to_pylist< T >::convert ( const std::list< T > &  list)
inlinestatic

Definition at line 18 of file list.h.

19  {
20  boost::python::list result;
21  for(const auto& elem : list)
22  {
23  result.append(boost::python::object(elem));
24  }
25  return boost::python::incref(result.ptr());
26  }

◆ convert() [2/2]

template<typename T >
static PyObject* knowrob::py::list_to_pylist< T >::convert ( const std::list< T > &  list)
inlinestatic

Definition at line 18 of file list.h.

19  {
20  boost::python::list result;
21  for(const auto& elem : list)
22  {
23  result.append(boost::python::object(elem));
24  }
25  return boost::python::incref(result.ptr());
26  }

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