Skip to content
Snippets Groups Projects
Commit 7920b68b authored by “KatrinBistreck”'s avatar “KatrinBistreck”
Browse files

deletes old module design from c++ style guide

parent d35e5d5f
No related branches found
No related tags found
2 merge requests!76Draft: Updated Python code example,!73Initial open source version
Pipeline #1518552 waiting for manual action
......@@ -12,28 +12,10 @@ date: 2023-09-12
---
## Standard Module Design
- Calculations not in `aircraft.cpp` (aircraft is pure data object)
- `myTool.cpp` for calculations, has (smart) pointers to Aircraft and Settings objects
- Do not edit standard files like aircraft.cpp, functions.cpp etc. ->use own files (myToolFunctions, myToolspecificAicraftData,...)
### Structure main()
1. Create Settings object
2. Create aircraft object
3. Create myTool-object, if necessary call init()
4. Call myTool.run()
5. Create output and call writeOutput()
6. Done
!!! warning
:fontawesome-solid-arrow-right: The module structure changed in newer releases of **UNICADO**. See [Module Structure]().
---
## Header Files
### Inline Functions
- Define inline functions only if they are small (~ 10 lines or less).
### Function Parameter Ordering
- The sequence of parameters of a function is: first input parameters, then output parameters.
- Input parameters are passed either as value or const reference.
......@@ -71,7 +53,7 @@ date: 2023-09-12
- Always use Smart Pointers instead of normal pointers (raw pointers), since Smart Pointers free up storage space at a suitable location.
- Do not use `auto_ptr` (obsolete and not container-compatible) but `unique_ptr`.
- Use `shared_ptr` only if several pointers to the same object are needed, because more memory is used for the reference counting.
---
## Other C++ Features
......@@ -157,7 +139,7 @@ auto value = get_value(); // type ist not readable
* \details detailed description of the class
*/
```
### Function Comments
- Function declaration: Describe what the function does and how it is used.
- Does the memory function occupy memory that must be released again by the caller?
......@@ -175,7 +157,7 @@ auto value = get_value(); // type ist not readable
* \param name Description of the transfer parameter
* \return name Description of the return value
*/
```
```
- Additional comments in the code only via `//`.
- Instructions for creating documentation with Doxyblocks can be found in the wiki.
......@@ -189,7 +171,7 @@ auto value = get_value(); // type ist not readable
---
## Formatting
- General (ANSI) style with 4 spaces as indentation.
- General (ANSI) style with 4 spaces as indentation.
### Line Length
- Each line of code max. 120 characters’ long.
......@@ -206,7 +188,7 @@ auto value = get_value(); // type ist not readable
- Parameter in the same line if it does not match: Parameters in several lines
- No space between function name and opening parenthesis.
- No space between parenthesis and parameter.
- Example:
- Example:
```cpp
auto ClassName::functionName(Type par_name1, Type par_name2) -> return_type
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment