Hi,
i get this error:
./genbindings.py:13: UserWarning: exception CodeGenerationError('Node cannot be constructed (class has pure virtual methods)',) in wrapper public: virtual NodeConnection * ISimulation::createConnection (Node * source, std::string source_port, Node * sink, std::string sink_port);
when i want to wrap the methode like this:
sim.add_method('createConnection', retval('NodeConnection*', caller_owns_return=True), [
param('Node *', 'source', transfer_ownership=False),
param('std::string', 'source_port'),
param('Node *', 'sink', transfer_ownership=False),
param('std::string', 'sink_port')], is_pure_virtual=True)
when i remove the is_pure_virtual from createConnection or change transfer_ownership to
True it works. But that is no what i want. Both Node and ISimulation have pure virtual methods.
This works in other situations.
The backtrace is:
File "/usr/lib/python2.6/site-packages/pybindgen/utils.py", line 128, in call_with_error_handling
return callback(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/pybindgen/cppmethod.py", line 912, in generate
decl_post_modifiers=decl_post_modifiers)
File "/usr/lib/python2.6/site-packages/pybindgen/typehandlers/base.py", line 612, in generate
param.convert_c_to_python(self)
File "/usr/lib/python2.6/site-packages/pybindgen/cppclass_typehandlers.py", line 666, in convert_c_to_python
write_create_new_wrapper()
File "/usr/lib/python2.6/site-packages/pybindgen/cppclass_typehandlers.py", line 581, in write_create_new_wrapper
'*'+self.value)
File "/usr/lib/python2.6/site-packages/pybindgen/cppclass.py", line 941, in write_create_instance
construct_type_name = self.get_construct_name()
File "/usr/lib/python2.6/site-packages/pybindgen/cppclass.py", line 956, in get_construct_name
raise CodeGenerationError("%s cannot be constructed (class has pure virtual methods)" % self.full_name)
File "/usr/lib/python2.6/site-packages/pybindgen/utils.py", line 128, in call_with_error_handling
return callback(*args, **kwargs)
File "/usr/lib/python2.6/site-packages/pybindgen/cppmethod.py", line 912, in generate
decl_post_modifiers=decl_post_modifiers)
File "/usr/lib/python2.6/site-packages/pybindgen/typehandlers/base.py", line 612, in generate
param.convert_c_to_python(self)
File "/usr/lib/python2.6/site-packages/pybindgen/cppclass_typehandlers.py", line 666, in convert_c_to_python
write_create_new_wrapper()
File "/usr/lib/python2.6/site-packages/pybindgen/cppclass_typehandlers.py", line 581, in write_create_new_wrapper
'*'+self.value)
File "/usr/lib/python2.6/site-packages/pybindgen/cppclass.py", line 941, in write_create_instance
construct_type_name = self.get_construct_name()
File "/usr/lib/python2.6/site-packages/pybindgen/cppclass.py", line 956, in get_construct_name
raise CodeGenerationError("%s cannot be constructed (class has pure virtual methods)" % self.full_name)
thanks