fix: improve doc link navigation and tree display
- Fix link resolution with proper relative/absolute path handling - Improve link styling with underline decoration - Hide leaf nodes from tree, only show directories - Fix log file path for packaged app
This commit is contained in:
39
docs/api/core/event/Clear.md
Normal file
39
docs/api/core/event/Clear.md
Normal file
@@ -0,0 +1,39 @@
|
||||
# Event::Clear
|
||||
|
||||
```cpp
|
||||
void Clear();
|
||||
```
|
||||
|
||||
清空所有订阅。
|
||||
|
||||
**描述**
|
||||
|
||||
移除所有已订阅的回调,清空事件。线程安全。
|
||||
|
||||
**复杂度:** O(n) 其中 n 为订阅数量
|
||||
|
||||
**示例:**
|
||||
|
||||
```cpp
|
||||
#include <XCEngine/Core/Event.h>
|
||||
|
||||
using namespace XCEngine::Core;
|
||||
|
||||
Event<int> event;
|
||||
|
||||
// 订阅多个回调
|
||||
event.Subscribe([](int v) { });
|
||||
event.Subscribe([](int v) { });
|
||||
event.Subscribe([](int v) { });
|
||||
|
||||
// 清空所有订阅
|
||||
event.Clear();
|
||||
|
||||
// 触发(无回调被执行)
|
||||
event.Invoke(42);
|
||||
```
|
||||
|
||||
## 相关文档
|
||||
|
||||
- [Event 总览](event.md) - 返回类总览
|
||||
- [Unsubscribe](Unsubscribe.md) - 退订单个事件
|
||||
Reference in New Issue
Block a user