docs: update core and debug API docs

This commit is contained in:
2026-03-20 02:35:07 +08:00
parent 0c073db4e8
commit e165dbea1c
73 changed files with 743 additions and 391 deletions

View File

@@ -12,28 +12,36 @@ uint32_t GetRefCount() const;
**返回:** `uint32_t` - 当前引用计数
**线程安全:**
**复杂度:** O(1)
**示例:**
```cpp
#include <XCEngine/Core/RefCounted.h>
#include <cstdio>
class MyObject : public RefCounted {
class MyObject : public XCEngine::Core::RefCounted {
public:
void Debug() {
printf("RefCount: %u\n", GetRefCount());
}
};
MyObject* obj = new MyObject();
printf("After create: %u\n", obj->GetRefCount()); // 1
obj->AddRef();
printf("After AddRef: %u\n", obj->GetRefCount()); // 2
obj->Release();
printf("After Release: %u\n", obj->GetRefCount()); // 1
int main() {
MyObject* obj = new MyObject();
printf("After create: %u\n", obj->GetRefCount());
obj->AddRef();
printf("After AddRef: %u\n", obj->GetRefCount());
obj->Release();
printf("After Release: %u\n", obj->GetRefCount());
obj->Release();
return 0;
}
```
## 相关文档