Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
unicado.gitlab.io
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
UNICADO
unicado.gitlab.io
Commits
7920b68b
Commit
7920b68b
authored
6 months ago
by
“KatrinBistreck”
Browse files
Options
Downloads
Patches
Plain Diff
deletes old module design from c++ style guide
parent
d35e5d5f
No related branches found
No related tags found
2 merge requests
!76
Draft: Updated Python code example
,
!73
Initial open source version
Pipeline
#1518552
waiting for manual action
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docs/developer/style/cpp.md
+6
-24
6 additions, 24 deletions
docs/developer/style/cpp.md
with
6 additions
and
24 deletions
docs/developer/style/cpp.md
+
6
−
24
View file @
7920b68b
...
...
@@ -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
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment