std::vector<std::string> pb

Hello, Sorry to reiterate but if it's not the right forum to send this kind of message, I would really appreciate that sb tells me where to post it, because I'm stuck. Thanks for helping Lana /*****************************/ Hello, I am using boost for the first time. I have the following boost.cpp file: #include "../confDBAPIpython/test1.h" #include <boost/python.hpp> #include <boost/python/suite/indexing/vector_indexing_suite.hpp> #include <boost/python/module.hpp> #include <boost/python/def.hpp> #include <boost/python/implicit.hpp> using namespace boost::python; BOOST_PYTHON_MODULE(confDBAPIpython) { // Compile check only... class_<std::vector<int> >("IntVec") .def(vector_indexing_suite<std::vector<int> >()); class_<std::vector<std::string> >("StringVec") .def(vector_indexing_suite<std::vector<std::string> >()); def("DBConnexion",PyDBConnexion); def("DBDeconnexion",PyDBDeconnexion); def("GetDeviceTypeRow",PyGetDeviceTypeRow); def("GetDeviceRow_devicename",PyGetDeviceRow_devicename); def("GetDeviceRow_deviceid",PyGetDeviceRow_deviceid); def("GetDetailedConnectivityBetweenDevices",PyGetDetailedConnectivityBet weenDevices); def("GetConnectivityBetweenDevices",PyGetConnectivityBetweenDevices); } The two last fct returns vector<std::string>. When I try to use them in python, I have the following error message: list_str=libconfDBAPIpython.GetConnectivityBetweenDevices("TFC","THOR_00 ","ECAL_L1FE06_02_00"); print list_str[0]; Traceback (most recent call last): File "<stdin>", line 1, in ? TypeError: No Python class registered for C++ class std::string I don't understand why. I thought it will be handled by the vector_indexing_suite. I have no problem when a fcuntion returns a string or a vector<int> Thanks for helping Lana

Lana Abadie wrote:
Hello, Sorry to reiterate but if it's not the right forum to send this kind of message, I would really appreciate that sb tells me where to post it, because I'm stuck. Thanks for helping Lana /*****************************/
Hi Lana, I'm sorry I wasn't able to reply as soon as possible. Yes, the proper forum is: C++-sig mailing list C++-sig@python.org http://mail.python.org/mailman/listinfo/c++-sig Anyway, here are some links that you might find useful: http://mail.python.org/pipermail/c++-sig/2004-March/007025.html http://mail.python.org/pipermail/c++-sig/2004-March/007028.html http://mail.python.org/pipermail/c++-sig/2004-March/007029.html Cheers, -- Joel de Guzman http://www.boost-consulting.com http://spirit.sf.net
participants (2)
-
Joel de Guzman
-
Lana Abadie