Author Topic: Generating several types in single header  (Read 3181 times)

slerp

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Generating several types in single header
« on: October 17, 2012, 09:39:39 pm »
Hi all,

I'm using EA to generate C-src.

Now the "problem" ist that for every single typedef a header is generated.

Is it possible to specify an artefact for several types in a way that these type are located in one single header?

now:

ADC_test.h
 typedef struct {} ADC_test;
PWM_test.h
 typedef struct {} PWM_test;

wanted:

test.h
 typedef struct {} ADC_test;
 typedef struct {} PWM_test;

I looked arround but did not find any solution for this.

Kind regards & thank you

slerp
« Last Edit: October 17, 2012, 10:03:33 pm by slerp »

Helmut Ortmann

  • EA User
  • **
  • Posts: 970
  • Karma: +42/-1
    • View Profile
Re: Generating several types in single header
« Reply #1 on: October 18, 2012, 12:22:24 am »
Hi,

1. Make a *.h file with your typedefs.
2. Reverse Engineer the Header file
3. You get a class for the header file and a nested class for each typedef

Next time start with step 3 and generate / synchronize your *.h file.

Kind regards,

Helmut

Coaching, Training, Workshop (Addins: hoTools, Search&Replace, LineStyle)

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: Generating several types in single header
« Reply #2 on: October 18, 2012, 12:31:28 am »
You can create a class (C-module) and place the typedefs as nested elements there. I'm not very experienced with C code generation but I think this should do the trick.

HTH
Günther

slerp

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Generating several types in single header
« Reply #3 on: October 18, 2012, 05:01:03 pm »
Thank you, I'll check this out :)

Kind regards

Slerp

slerp

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
    • View Profile
Re: Generating several types in single header
« Reply #4 on: October 23, 2012, 05:49:29 pm »
Hi all,

checked it out and the c-module and elements as nested class works great.

Thank you

slerp