You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/interfaceconventions.rst
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ When adding new messages, enums, field messages and field enums to OSI we enforc
7
7
8
8
Message Naming
9
9
---------------
10
-
A message definition should always be in camel case. This means that the first letter of each word in a message should be upper case without any spaces. See example below:
10
+
A message definition should always be in PascalCase. This means that the first letter of each word in a message should be upper case without any spaces. See example below:
11
11
12
12
.. code-block:: protobuf
13
13
@@ -37,7 +37,7 @@ All messages that are intended to be exchanged as a stand-alone message, i.e. no
37
37
38
38
Field Message Naming
39
39
---------------------
40
-
After defining a message fields can be added to it in snake case format. This means every letter is lower case and the words are connected through an underline character. See example below:
40
+
After defining a message fields can be added to it in snake_case format. This means every letter is lower case and the words are connected through an underline character. See example below:
41
41
42
42
.. code-block:: protobuf
43
43
@@ -55,7 +55,7 @@ All field numbers of 10000 and above are reserved for user-defined extensions an
55
55
56
56
Enum Naming
57
57
------------
58
-
The naming of an enum should be camel case. See example below:
58
+
The naming of an enum should be PascalCase. See example below:
59
59
60
60
.. code-block:: protobuf
61
61
@@ -70,7 +70,7 @@ The naming of an enum should be camel case. See example below:
70
70
71
71
Enum Field Naming
72
72
------------
73
-
The naming of an enum field should be all in upper case. The start should be converted from the enum name camel case to upper case snake case. It is mandatory to add to the first enum field name the postfix ``_UNKNOWN`` and to the second the postfix ``_OTHER``. After that the naming can be decided by the user. It is often mentioned that the value ``_UNKNOWN`` should not be used in a ``GroundTruth`` message as there are now uncertanties by definition in ``the truth``. These values are mostly used in messages like ``SensorData`` where the content is subject to interpretation. See example below:
73
+
The naming of an enum field should be all in upper case. The start should be converted from the enum name PascalCase to UPPER_CASE_SNAKE_CASE. It is mandatory to add to the first enum field name the postfix ``_UNKNOWN`` and to the second the postfix ``_OTHER``. After that the naming can be decided by the user. It is often mentioned that the value ``_UNKNOWN`` should not be used in a ``GroundTruth`` message as there are now uncertanties by definition in ``the truth``. These values are mostly used in messages like ``SensorData`` where the content is subject to interpretation. See example below:
74
74
75
75
.. code-block:: protobuf
76
76
@@ -92,12 +92,12 @@ Summary
92
92
--------
93
93
Here a small summary for the naming conventions:
94
94
95
-
Messages: camel case
95
+
Messages: PascalCase
96
96
97
-
Message Fields: snake case
97
+
Message Fields: snake_case
98
98
99
-
Enum: camel case
99
+
Enum: PascalCase
100
100
101
-
Enum Fields: upper case, name of enum converted in upper case snake case and then following the specified name
101
+
Enum Fields: Name of enum converted in UPPER_CASE_SNAKE_CASE and then following the specified name
102
102
103
103
After defining the messages do not forget to comment them. See also the `section for commenting <https://opensimulationinterface.github.io/osi-documentation/open-simulation-interface/doc/commenting.html>`_ of fields and messages.
0 commit comments