C++ generated code class inheritance

조회 수: 2(최근 30일)
Antonio Niro
Antonio Niro 2023년 1월 17일
댓글: Mark McBroom 2023년 1월 25일
Hi, I'm trying to use class C++ inheritance in my generated code. I have a certain Simulink model, and I'm able to generate code from it as a C++ class. I'd like to have the generated class to be the child of a second hand-written class. If my model is called "my_model", and my parent class i called "parent", i want to obtain something like
class my_model: public parent
I tried to implement this by modifing the .tlc file customization template file, but if I want to obtain C++ class from the model I must use the default tlc file. Is it possible to set up embedded coder to obtain what I'm looking for?
Thanks in advance,
P.S. I'm using Simulink R2021b.

채택된 답변

Mark McBroom
Mark McBroom 2023년 1월 25일
This is currently not possible with Embedded Coder.
  댓글 수: 2
Mark McBroom
Mark McBroom 2023년 1월 25일
That is the best approach. You can configure your script to automatically run after code is generated via the "Post code generation command" configuration setting.

댓글을 달려면 로그인하십시오.

추가 답변(0개)


Find more on Simulink Coder in Help Center and File Exchange

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by