Changes between Version 33 and Version 34 of Internal/OpenFlow/Notes


Ignore:
Timestamp:
Apr 5, 2010, 5:30:34 PM (15 years ago)
Author:
akoshibe
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Internal/OpenFlow/Notes

    v33 v34  
    706706</components:components>
    707707}}}
    708  
     708
     709'''the app'''[[BR]]
     710Now comes the part of understanding the app. The nox app is based on the component class, described in component.hh (found in ./src/nox/, assuming you're in your nox directory), so you must always include this file. the basic structure of an app is as followed:
     711
     712{{{
     713#include "component.hh"
     714
     715class Hub
     716    : public Component
     717{
     718public:
     719     Hub(const Context* c,
     720         const xercesc::DOMNode*)
     721         : Component(c) { }
     722
     723    void configure(const Configuration*) {
     724    }
     725
     726    void install()
     727    { }
     728};
     729
     730REGISTER_COMPONENT(container::Simple_component_factory<Hub>, Hub);
     731}}}   
     732
     733this is just a stripped down version of the hub code. Most nox apps can be found in ./src/nox/coreapps/. To debug, also include vlog.hh to enable log, warning and other messages. vlog.hh and other important functionalities, called "events" are in ./src/include.
     734
     735Events must be registered through the Disposition handler, which returns either STOP or CONTINUE, as defined in event.hh. 
     736
     737   
    709738
    710739