On Oct 21, 2:14 pm, Rudolf Hornig <
rudolf.hor...@gmail.com> wrote:
> This is working for me (setting "type" to UDPApp1 or UDPApp2 works, while
> UDPApp3 fails of course)
Why do you write "of course"?
The whole Idea is to use UDPApp3 inheriting everything from UDPApp2,
not UDPApp2 itself.
This problem occured to me as well and I filed a bug for this:
http://dev.omnetpp.org/bugs/view.php?id=88 with a test case attached.
No solution so far.
The problem is actually not that the gate is lost on the second
inheritance, because the gate is there if you leave the interface
aside. But on the second inheritance the inferface compliance check
fails for no comprehensible reason. I could even find the point where
it fails by debugging the NED-parsing process, but the reason stayed a
mystery for me.
Regards,
Henry
Before you ask, why such a complex inheritance situation is used, I
can give you a rather simple example:
You define an interface and an "abstract" module (UDPApp1)
implementing this interface where you define everything common to all
modules of this kind.
Now you have a special module (UDPApp2) for a given task that extends
the abstract one.
And now you want to write a test case for the special module. In the
test case you want to check for multiple errors of course. This means
you need another module (UDPApp3) around the specialised on to catch
the errors and present some output to check agains. Otherwise you
would have to write one test case for every situation leading to an
error. UDPApp3 needs to behave in every way like UDPApp2 which is
tested so you extend UDPApp2 and voila you meet the bug for the first
time...
> Rudolf
>
> (ps: But I agree that specifying the like UDPApp clause should not generate
> an error, so this is an issue in omnet)
>
> example:
>
> moduleinterface UDPApp
> {
> gates:
> input udpIn;
> output udpOut;
>
> }
>
> module UDPApp1 like UDPApp
> {
> gates:
> input udpIn;
> output udpOut;
> connections allowunconnected:
>
> }
>
> module UDPApp2 extends UDPApp1 *// do not include "like UDPApp" it
> inherits the interface automatically*
> {
>
> }
>
> module UDPApp3 { *// no inheritance or interface => cannot be used as
> udpApp below*