Bugzilla – Bug 1994
bindings for classes without explicit copy constructors
Last modified: 2014-09-29 17:21:00 UTC
Revision 881 of pybindgen is breaking the compilation of the bindings. http://bazaar.launchpad.net/~gjc/pybindgen/trunk/revision/881 This revision is about fixing copying issues with classes that have private copy constructors. However, this version of pybindgen causes an early compilation error in ns-3: in convert_c_to_python raise CodeGenerationError("Class {0} cannot be copied".format(self.cpp_class.full_name)) pybindgen.typehandlers.base.CodeGenerationError: Class ns3::Ipv4Header cannot be copied Ipv4Header does not have a private copy constructor or any copy constructor declared (it is using the default copy constructor).
Rev 885 also fails to compile. The C++ api is this: uan-transducer.h (abstract base class): virtual const ArrivalList &GetArrivalList (void) const = 0; uan-transducer-hd.h: virtual const ArrivalList &GetArrivalList (void) const; where 'ArrivalList' is a std::list<UanPacketArrival> The bindings are: module.add_container('std::list< ns3::UanPacketArrival >', 'ns3::UanPacketArrival', container_type=u'list') ## uan-transducer.h (module 'uan'): std::list<ns3::UanPacketArrival, std::allocator<ns3::UanPacketArrival> > const & ns3::UanTransducer::GetArrivalList() const [member function] cls.add_method('GetArrivalList', 'std::list< ns3::UanPacketArrival > const &', [], is_pure_virtual=True, is_const=True, is_virtual=True) ## uan-transducer-hd.h (module 'uan'): std::list<ns3::UanPacketArrival, std::allocator<ns3::UanPacketArrival> > const & ns3::UanTransducerHd::GetArrivalList() const [member function] cls.add_method('GetArrivalList', 'std::list< ns3::UanPacketArrival > const &', [], is_const=True, is_virtual=True) which looks OK, but then the compilation error is as follows: In file included from src/uan/bindings/ns3module.cc:1:0: src/uan/bindings/ns3module.h:3862:48: error: conflicting return type specified for ‘virtual std::list<ns3::UanPacketArrival> PyNs3UanTransducer__PythonHelper::GetArrivalList() const’ virtual std::list< ns3::UanPacketArrival > GetArrivalList() const; ^ In file included from ./ns3/uan-phy.h:30:0, from ./ns3/uan-mac-cw.h:27, from ./ns3/uan-module.h:18, from src/uan/bindings/ns3module.h:78, from src/uan/bindings/ns3module.cc:1: ./ns3/uan-transducer.h:183:30: error: overriding ‘virtual const ArrivalList& ns3::UanTransducer::GetArrivalList() const’ virtual const ArrivalList &GetArrivalList (void) const = 0;
Apologies. I guess I should have rebuilt ns-3-dev from scratch before declaring victory. I'll fix it (again) tonight.
I think this is fixed now. I tried rebuilding from scratch, and it builds for me.