Book a Demo

Author Topic: Removing overloaded operation in transformation  (Read 2094 times)

alon.novy

  • EA Novice
  • *
  • Posts: 3
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Removing overloaded operation in transformation
« on: March 29, 2006, 12:43:59 am »
Hi All

I have created a transform that is working ok and is pretty similar to the NUnit transform.  The only prob is that where a class has an overloaded operation, I want the transform to generate a single operation, no matter how many overloads exist for the original operation.
How do I do that?

Thank you
Alon

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Removing overloaded operation in transformatio
« Reply #1 on: March 29, 2006, 02:16:29 pm »
The code templates don't have any mechanism for finding what you've already seen or generated, so the best approach I can think of at the moment is to use an addin call from the template. (EXEC_ADD_IN function macro.)

One possible way to use this would be a call at the start of your operation template to allow generation.

Untested
Code: [Select]
$gen=%EXEC_ADD_IN("MyAddin", "AllowOperationGeneration", classGUID, opName)%
%if $gen!="T"%
%endTemplate%

... Rest of template


That should get you going.
« Last Edit: March 29, 2006, 02:16:52 pm by simonm »