Book a Demo

Author Topic: C++ typedef  (Read 2651 times)

farnamv

  • EA Novice
  • *
  • Posts: 1
  • Karma: +0/-0
  • Trolls be here!
    • View Profile
C++ typedef
« on: February 02, 2006, 11:11:33 am »
I want to add an element to my diagram that is a C++ typedef of a function pointer.
The only success I've had todate is to make the name of the typedef the function signature (minus the return type) and to make the elements parent the return type.
Messy!
Is there a better way??
Thanks

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: C++ typedef
« Reply #1 on: February 02, 2006, 01:59:35 pm »
This reminds me of a C# delegate (that our code engineering doesn't handle as nice as I would like), so I'll try to give you a start by describing the way I would model that.

Class stereotyped delegate containing a single method.

eg.
Code: [Select]
+------------------+
|    «delegate»    |
|    MyDelegate    |
+------------------+
| f(int,int) : int |
+------------------+


You could make EA generate this by creating a stereotype overrides for the Class Declaration template and Operation template and stopping the Class Body being called from the Class template.

I'd do something similar for your situation, although I don't know exactly what you want to generate, or what stereotype to use.