Opened 10 years ago

Last modified 7 years ago

#3241 assigned defect

Cpp runtime naming conventions

Reported by: Rüdiger Franke Owned by: Niklas Worschech
Priority: high Milestone: Future
Component: Cpp Run-time Version: trunk
Keywords: Cc: Niklas Worschech

Description

Consider

package A
  package B
    model M
    end M;
  end B;
  package C
    model M
    end M;
  end C;
end A;

translateModel(A.B.M) with +simCodeTarget=Cpp generates files that have A.B.M in their names. The classes inside the files just contain M in their name. This exhibits the risk that A.B.M and A.C.M collide if they shall be linked together, e.g. in a hierarchical FMU.

Is this a bug or a feature?

One might alternatively use underscores instead of dots for class names, like A_B_M. The Cpp FMU code generation currently messes up models with dots in their names. This ticket needs to be clarified, in order to know in which direction to proceed.

Change History (10)

comment:1 by Rüdiger Franke, 10 years ago

SVN r25207 fixes the FMI Cpp export to consistently using short model identifiers, like M. This makes it work with the Cpp runtime.

Shouldn't the Cpp runtime be changed to using long model identifiers though, like A_B_M?

Basically some calls to

lastIdentOfPath(modelInfo.name) or identOfPath(modelInfo.name)

need to be replaced with

System.stringReplace(dotPath(modelInfo.name), ".", "_")

Or should identOfPath be used and let it return long model identifiers?

comment:2 by Martin Sjölund, 9 years ago

Milestone: 1.9.31.9.4

Moved to new milestone 1.9.4

comment:3 by Lennart Ochel, 9 years ago

Component: Run-timeCpp Run-time
Owner: changed from somebody to Marcus Walther

comment:4 by Marcus Walther, 9 years ago

Cc: Niklas Worschech added

comment:5 by Marcus Walther, 9 years ago

Owner: changed from Marcus Walther to Niklas Worschech
Status: newassigned

comment:6 by Martin Sjölund, 9 years ago

Milestone: 1.9.41.9.5

Milestone pushed to 1.9.5

comment:7 by Martin Sjölund, 9 years ago

Milestone: 1.9.51.10.0

Milestone renamed

comment:8 by Martin Sjölund, 8 years ago

Milestone: 1.10.01.11.0

Ticket retargeted after milestone closed

comment:9 by Martin Sjölund, 8 years ago

Milestone: 1.11.01.12.0

Milestone moved to 1.12.0 due to 1.11.0 already being released.

comment:10 by Francesco Casella, 7 years ago

Milestone: 1.12.0Future

The milestone of this ticket has been reassigned to "Future".

If you think the issue is still valid and relevant for you, please select milestone 1.13.0 for back-end, code generation and run-time issues, or 2.0.0 for front-end issues.

If you are aware that the problem is no longer present, please select the milestone corresponding to the version of OMC you used to check that, and set the status to "worksforme".

In both cases, a short informative comment would be welcome.

Note: See TracTickets for help on using tickets.