5 #ifndef __pinocchio_python_utils_map_hpp__ 
    6 #define __pinocchio_python_utils_map_hpp__ 
    8 #include <boost/python/suite/indexing/map_indexing_suite.hpp> 
   16       template<
typename Container>
 
   18       : 
public boost::python::def_visitor<overload_base_get_item_for_std_map<Container>>
 
   21         typedef typename Container::value_type::second_type 
data_type;
 
   32         static boost::python::object
 
   33         base_get_item(boost::python::back_reference<Container &> container, PyObject * i_)
 
   35           namespace bp = ::boost::python;
 
   38           typename Container::iterator 
i = container.get().find(idx);
 
   39           if (
i == container.get().end())
 
   41             PyErr_SetString(PyExc_KeyError, 
"Invalid key");
 
   42             bp::throw_error_already_set();
 
   45           typename bp::to_python_indirect<data_type &, bp::detail::make_reference_holder> convert;
 
   46           return bp::object(bp::handle<>(convert(
i->second)));
 
   51           namespace bp = ::boost::python;
 
   52           bp::extract<key_type const &> 
i(i_);
 
   59             bp::extract<key_type> 
i(i_);
 
   64           PyErr_SetString(PyExc_TypeError, 
"Invalid index type");
 
   65           bp::throw_error_already_set();
 
   74 #endif // ifndef __pinocchio_python_utils_map_hpp__