Author Topic: C code function pointer typedef import fails  (Read 3373 times)

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
C code function pointer typedef import fails
« on: November 30, 2012, 08:04:45 am »
Am I right that importing function pointer typedefs like the following aren't supported for C rev. engineering?

Code: [Select]
typedef void (*FuncSig1)(int, char*);
typedef int (*FuncSig2)(int);

For C++ this is the recommended approach following the User Guide.

How is it possible to make use of function pointer definitions for C code generation/synchronization?

Best regards,
Günther
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: C code function pointer typedef import fails
« Reply #1 on: November 30, 2012, 08:22:30 am »
Unless something has changed since I last looked at it, function pointer typdefs are intentionally skipped because there's no corresponding UML representation.

g.makulik

  • EA User
  • **
  • Posts: 355
  • Karma: +0/-0
    • View Profile
Re: C code function pointer typedef import fails
« Reply #2 on: November 30, 2012, 10:19:51 am »
Quote
... because there's no corresponding UML representation
Hmmm, how are for instance C# delegate types represented in an UML model? As an operation with a particular tagged value, right?

I C/C++ function pointers represent the same, may be as part of a (degenerate) interface. This (interfacing) is exactly their use case.

Best regards,

Günther
Using EA9.3, UML2.3, C++, linux, my brain, http://makulik.github.com/sttcl/

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8085
  • Karma: +118/-20
    • View Profile
Re: C code function pointer typedef import fails
« Reply #3 on: December 03, 2012, 08:50:12 am »
Quote
Hmmm, how are for instance C# delegate types represented in an UML model?
Badly.

As stereotyped operations, which means that they too are ignored if outside of a class. Even when they are imported there's no way to select them as a parameter type or anything else. Effectively it allows for round-tripping but not meaningful use within a model.
« Last Edit: December 03, 2012, 08:53:04 am by simonm »