How to generate "skeleton" code?


I remember in the old dezyne IDE, code generation generated skel_.hh files for components without any behaviour. Can this be done using the dezyne command line?

–help for the “dzn code” command gives the following:
-c, --calling-context=TYPE generate extra parameter of TYPE for every event
-h, --help display this help and exit
-I, --import=DIR+ add DIR to import path
-l, --language=LANG generate code for language=LANG [c++]
-L, --locations prepend locations to output trace
-m, --model=MODEL generate main for MODEL
-o, --output=DIR write output to DIR (use - for stdout)
-q, --queue-size=SIZE use queue size SIZE
-s, --shell=MODEL generate thread safe system shell for MODEL


Currently, when I try to generate code for a component with no behaviour following is the message from the code generator:
“cowardly refusing to clobber file with basename:”

A component without a behavior, also known as a foreign component, is supposed to be provided by “other” means. The generated code expects a type of the name of the foreign component to be available to the target language compiler. Specifically for C++ an explicit #include this type is generated. The basename of the filename is equal to the name of the foreign component. However for C++ and C# we generate a skeleton, i.e. a helper type, to be inherited when implementing the foreign component by hand. This skeleton is derived from the foreign component and is put into the source files derived from the filename of the dezyne file. “cowardly refusing to clobber file with basename” occurs when a foreign component is put in a dezyne file with the same name as the foreign component. So the solution is quite simple: use different names.

1 Like

Thanks Rutger! This indeed works very well.