From 7920b68b8d93014730701ed19928850eb43f98d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E2=80=9CKatrinBistreck=E2=80=9D?= <“katrin.bistreck@tuhh.de”> Date: Thu, 14 Nov 2024 16:25:52 +0100 Subject: [PATCH] deletes old module design from c++ style guide --- docs/developer/style/cpp.md | 30 ++++++------------------------ 1 file changed, 6 insertions(+), 24 deletions(-) diff --git a/docs/developer/style/cpp.md b/docs/developer/style/cpp.md index 4122a3b..b84f6bf 100644 --- a/docs/developer/style/cpp.md +++ b/docs/developer/style/cpp.md @@ -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 -- GitLab