载入中...
搜索中...
未找到
PlatformEvent.cpp
浏览该文件的文档.
10Message::Message(const std::string& name, const std::vector<Variant>& vargs) : name(name), args(vargs) {}
67 static_cast<void>(pollObservers_.notifyChecked([this]() noexcept { ++pollObserverFailures_; }, *msg));
EVEngine assertion entry point, backed by zeroerr.
#define EV_PARAM_CHECK(cond,...)
Validate a function parameter / public API precondition.
Definition Assert.h:30
Move-only RAII token that owns one observer registration.
Definition Subscription.h:27
A named event carrying an ordered list of Variant payloads. Pushed messages are heap-allocated; the q...
Definition PlatformEvent.h:77
Message(const std::string &name, const std::vector< Variant > &vargs={})
Creates an event message.
Definition PlatformEvent.cpp:10
std::unique_ptr< Message > pollOwned()
Pops the oldest message into an RAII handle, or returns null.
Definition PlatformEvent.cpp:55
std::string pollName()
Script helper: pops one message and returns its name, or "" if none.
Definition PlatformEvent.cpp:72
eve::Subscription subscribePoll(std::function< void(const Message &)> callback)
Subscribe to every message consumed by poll/pollOwned.
Definition PlatformEvent.cpp:31
void pushData(std::string name, std::string data="")
Script helper: pushes an event with an optional string payload.
Definition PlatformEvent.cpp:47
Message * poll()
Pops the oldest message, or nullptr if the queue is empty. @ownership Ownership transfers to the call...
Definition PlatformEvent.cpp:53
std::uint64_t pollObserverFailures_
Definition PlatformEvent.h:188
virtual void pump()=0
Platform hook: pumps the native event queue into this module.
std::queue< std::unique_ptr< Message > > queue
Definition PlatformEvent.h:182
std::string pollData()
Pops one message and returns its first string arg (or ""). Name is discarded — use pollName when you ...
Definition PlatformEvent.cpp:88
eve::Observer< Message > pollObservers_
Definition PlatformEvent.h:186
std::string getLastData() const
First string arg of the message most recently returned by pollName/pollData.
Definition PlatformEvent.cpp:86
void push(Message *msg)
Queues a message. Thread-safe: workers may push completions for the main loop to poll.
Definition PlatformEvent.cpp:35
virtual void wakeWaiters()
Wake a platform-specific blocking wait after a message is queued.
Definition PlatformEvent.h:179
Definition ScenarioRecorder.h:12
static Variant makeString(std::string v)
Constructs a string variant (takes ownership of the value).
Definition PlatformEvent.h:45