Christoph Höger
Tue, 19 Jan 2010 08:44:59 -0800
Hi,
I am currently toying around with an idea of adding introspection to C++
classes generated by the mosilac.
Therefore I need some deeper understanding of which elements of the
translation process are neccessary and cannot be changed.
The attached model (or better: Its C++ output) does not compile on
mosilac (cannot test omc myself, I am working on the buildsystem to fix
this).
I have two questions here:
* As you can see, TestModel3 has a Function that takes a class as input
argument. This Function is used in TestModel2 with an object of a
different type.
The test here is, if the ducktyping works (does it in omc?), but mosilac
has another problem: It expects all variables in an equation to be
numerical. Is using complex objects in equations semantically sound?
* From the extension clause you can see that TestModel2 is derived from
TestModel - I'd like to use that for the output C++ code also.
The only problem here is that modifications on the extends clause might
change the type of an already defined element of the base class:
class Foo extends TestModel(redeclare String sinValue = "this was a
Real")
My question is: If such a modified element is already used in the
inherited class, then the new element can only be a subtype of the old
one, right? I cannot find anything about this requirement in the spec,
so how dies omc handle this case?
Thanks for your help,
Christoph
TestModel.mo
Description: application/gettext-translation
TestModel2.mo
Description: application/gettext-translation
TestModel3.mo
Description: application/gettext-translation
signature.asc
Description: Dies ist ein digital signierter Nachrichtenteil