Book a Demo

Author Topic: including files for method parameters  (Read 3172 times)

dwh

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
including files for method parameters
« on: June 01, 2006, 05:50:52 pm »
I have defined a class that uses, as a parameter for one of its functions, a reference to another class.

eg

Code: [Select]
+ handleEvent (event: FlightModeEvent&): void

How can I get the generated code to include the file that defines FlightModeEvent?  If I create an association link, the code generation creates an attribute of that type.  I have tried creating dependency links, <<use>> links, and <<import>> links.  

None seem to do the trick.

Any thoughts?

thomaskilian

  • Guest
Re: including files for method parameters
« Reply #1 on: June 01, 2006, 11:42:56 pm »
Just a thought, really: Try an explicit dependency since EA does not know about such kind of relations without explicitely being told.

dwh

  • EA Novice
  • *
  • Posts: 5
  • Karma: +0/-0
    • View Profile
Re: including files for method parameters
« Reply #2 on: June 02, 2006, 10:31:52 am »
Quote
Try an explicit dependency since EA does not know about such kind of relations without explicitely being told.


Do you mean by putting an attribute of the type needed in the class just to generate the include?

Creating a dependency link on its own does not do the trick.

Thanks
« Last Edit: June 02, 2006, 10:33:36 am by dwh »

thomaskilian

  • Guest
Re: including files for method parameters
« Reply #3 on: June 02, 2006, 02:31:02 pm »
I meant a dependency. For PHP and PERL this generates he include. If for your C#++ it does not do that, I can't help. Someone else?

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: including files for method parameters
« Reply #4 on: June 04, 2006, 03:13:27 pm »
Parameter types generally do cause #include statements (or the equivalent in other languages) to be generated by EA.  However, because the parameter is a reference this is causing EA to fail to recognise the classifier.

Also the default C++ templates do not list over all dependencies to create includes.  If you want to modify the code templates I would recommend looking at the default PHP templates as a starting point.

SF_lt

  • EA User
  • **
  • Posts: 216
  • Karma: +1/-0
  • The Truth Is Out There
    • View Profile
registertm everything to SparX