[Ns-developers] helper API + python

Mathieu Lacage mathieu.lacage at sophia.inria.fr
Mon Oct 20 06:31:12 PDT 2008


hi,

So far, there is no support in the python wrapping API for implicit
conversions based on c++ implicit conversions. For example, we have to
write this:

servers = NodeContainer ()
servers.Create (10)
... do stuff
// apply install method on only one server:
stack.Install (NodeContainer (servers.Get (0)))

In the above, we need to explicitely create a NodeContainer object to
wrap the return type of NodeContainer.Get (which returns a Ptr<Object>).

Ideally, it would be nice to be able to write this:
stack.Install (servers.Get (0))

So, there are 2 options:
1) add support to the python wrapper code to do the implicit conversions
if it can
2) modify the underlying c++ API to make
NodeContainer/NetDeviceContainer much more pervasive and avoid Ptr<Node>

2) is a reasonably-big API change which would require quite a bit of API
breakage at the C++ level so, I wonder if 1) is something which could be
fixed in the near future. I would be happy to give this a shot if you
can give me a hint as to what needs to be done to implement 1).

regards,
Mathieu



More information about the Ns-developers mailing list