[Ns-bugs] [Bug 155] "std::ostream & os" parameters not Python friendly

code@nsnam.ece.gatech.edu code at nsnam.ece.gatech.edu
Wed Feb 18 04:29:31 PST 2009


http://www.nsnam.org/bugzilla/show_bug.cgi?id=155





--- Comment #4 from Gustavo J. A. M. Carneiro <gjcarneiro at gmail.com>  2009-02-18 07:29:31 EDT ---
I have wrapped ofstream, so ascii tracing works.

However, it is notably not "reference counting safe" like python programmers
are used to, and if the ofstream object goes out of scope things could crash.
Example:

def configure_tracing():
  f = ns3.ofstream("foo.tr")
  ns3.YansWifiPhyHelper.EnableAsciiAll(f)
  # <-- f goes out of scope and is deleted

def main():
  #...
  configure_tracing()
  ns3.Simulator.Run() # <-- will crash


But, well, at least now ascii tracing works in python, it's better than nothing
:P


-- 
Configure bugmail: http://www.nsnam.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.


More information about the Ns-bugs mailing list