Skip to content
Snippets Groups Projects

mod(doc): Update information on clang-format

Files
2
@@ -26,8 +26,8 @@ General
Naming Conventions
------------------
Concise summarized Naming Conventions
Concise summarized Naming Conventions
.. literalinclude:: _static/custom_doc/NamingConventions.txt
**Namespaces**
@@ -38,20 +38,16 @@ Concise summarized Naming Conventions
#. Core uses ``openpass::core::*``
#. Components use ``openpass::component::*``
#. Use the appropriate namespace for the type your component
* ``openpass::component::algorithm``
* ``openpass::component::sensor``
* ``openpass::component::dynamics``
* ``openpass::component::driver``
* ...
#. Code with shared scope (e.g. ``common``) namespaces are separated in
* For everyone ``openpass::common`` e.g. ``openpass::common::XmlParser``
* Common for components ``openpass::component::common`` e.g. ``openpass::components::Ports``
* For the core only ``openpass::core::common`` e.g. ``openpass::core::common::Parameters``
#. Discussion: ``openpass::type::*``
Example: ``openpass::type::Vector2D, openpass::type::OpenDriveId``
**Interfaces**
@@ -60,9 +56,7 @@ Concise summarized Naming Conventions
Example: Interface for the **world** = ``class WorldInterface``
#. Interfaces are abstract classes, and as such provide pure virtual functions only, withtout any default implementation. For example:
``virtual double GetDistance() const = 0;``
#. Interface methods **do not** exibit default parameters.
#. We excessively use **gmock**, so for every interface a fake interface should be provided
@@ -75,7 +69,6 @@ Concise summarized Naming Conventions
#. Classes should be named descriptively according to the functionality they implement with an ``UpperCamelCase`` name
#. A Class implementing an Interface should have the Interfaces name (see below), with the Interface portion removed. For example:
.. code-block::
class AgentBlueprint : public AgentBlueprintInterface {...};
@@ -96,7 +89,6 @@ Concise summarized Naming Conventions
**Input / Output Signal Naming**
#. Components use a special form of signal transmission. For easier use, the following abstraction is recommended:
.. code-block::
std::map<int, ComponentPort *> outputPorts;
@@ -106,7 +98,6 @@ Concise summarized Naming Conventions
std::map<int, ComponentPort *> inputPorts;
bool success = inputPorts.at(localLinkId)->GetSignalValue(data);
#. Discussion: Wrap in ``openpass::components::common::Port`` and further
``openpass::components::common::Ports``
@@ -142,18 +133,14 @@ Concise summarized Naming Conventions
**Documentation**
#. The following should be documented
* Public functions and class methods
* Classes
* File headers
* Constants
* Private functions or methods with more than 3 arguments and/or complex functionality??
#. Language
* Document "what" it does rather than describing "why"
* Third-person singular verbs should be used to describe what it does
#. Use the below methods to comment in source code. The below 2 syntaxes must be placed just above an entity.
Multi line comments
@@ -190,7 +177,6 @@ Concise summarized Naming Conventions
.. code-block::
@param[in/out] <variable name> <variable description>
#. All parameters description should be aligned as shown below to make them more readable.
.. code-block::
@@ -198,7 +184,6 @@ Concise summarized Naming Conventions
@param[in] shortName Description.
@param[in] longerName Description.
@param[out] veryLongName Description.
#. Example
.. literalinclude:: _static/custom_doc/InlineDocumentation.txt
@@ -227,15 +212,15 @@ To ensure consistent and readable code across the project, **ClangFormat** is re
To install **ClangFormat 15.0.7**, execute the following command depending on the operating system.
.. tabs::
.. tab:: Windows
.. code-block::
pacman -S mingw-w64-x86_64-clang
.. tab:: Linux (Debian Bookworm or Ubuntu 22.04)
.. code-block::
apt -y install clang-format
Loading