Book a Demo

Author Topic: Build 615: Code generation with C++ initializer  (Read 4240 times)

JEff Russell

  • EA User
  • **
  • Posts: 24
  • Karma: +0/-0
    • View Profile
Build 615: Code generation with C++ initializer
« on: June 17, 2003, 02:03:24 pm »
I can't seem to get initialized values in attributes to show up in generated/synchronized code, per 615 build note: "Added support for picking up initializer lists in .CPP file and correctly re-synching the same on ".

I tried:
(forward) Created class with attribute sample_int, initialize: 1.  Generated code (with overwrite file).  Nothing special happens in C++ land.
(reverse) With same class properties in EA, changed .cpp constructor to ClassName: sample_int(1){. An import causes the class attribute "initial:" spec to go away.
(reverse 2) Changed .h/.cpp to have an inline constructor in .h file with the same code.  An import yields the same behavior ("initial:" property goes away).

Any suggestions for mastering this potentially clever new feature?
JEff
JEff

benc

  • EA Administrator
  • EA User
  • *****
  • Posts: 200
  • Karma: +0/-0
    • View Profile
Re: Build 615: Code generation with C++ initialize
« Reply #1 on: June 17, 2003, 10:56:20 pm »
Hi Jeff,

Apologies for any confusion there.

That particular note was referring to initializer lists, which get reversed engineered and stored as a tagged value, "intializer".   (This feature is still being refined to pick up the initializer lists from header files and to work on the initial forward generation.)

As regards an attribute's initial value, EA does not currently use this in c++ code engineering.  There are plans to incorporate initialization code within the upcoming code generation template framework.  So at least for the first forward generation, initial values can be included in either an initializer list or the constructor body.

Reverse and forward synchronization of  initialization code is more complicated and will be part of a longer term endeavor.

The first release of the code template framework should be available on Monday (all being well).  This will include C# templates, shortly followed by C++ and the other supported languages.

Hopefully this will solve some of the issues you raised here.

Regards,
Ben