- Prefix
m_– always use for class fields (e.g.,m_event_hub,m_task_manager). - Prefixes
p_andstr_– optional when a function or method has more than five variables or arguments of different types. For fewer than five variables, these prefixes may be omitted. - Boolean variables – start with
is,has,use,enableor withm_is_,m_has_and so on for class fields (e.g.,is_connected,m_is_active). - Prefixes
b_,n_,f_– do not use.
- All code comments and Doxygen documentation must be in English.
- Use
/// \\briefbefore functions and classes. - Do not start descriptions with
The.
- If a file contains only one class, use
CamelCase(e.g.,TradeManager.hpp). - If a file contains multiple classes, utilities, or helper structures, use
snake_case(e.g.,trade_utils.hpp,market_event_listener.hpp).
- Class, struct, and enum names –
CamelCase. - Method names –
snake_case.
- Methods must be named in
snake_case. - Getter methods may omit the
get_prefix when:- The method performs no complex computations and simply returns a reference or value.
- The method provides access to an internal object rather than returning a computed value.
- The method behaves like a property of the object, similar to
size()orempty()in the STL.
- Use
get_when:- The method computes the value it returns.
- Omitting
get_could make the method name misleading.
- Indent with 4 spaces; do not use tabs.
- Place opening braces on the same line as class, method, and namespace declarations.
- Do not use
using namespace; qualify names with their namespaces (e.g.,std::). - Project headers come before system headers in include lists.
- Each project-owned C/C++ header must start with
#pragma oncefollowed by a non-reserved include guard derived from the project prefix and header path:SIMPLE_NAMED_PIPE_HEADER_<PATH>_<FILE>_<EXT>_INCLUDED. - Do not use guard names that start with an underscore, start with an underscore followed by an uppercase letter, or contain a double underscore.
- Implementation fragments such as
.ipp,.inl, or.tppmay remain unguarded if they are only included from already guarded headers and are not intended for direct inclusion.
- Constants and macro names use
UPPER_SNAKE_CASE(e.g.,MAX_CLIENTS). - Enum values also follow
CamelCase. - Mark classes that should not be inherited from with
finaland useoverridefor overridden virtual methods.
-
Commit messages are written in English using Conventional Commits.
-
Format:
git commit -a -m "type(scope): short summary" -m "Detailed description of changes."
-
Allowed types:
feat:– new functionalityfix:– bug fixrefactor:– refactoring without behavior changesperf:– performance improvementstest:– add or modify testsdocs:– documentation changesbuild:– build system or dependency updatesci:– CI/CD configuration changeschore:– tasks that do not affect production code