UML representation for C/C++ function pointers

后端 未结 7 1279
梦谈多话
梦谈多话 2021-02-13 00:21

What would be the best representation of a C/C++ function pointer (fp) in an UML structural diagram?

I\'m thinking about using an interface element, may be even if \'deg

7条回答
  •  陌清茗
    陌清茗 (楼主)
    2021-02-13 00:38

    My feeling is that you desire to map UML interfaces to the struct-with-function-pointers C idiom.

    Interface1 is the important element in your model. Declaring function pointer object types all over the place will make your diagrams illegible.

    Enterprise Architect allows you to specify your own code generators. Look for the Code Template Framework. You should be able to modify the preexisting code generator for C with the aid of a new stereotype or two.

提交回复
热议问题