载入中...
搜索中...
未找到
MainThreadPost.h
浏览该文件的文档.
1#pragma once
2
3// Hand a message back to the main thread from a worker.
4//
5// The thread module's postMain / submitPost need to enqueue onto the event
6// queue, which would make the thread pool depend on the event module. Going
7// through a capability keeps that edge out and lets a build without the event
8// module still use the pool for pure compute.
9
10#include "common/Export.h"
11
12#include <string>
13
14namespace eve::caps {
15
18public:
19 static constexpr const char* capabilityName = "IMainThreadPost";
21 virtual ~IMainThreadPost() = default;
22
29 virtual void prepare() = 0;
30
33 virtual void postToMainThread(std::string name, std::string data) = 0;
34};
35
36} // namespace eve::caps
#define EVENGINE_API_FOUNDATION_INLINE
仅供"只有内联成员"的类型使用的组宏:拥有者 dllexport,消费方不导入。
Definition Export.h:170
std::string name
EVENGINE_API_FOUNDATION_INLINE public API.
virtual void postToMainThread(std::string name, std::string data)=0
Post to main thread.
virtual void prepare()=0
Prepare.
virtual ~IMainThreadPost()=default
I main thread post.