Filter löschen
Filter löschen

How do I specify the '.CustomAt​tributes.T​ypeName'

2 Ansichten (letzte 30 Tage)
Craig Barry
Craig Barry am 13 Nov. 2012
Hi guys,
I have defined a custom storage class. It currently defines the structure as 'Instant specific' (as per the cscdesigner). I then assign variables into the desired structure with an m script which does the following:
wibble.RTWInfo.CustomAttributes.StructName = 'runtime_structname';
When generating code, it comes out looking like this:
extern const runtime_structname_type = *runtime_structname;
This is not what I want to generate, I want to also specify the 'TypeName', as mentioned in the 'csc_registeration.m'. When not set as instant specific the structure type can be defined, but I want to dynamically assign this to make code that looks like this (notice the type does not contain the word runtime):
extern const structname_t = *runtime_structname;
Unfortunately, I cannot access the TypeName class, the following error is generated, "No public field TypeName exists for class"
Does anyone know how I can achieve what I want?
Thanks in advance.
Craig
  1 Kommentar
Craig Barry
Craig Barry am 17 Nov. 2012
For anyone interested, the workaround for this issue, in handcode I have a script which automates the inclusion of an additional typedef to the required type:
typedef struct structname structname_t; /* This is the required format */
typedef structname_t runtime_structname_type; /* This typedefs the RTW generated code into my required form */
extern const structname_t *runtime_structname; /* Declare pointer to struct of required type */

Melden Sie sich an, um zu kommentieren.

Antworten (0)

Produkte

Community Treasure Hunt

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

Start Hunting!

Translated by