bindings, docs: pass strings via char* to CommandLine.AddValue

And supplement memory-management issues section
This commit is contained in:
Gabriel Ferreira
2022-10-14 22:13:55 -03:00
parent bf7407026a
commit 12373157a4
8 changed files with 193 additions and 142 deletions

View File

@@ -103,14 +103,14 @@ ns.cppyy.cppdef("""
""")
def main(dummy_argv):
cmd = ns.getCommandLine(__file__)
cmd.Parse(dummy_argv)
def main(argv):
cmd = ns.CommandLine(__file__)
cmd.Parse(argv)
model = ns.cppyy.gbl.MyModel()
v = ns.CreateObject("UniformRandomVariable")
v.SetAttribute("Min", ns.core.DoubleValue (10))
v.SetAttribute("Max", ns.core.DoubleValue (20))
v.SetAttribute("Min", ns.core.DoubleValue(10))
v.SetAttribute("Max", ns.core.DoubleValue(20))
ev = ns.cppyy.gbl.ExampleFunctionEvent(model)
ns.core.Simulator.Schedule(ns.core.Seconds(10.0), ev)