1- Code Style rules
2- ================
1+ Code Style
2+ ==========
33
44Identifiers
55-----------
@@ -26,18 +26,27 @@ The following identifiers are in CamelCase:
2626Capital letters within a snake\_ case identifier are allowed for proper nouns and
2727abbreviations.
2828
29+ ### Common names
30+
31+ Common identifiers:
32+
33+ - ` i ` , ` j ` , ` k ` : Index inside a loop.
34+ - ` it ` , ` jt ` , ` kt ` : Iterator inside a loop.
35+ - ` r ` : Return value being prepared.
36+ - ` first ` , ` last ` : Iterator arguments to a function.
37+
2938### Prefixes and Suffixes
3039
3140Common prefixes and suffixes:
3241
3342 - prefix ` num_ ` : Size of a list of items. The prefixed name should be plural
3443 - suffix ` _nr ` : Ordinal of an item.
3544 - suffix ` _i ` ` _j ` ` _k ` : Index inside a loop associated with an specific list.
36- - suffix ` _it ` ` _jt ` ` _kt1 ` : Iterator inside a loop associated with an specific list.
45+ - suffix ` _it ` ` _jt ` ` _kt ` : Iterator inside a loop associated with an specific list.
3746 - prefix ` _ ` : Private or protected member variables and functions.
3847 - suffix ` _ ` : A variable after conversion to a different type.
39- - prefix ` tt_ ` : A macro
4048 - suffix ` _type ` : A type created inside a class.
49+ - prefix ` tt_ ` : A macro
4150
4251Private or protected member variables are prefixed with "\_ ", so that
4352getter/setter member functions names will not alias with the variables.
@@ -73,7 +82,7 @@ variable would be a mutex named `mutex`.
7382Two phase construction
7483----------------------
7584
76- When a polymorphic class needs to polymorphic initialization and destruction it should
85+ When a polymorphic class needs polymorphic initialization and destruction it should
7786add the following two virtual functions:
7887
7988 - virtual void ` init() `
@@ -114,6 +123,6 @@ Subsystems
114123----------
115124
116125A subsystem will have a name in the ` system_status_type ` enum, and will have a global function under the same name
117- suffixed with \_ start. This subsystem_start function is used to initialize and register the deinitialize function
118- with the system_status . The subsystem_start function must be low latency so that it can be called very often to make
126+ suffixed with \_ start. This subsystem \_ start function is used to initialize and register the deinitialize function
127+ with the system \_ status . The subsystem \_ start function must be low latency so that it can be called very often to make
119128sure the subsystem is started when functionality of the subsystem is used for the first time.
0 commit comments