Fix Python bindings ns3.Object subclassing bug

This commit is contained in:
Gustavo J. A. M. Carneiro committed 2010-05-06 14:21:20 +01:00
1 parent 426b0907c8
commit 1bdab52ab6
3 files changed
+13 -1

No files matched your search

@@ -362,9 +362,13 @@ static ns3::TypeId GetTypeId (void)
% cpp_class.full_name)
code_block.write_code("%s = new %s(%s);" % (lvalue, construct_type_name, parameters))
code_block.write_code("%s->Ref ();" % (lvalue))
def ns3_object_post_instance_creation_function(cpp_class, code_block, lvalue,
parameters, construct_type_name):
code_block.write_code("ns3::CompleteConstruct(%s);" % (lvalue, ))
Object.set_instance_creation_function(ns3_object_instance_creation_function)
Object.set_post_instance_creation_function(ns3_object_post_instance_creation_function)
def Attribute_customizations(module):
+1 -1
View File
@@ -15,7 +15,7 @@ import Build
import Utils
## https://launchpad.net/pybindgen/
REQUIRED_PYBINDGEN_VERSION = (0, 14, 1)
REQUIRED_PYBINDGEN_VERSION = (0, 14, 1, 764)
REQUIRED_PYGCCXML_VERSION = (0, 9, 5)
+8
View File
@@ -145,5 +145,13 @@ class TestSimulator(unittest.TestCase):
self.assertEqual(cmd.test_xxx, "123")
self.assertEqual(foo.test_foo, "xpto")
def testSubclass(self):
class MyNode(ns3.Node):
def __init__(self):
super(MyNode, self).__init__()
node = MyNode()
if __name__ == '__main__':
unittest.main()