Hi,
thanks for your answer. I have already finished implementing the
components for my Master's Thesis using NOX-Classic. The new NOX and POX
came too late for a change in my Thesis, but I think porting them to POX
should not be a problem :) So I'm currently writing my Thesis and I
tried to understand why these functions are mixed up. I somehow want to
explain this in my Thesis to give a better understanding of what's going
on and why I need this context sometimes.
So you say it is a place to expose functionality from C++ to Python?
Does that mean that the Component class in Python and all it's
functionality is implemented on it's own in Python and only the
functions exposed in the context map to functionality in C++? I thought
this was some mechanism to have some kind of multiple instances of a
Component and to distinguish in which context it lives. At least this is
the understanding that I have of a context. But then, I could not find
any functionality to control this behaviour. I will look at the code and
think about it. If you have any documentation or hints, I would be happy :)
Best regards,
Bernd
On 22.05.2012 23:45, Murphy McCauley wrote:
The most obvious answer is that PyContext wraps a C++ Context, which is part of
the component system. But it's probably more useful to understand that it is
used as a place to expose some functionality from the C++ side of NOX to the
Python side. This needs to happen to at least some degree -- for example,
Python needs a way to tell the C++ part of NOX to register events and to send
packets to switches. In some cases, there are now ways to do this with more
Python and less C++, so some of the functions in PyContext are only really
there for historical or practical reasons.
Are you writing a new Python application in NOX-Classic?
-- Murphy
On May 22, 2012, at 2:29 AM, Bernd Wittefeld wrote:
Hi,
when writing a NOX component in Python, I derive it from the component class.
It is then initialized with a context pointer ctxt. I think this is to
recognize different instances of one component, right? Is there any other
purpose for this context stuff?
I recognized that there are methods, for example "send_port_stats_request" that
are only exposed through the context class. What is the reason for this? Why is this not
exposed through the component class? I could simply use send_openflow_command or
something from the component class to send a stats_request.
Is there any documentation about this or can someone tell me how this works?
Thanks in advance!
Best regards,
Bernd