knowrob  2.1.0
A Knowledge Base System for Cognition-enabled Robots
knowrob::py::DictToMapConverter Struct Reference

#include <dict.h>

Static Public Member Functions

static void * convertible (PyObject *obj_ptr)
 
static void construct (PyObject *obj_ptr, boost::python::converter::rvalue_from_python_stage1_data *data)
 
static void * convertible (PyObject *obj_ptr)
 
static void construct (PyObject *obj_ptr, boost::python::converter::rvalue_from_python_stage1_data *data)
 

Detailed Description

Definition at line 44 of file dict.h.

Member Function Documentation

◆ construct() [1/2]

static void knowrob::py::DictToMapConverter::construct ( PyObject *  obj_ptr,
boost::python::converter::rvalue_from_python_stage1_data *  data 
)
inlinestatic

Definition at line 50 of file dict.h.

50  {
51  void *storage = ((boost::python::converter::rvalue_from_python_storage<std::unordered_map<std::string, boost::any>> *) data)->storage.bytes;
52  new(storage) std::unordered_map<std::string, boost::any>(
53  dict_to_map(boost::python::dict(boost::python::borrowed(obj_ptr))));
54  data->convertible = storage;
55  }
std::unordered_map< std::string, boost::any > dict_to_map(const boost::python::dict &py_dict)
Definition: dict.h:32

◆ construct() [2/2]

static void knowrob::py::DictToMapConverter::construct ( PyObject *  obj_ptr,
boost::python::converter::rvalue_from_python_stage1_data *  data 
)
inlinestatic

Definition at line 50 of file dict.h.

50  {
51  void *storage = ((boost::python::converter::rvalue_from_python_storage<std::unordered_map<std::string, boost::any>> *) data)->storage.bytes;
52  new(storage) std::unordered_map<std::string, boost::any>(
53  dict_to_map(boost::python::dict(boost::python::borrowed(obj_ptr))));
54  data->convertible = storage;
55  }

◆ convertible() [1/2]

static void* knowrob::py::DictToMapConverter::convertible ( PyObject *  obj_ptr)
inlinestatic

Definition at line 45 of file dict.h.

45  {
46  if (!PyDict_Check(obj_ptr)) return 0;
47  return obj_ptr;
48  }

◆ convertible() [2/2]

static void* knowrob::py::DictToMapConverter::convertible ( PyObject *  obj_ptr)
inlinestatic

Definition at line 45 of file dict.h.

45  {
46  if (!PyDict_Check(obj_ptr)) return 0;
47  return obj_ptr;
48  }

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