This Code Engineering section covers the following subjects:
Code engineering** is the process of designing, implementing, and maintaining source code. This section describes how QM can assist you in this process by providing a unique approach to modeling the structure and content of the generated source code, also known as the "physical design" as defined below:
In QM, directories and files are first-class model elements, so the physical design is an integral part of the model, just as the logical design is. This approach makes QM a unique tool on the market that allows you to explicitly perform physical design of the generated code as an integral part of the modeling process (as opposed to tweaking the code generator or adjusting hundreds of parameters of a "model compiler").
The main enabler of the explicit physical design is representing directories and files as model items that can be added to the model and edited as any other parts of the model. But, it is critical to understand that the directories and files in the model are not the actual directories and files on disk. Rather, you should think of these model items as "templates" that the QM code generator uses to create the actual directories and files on your disk. (The word "template" here should not be confused with the "C++ templates"!)
The following picture shows an example of a directory-"template" and some file-"templates" in QM. The file-"template" is shown both in the Model Explorer and in the MDI window:
The following picture shows how the directory-"template" and file-"templates" in the model generate the physical directory and files on disk. The code generation process is depicted as arrows from the model items to the files on disk.
The parts of code generated by QM are compliant with the industry safe coding standards for C and C++. Specifically, the QM code generator for the C language emits code compliant with the MISRA-C:2023↑ and the QM code generator for the C++ language emits code compliant with the MISRA-C++:2023↑.