OMNeT++/OMNEST Bug Tracker

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000756OMNeT++simulation kernelpublic2014-05-07 06:482014-05-07 06:48
Reportertill 
Assigned To 
PrioritynormalSeverityfeatureReproducibilityN/A
StatusnewResolutionopen 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version 
Summary0000756: Missing feature in NED inheritance (submodule overwriting)
DescriptionI'm missing a feature in the NED inheritance functionality. I need to extend a module and overwrite a submodule with an extended submodule. Please see this example:

module Foo {
    gates:
        input in;
    submodules:
        sub: Submodule;
    connections:
        in <--> sub.in;
}

module Bar extends Foo {
    gates:
        output out;
    submodules:
        sub: ExtendedSubmodule; // syntax could also be something like "sub: ExtendedSubmodule @override;"
    connections:
        out <--> sub.out;
}

simplemodule Submodule{
    gates:
        input in;
}

simplemodule ExtendedSubmodule extends Submodule{
    gates:
        input out;
}

In this example I have a compound module Foo that has a submodule Submodule with a gate in connected to the submodules in. Now I want an extended version of Foo, called Bar that has another gate out. Bar should use an extended version of Submodule called ExtendedSubmodule with a connection from gate out to the submodules gate out. The connection from in to sub.in should be kept.

This situation would be totally legal but I think I currently cannot describe it with NED. The nededitor would have to check that ExtendedSubmodule is a subclass of Submodule to ensure that the redefinition of sub in Bar would not break Foo.

Perhaps something like: "sub: <default("Submodule")> extends Submodule;" would be a possible way as well, but why not allow the definition of a module with the same name when it extends the overwritten module? Of cause it would require to collect the gate, connection and parameter definitions of the overwritten module as well.

I think such a possibility has the potential to save a lot of (ned)code that would be otherwise defined in several modules, and thus reduce the maintenance effort significantly.
I hope I'm not the only one who would require that feature :)

The good part: that would not require changes in the NED syntax. Would love to see that feature in 5.0
Additional InformationThere is a discussion related to this feature request on the omnet list: https://groups.google.com/d/topic/omnetpp/P6Jj_ZXH64o/discussion [^]
TagsNo tags attached.
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2014-05-07 06:48 till New Issue


Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker