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

Reply via email to