What's the correct function signature for Python bindings?

6 views
Skip to first unread message

Shiyao Ma

unread,
Mar 25, 2015, 5:10:01 PM3/25/15
to ns-3-...@googlegroups.com
Hi.

I am writing code in Python binding.

When using the "InternetStackHelper.Install" method, I am confused about what's the correct type of arguments that method accepts.

After some grepping, I found this: http://code.nsnam.org/ns-3-dev/file/6ea11eb86c17/src/internet/bindings/modulegen__gcc_LP64.py#l6597

I think it should be the right place, but the param type there is still CPP based, e..g, L6599

Testing the signature of a single function is easy, for example, just invoking "ns.internet.InternetStackHelper(3)", Python will err that 3 is not acceptable and gives the right information on param types.

Instead of this try-err-try methodology, I'd like to know where is the souce that I can look up for param types?

BTW, is it true that, if a param type in cpp is ptr<typename>, then it's counterpart in python is just typename? For example, if a param type in cpp is ptr<Node>, then in Python, the param type will be Node?

TIA.
Reply all
Reply to author
Forward
0 new messages