规范文档

This commit is contained in:
2026-08-16 19:14:34 +08:00
parent d6d55b3b7d
commit b33b57b0e3
3 changed files with 67 additions and 8 deletions
+9
View File
@@ -1,6 +1,15 @@
## 设计约束
"C:\Program Files\JetBrains\CLion 2026.1\bin\cmake\win\x64\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug --preset vs2022_debug
-S D:\ae\proj\Renderive -B D:\ae\proj\Renderive\cmake-build-vs2022_debug
默认每次运行程序都通过CDB运行 D:\ae\ewdk\EWDK_22621_230929-1800\Program Files\Windows Kits\10\Debuggers\x64\cdb.exe
D:\ae\tools 可能会有有用的工具
写函数 和模块使用下面的约定
[错误处理规范](./Error_handling_specification.md)
[命名约定](./Project_naming_conventions.md)
0. 跟你审计报告 就要大刀阔斧的改 一次性先把问题一次改完 在批量检查 要大步前进
1. 每个状态只能有一个权威来源,禁止在不同对象中重复保存并手工同步。
+58
View File
@@ -0,0 +1,58 @@
# 项目命名规范
* 类型、结构体、枚举、Concept、类型别名:`Upper_Snake_Case`
```cpp
Scene_Base
Frame_Request_Error
Renderable_Id
```
* 函数、参数、局部变量、常量:`lower_snake_case`
```cpp
render_frame()
frame_count
default_capacity
```
* 成员变量:`lower_snake_case_`
```cpp
scene_
pending_exception_
```
* 枚举值:`lower_snake_case`
```cpp
enum class Frame_Request_Error {
none,
cancelled,
renderer_unavailable
};
```
* 模板类型参数:`Upper_Snake_Case`
```cpp
template <class Data_Type, class Observer_Type>
```
* 命名空间:`lower_snake_case`
```cpp
namespace renderive::render_3d
```
* 文件名与主要类型一致:`Upper_Snake_Case`
```text
Scene_Base.hpp
Gpu_Completion_Service.cpp
Low_Latency_Strategy.inl
```
* 内部实现统一使用 `detail` 命名空间。
**总规则:类型大写下划线,值和函数小写下划线,成员变量末尾加 `_`。**
-8
View File
@@ -1,10 +1,2 @@
"C:\Program Files\JetBrains\CLion 2026.1\bin\cmake\win\x64\bin\cmake.exe" -DCMAKE_BUILD_TYPE=Debug --preset vs2022_debug
-S D:\ae\proj\Renderive -B D:\ae\proj\Renderive\cmake-build-vs2022_debug
默认每次运行程序都通过CDB运行 D:\ae\ewdk\EWDK_22621_230929-1800\Program Files\Windows Kits\10\Debuggers\x64\cdb.exe
D:\ae\tools 可能会有有用的工具
运行前使用环境脚本 env.ps1
[错误处理规范](../Error_handling_specification.md)