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:
.hfiles) and implementation files (
.cppfiles), as well as "makefiles", build scripts, etc. The critical aspects of physical design is managing the inter-dependencies among the source code modules as well as information hiding policy to expose only the desired interfaces in the header files. Additionally, physical design of automatically generated source code must also afford a sufficiently flexible way of interfacing with hand-crafted code or any existing 3rd-party code.
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 a "model compiler").
<class-name>.hheader file and
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 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 Motor Industry Software Reliability Association (MISRA) Guidelines. Specifically, the QM code generator for the C language emits code compliant with the MISRA C:2004 and the QM code generator for the C++ language emits code compliant with the MISRA C++:2008.
The other code engineering tasks described in this section include:
Next: Working with Directories