[Ns-developers] module headers for example scripts

Joseph Kopena tjkopena at cs.drexel.edu
Wed Mar 26 09:53:13 PDT 2008


On Wed, Mar 26, 2008 at 12:36 PM, Tom Henderson <tomh at tomh.org> wrote:
> Gustavo has modified waf to generate headers that can be used in example scripts, to avoid having to enumerate all of the lower-level header files.  Presently, the following are generated:

These are actually nice & useful.  I've started using them after
catching them used in some of the samples.

>  I have two questions about the details:
>  1) should these module headers be cumulative or not?  For instance, internet-node-module.h includes already simulator-module.h, node-module.h, etc.-- all of the build dependencies.  I would slightly favor enumerating them (not aggregating across module boundaries), just for clarity sake, but that would mean more include statements-- all scripts would include "simulator-module.h" and "core-module.h" explicitly, for instance.

I would also lean toward enumerating them.  I don't think the extra
includes are a huge deal, they all have #ifndef guards.  For me
linking seems to dominate compile time in making changes w/in the main
repository (as opposed to externally & linking against ns-3.so).
We're also mostly just talking about samples & examples here, as well
as user code, right?  So it shouldn't effect compile time for the main
repo unless someone went through & changed all the includes.  User
projects are also probably generally a relatively small number of
files including stuff.

>  2) is the above the right granularity?  An alternative would be to aggregate at the "module" level, which is one level below src/, which would mean having an "application-module.h" instead of a "packetsink-module.h", a "device-module.h" instead of "wifi-module.h", etc.

I like packet-sink-module.h.  To me it's similar to devices, and I
don't you would want net-device-module.h (as opposed to csma-module.h,
wifi-module.h, etc).

-- 
- joe kopena
right here and now


More information about the Ns-developers mailing list