[Ns-bugs] [Bug 127] Add trace callback type information for Python bindings
code@nsnam.ece.gatech.edu
code at nsnam.ece.gatech.edu
Sat Jan 10 09:46:42 PST 2009
http://www.nsnam.org/bugzilla/show_bug.cgi?id=127
--- Comment #7 from Gustavo J. A. M. Carneiro <gjcarneiro at gmail.com> 2009-01-10 12:46:41 EDT ---
(In reply to comment #6)
> > > Gustavo, can you clarify the status of this? My understanding is that:
> > >
> > > 1) if a callback is exported explicitly at the API, it is possible to register
> > > a python method with it, thereby enabling people to write python code for ns-3
>
> Is the above true? Are there any examples of it presently?
Sorry, forgot to answer that.
No, I'm afraid it is _not_ true. It is currently impossible to connect
callbacks to trace events in Python.
What is possible is to pass Python callable objects into NS-3 APIs that expect
_concrete callbacks_. Most notable example of this is sockets. There is even
a unit test connecting Python callbacks to NS-3 sockets (see
utils/python-unit-tests.py).
This bug report is about dealing with APIs that take a callback object of
unspecified type (parameters of type const CallbackBase &). The type is know
somewhere deep in the guts of the NS-3 runtime, and is checked for, but it is
impossible to query NS-3 what is the callback type before connecting to it
using e.g. Config::Connect.
I am kind of reluctant to work on the NS-3 side of this because last time I
provided a patch it was left to bitrot and is now completely obsolete. I don't
blame Mathieu, I know he was/is very busy, but I found it very difficult to
produce the patch the first time around, and I would imagine similar difficulty
again.
--
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