[Ns-developers] [ns-3] binding Packet/Tag/TraceContext

Mathieu Lacage mathieu.lacage at sophia.inria.fr
Tue Jan 8 04:34:30 PST 2008


hi,

gustavo's recent post of his python bindings started a lengthy
discussion about the way we could bind to python the tracing subsystem
and, more generally, how we could bind some of the core APIs which rely
on templates. I spent a few hours looking at the alternatives so, here
is a summary. Comments would be welcome.

1) This is going to require API changes

2) non-virtual methods are going to be made virtual:
  Header::Serialize, etc.

3) Tags and TraceContextElement are going to require an explicit
serialization/deserialization API. i.e., something a bit like
Header::Serialize/Deserialize

4) Another thing which all these C++ bits need is a way to get access to
a pointer to an instance of the right Header/Tag/TraceContextElement
type based on a mapping from integer id to type instance. Then, these c
++ bits need to be able to call deserialize on the type instance and
then, call Print on the resulting deserialized instance to print the
content of the element. So, the big thing the C++ code needs is a map
uid <-> type instance. If we allow python to create new
tags/TraceContextElements/Headers, then, the python code needs to be
able to register new entries in this map. Gustavo: could you recommend a
simple way to do this ?

regards,
Mathieu


More information about the Ns-developers mailing list