threading/: - Rename 19 camelCase method files to hyphenated names - task-system: createtaskgroup→create-task-group, etc. - tasksystemconfig: enabletaskprofiling→enable-task-profiling, etc. - thread: getcurrentid→get-current-id, etc. - task: addref→add-ref, getid→get-id, etc. math/: - Rename underscore operator files to hyphenated - vector3: operator_add→operator-add, etc. - matrix4: gettranslation→get-translation, etc. - vector4: tovector3→to-vector3, constructor_vector3→constructor-vector3 - sphere: sphere_constructor→sphere-constructor, etc. memory/: - Remove duplicate memorymanager/ folder (kept manager/ which was correct) core/: - filewriter: Consolidate ctor-default.md and ctor-file.md into constructor.md - Rename dtor.md→destructor.md debug/: - filelogsink: Rename construct.md→constructor.md, ~filelogsink.md→destructor.md All overview pages updated with new file references.
737 B
737 B
ITask::OnComplete
virtual void OnComplete()
任务完成回调。可在派生类中重写此方法,以在任务执行完毕后执行清理或后续操作。
参数: 无
返回: 无
复杂度: 取决于具体实现
示例:
class DataLoadTask : public ITask {
public:
explicit DataLoadTask(const String& path) : m_path(path) {}
void Execute() override {
m_data = LoadFromFile(m_path);
}
void OnComplete() override {
printf("Data loaded, size: %zu\n", m_data.Size());
ProcessData(m_data);
}
private:
String m_path;
Containers::Vector<uint8_t> m_data;
};
相关文档
- ITask 总览 - 返回类总览