I am trying to expose a C++ function in Python.
This function does not take any inputs, and it returns a structure which
consists of a string array and a multidimentional integer array.
When I try to compile it, it gives me following error:
c:\boost\boost/python/detail/caller.hpp(199) : error C2027: use of
undefined type
'boost::python::detail::specify_a_return_value_policy_to_wrap_functions_returning<T>'
with
[
T=result_t
]
c:\boost\boost/python/detail/caller.hpp(176) : while compiling
class template member function 'PyObject
*boost::python::detail::caller_arity<1>::impl::operator
()(PyObject *,PyObject *)'
with
[
F=DQEasy *(__thiscall DQEasy::* )(void),
Policies=boost::python::default_call_policies,
Sig=boost::mpl::vector2
]
/////////////
My function looks like this:
DQEasy*
DQEasy::RequestToResponse()
{
int size(0);
std::string user = "O066144";
std::string url = "dataquery-dev.ny.jpmorgan.com:6555";
DQP* request = getBaseRequest();
addValidContext(request, user);
std::string expressionList[] = {"DB(FHR,TB3,MIDYLD)","DB(FHR,TB6,MIDYLD)"};
size = sizeof(expressionList)/sizeof(std::string);
DQEasy::addExressions(request, expressionList, size);
std::string outputTypeArray[] = {"data","stats"};
size = sizeof(outputTypeArray)/sizeof(std::string);
DQEasy::addOutputTypes(request, outputTypeArray, size);
DQP *response = DQEasy::getResponse(request, url);
DQEasy *output = DQEasy::parseDQP(response);
return output;
}
#include
#include
#include
using namespace boost::python;
BOOST_PYTHON_MODULE(DQEasy)
{
//Export the class to Python
class_<DQEasy>("DQEasy")
.def("RequestToResponse", &DQEasy::RequestToResponse)
;
}
Any clue will be quite helpful. I apologize if the message is too long.
Thank you