I have such function in C++:
typedef boost::function<boost::shared_ptr<Object> (CL_DomElement*, std::string& desc)> Parser;
void registerParser(std::string type, Parser p);
// Later: exporting into python-module:
BOOST_PYTHON_MODULE(TypesManager)
{
bp::def("RegisterParser", registerParser);
}
# Python code:
class TestObj(Object):
@staticmethod
def ParseTestObj(node, desc):
pass
RegisterParser("test_obj", TestObj.ParseTestObj)
Object in python-code is exported class which is used in typedef (from c++ code).
Boost.Python.ArgumentError: Python argument types in
RegisterParser(str, function)
did not match C++ signature:
RegisterParser(TypesManager {lvalue}, std::string, boost::function<boost::shared_ptr<Object> ()(CL_DomElement*, std::string&)>)
What I do wrong?