Glossary
| Acronym | Definition |
|---|---|
| SPO | Software Production Operation |
| BL | Behavior Layer |
| ML | Middleware Layer |
| BSM | Behavior-Specific Middleware |
| TSM | Target-Specific Middleware |
Glossary
Referenced Documents
General ConceptsSupported ElementsHere is an exhaustive list of elements used by the code generator to produce the code with a summary of the purpose and impact.
Code Generator Specification
This section is divided in 2 parts:
Files Specifications
Opaque behavior code is generated in a file named be as specified for all behaviors in [3]. <ClassName>_<behaviorName>.cppGeneral requirements related to file content are described in [2]. The code generator supports the implementation of behavior of a class by using an opaque behavior defined as classifier behavior of the class. In this context, the opaque behavior must implement three functions init, main, and term. Each of these functions is invoked at different phases of the program execution. Init function is invoked once during the init phase of the application. Main function is invoked based on the executionType applied to it (a typical case is a periodic execution). Term function is invoked once at the end of code execution. Init main and term functions have a prefix composed of the name of the parent class and the name of the opaque behavior with an underscore. Init main and term functions have an argument pointer to the parent class object. void MyClass_MoOpaqueBehavior_init(MyClass\* self); void MyClass_MoOpaqueBehavior_main(MyClass\* self); void MyClass_MoOpaqueBehavior_term(MyClass\* self); Example: Body section for a body, which is empty. #include to the file <ClassName>_ift.h is generated. A header section is generated following the first include let the user add specific includes or variables declaration in the generated files. User header section start with comment BEG_USER_CODE(header) do not remove and finish with comment END_USER_CODE(header) do not remove. Rationale: includes inserted in the user include section can be preserved between 2 generations of the same file. /* BEG_USER_CODE(header) do not remove */ /* Add your includes here */ /* END_USER_CODE(header) do not remove */ Example: User include section. Comment is inserted to inform that the user section starts. Documentation is inserted if the opaque behavior has documentation attached. A tag @generated_from is inserted to trace the original sysml entity. /** * Start of Opaque Behavior myOpaqueBehavior body section * @generated from: opqueBehaviorId */ Example: Start of opaque behavior section The opaque behavior body section starts with the comment BEG_USER_CODE(${opaque_behavior_id}) do not remove and finishes with END_USER_CODE(${opaque_behavior_id}) do not remove If the opaque behavior body is not empty, its content is printed in the section.
/* BEG_USER_CODE(${opaque_behavior_id}) do not remove */
<opaque_behavior_content>
/* END_USER_CODE(${opaque_behavior_id}) do not remove */
Example: Body section for a body, which is not empty. If the opaque behavior body is empty, a template is automatically created in the generated file.
/* BEG_USER_CODE(${opaque_behavior_id}) do not remove */
void <Class_Name>_<OpaqueBehavior_Name>_init(<Class_Name~~Rte_Instance~~>* self){
/* Add your init code here */
}
void <Class_Name>_<OpaqueBehavior_Name>_main(<Class_Name>* self){
/* Add your code here */
}
void <Class_Name>_<OpaqueBehavior_Name>_term(<Class_Name>* self){
/* Add your term code here */
}
/* END_USER_CODE(${opaque_behavior_id}) do not remove */
Example: Body section for a body, which is empty. A final line is inserted to inform that the opaque behavior section is complete. /* End of Opaque Behavior body section */ Example: End of opaque behavior section Semantic Code SpecificationsThis section describes the behavior of the code generator depending on the UML/SysML element. No specific behavior is expected depending on elements. | |||||||||||||||||||||||||||||||||||