Book a Demo

Author Topic: Main() or Wraper code of Enterprise architect  (Read 11786 times)

kalpesh

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Main() or Wraper code of Enterprise architect
« on: April 16, 2010, 02:29:51 pm »
I am trying to generate code in C++.
For class I am able to get .h and .c files.
But How enterprise Architect provide main for initialisation?
Or we need to write our main as our own?

Nizam Mohamed

  • EA User
  • **
  • Posts: 193
  • Karma: +1/-0
    • View Profile
Re: Main() or Wraper code of Enterprise architect
« Reply #1 on: April 16, 2010, 02:52:50 pm »
Kalpesh, if you are the same person who initiated
this  discussion ..

people seem to have replied and are awaiting your feedback!

W.r.t code generation from classes, EA does not generate an application, rather it just renders what you've modeled, so no wrapper or main is generated unless you have a method called main and some code to be rendered within.

or, you can edit the code generation templates to generate it automatically.
« Last Edit: April 16, 2010, 03:02:35 pm by nizammohamed »

Makulik

  • EA User
  • **
  • Posts: 400
  • Karma: +0/-0
    • View Profile
Re: Main() or Wraper code of Enterprise architect
« Reply #2 on: April 16, 2010, 08:05:46 pm »
Just an additional note about C++ and main. Usually my implementations of main for C++ don't exceed more than 10(!) lines of code. It should be almost nothing in there. I'll give an example:

Code: [Select]
int main(int argc, char** argv)
{

      ConfigServiceOpts opts;
      if(opts.scanOpts(argc,argv))
      {
            ConfigService configService(opts);
            configService.run();
      }
      return 0;
}


Just another 0.02 EUR upon this topic.

WBR
g.
« Last Edit: April 16, 2010, 08:06:15 pm by Makulik »