15 #ifndef __PYIPSDKBASE_PYTHONSTDMAPUTILS_H__ 16 #define __PYIPSDKBASE_PYTHONSTDMAPUTILS_H__ 18 #include <boost/python/suite/indexing/map_indexing_suite.hpp> 26 template <
typename Container>
28 mapToString(
const Container& dataColl)
33 for (
typename Container::const_iterator
34 i = dataColl.begin(), e = dataColl.end(); i != e; ++i) {
41 ss <<
"(" << i->first <<
", " << i->second <<
")";
51 template<
class Container>
53 export_map(
const char* py_name) {
55 boost::python::class_<Container>(py_name)
56 .def(boost::python::map_indexing_suite<Container>())
57 .def(
"__str__", &mapToString<Container>);
61 template<
class Container>
63 export_map_no_str(
const char* py_name) {
65 boost::python::class_<Container>(py_name)
66 .def(boost::python::map_indexing_suite<Container>());
75 #endif // __PYIPSDKBASE_PYTHONSTDMAPUTILS_H__ Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22