フィルターのクリア

C++ generated code class inheritance

6 ビュー (過去 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,
Antonio.
P.S. I'm using Simulink R2021b.

採用された回答

Mark McBroom
Mark McBroom 2023 年 1 月 25 日
This is currently not possible with Embedded Coder.
Thanks.
Mark.
  2 件のコメント
Antonio Niro
Antonio Niro 2023 年 1 月 25 日
Ok, thanks for your answer. I wrote a script that modifies the generated file in order to obtain what i want. If you have other ideas on how to do that I would appreciate :)
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.
Thanks.
Mark.

サインインしてコメントする。

その他の回答 (0 件)

カテゴリ

Help Center および File ExchangeSimulink Coder についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by