#include <Event.h>
Public 成员函数 | |
| Module_REG (Event) | |
| virtual | ~Event () |
| void | push (Message *msg) |
| Queues a message. Thread-safe: workers may push completions for the main loop to poll. | |
| void | pushData (std::string name, std::string data="") |
| Script helper: pushes an event with an optional string payload. | |
| Message * | poll () |
| Pops the oldest message, or nullptr if the queue is empty (caller must delete). | |
| std::string | pollName () |
| Script helper: pops one message and returns its name, or "" if none. | |
| std::string | getLastData () const |
| First string arg of the message most recently returned by pollName/pollData. | |
| std::string | pollData () |
| Pops one message and returns its first string arg (or ""). Name is discarded — use pollName when you need the type. | |
| virtual void | clear () |
| Drops all queued messages and frees them. | |
| virtual void | pump ()=0 |
| Platform hook: pumps the native event queue into this module. | |
| virtual Message * | wait ()=0 |
| Platform hook: blocks until a message is available, then polls it. | |
Public 成员函数 继承自 eve::Module | |
| virtual | ~Module () |
| virtual std::string | getName () const =0 |
Protected 成员函数 | |
| virtual void | wakeWaiters () |
| Wake a platform-specific blocking wait after a message is queued. | |
Protected 属性 | |
| std::mutex | queueMu_ |
| std::queue< Message * > | queue |
| std::string | lastData_ |
详细描述
构造及析构函数说明
◆ ~Event()
|
virtual |
被 eve::event::sdl::Event 重载.
成员函数说明
◆ clear()
|
virtual |
Drops all queued messages and frees them.
被 eve::event::sdl::Event 重载.
被这些函数引用 eve::event::sdl::Event::clear().
◆ getLastData()
| std::string eve::event::Event::getLastData | ( | ) | const |
◆ Module_REG()
| eve::event::Event::Module_REG | ( | Event | ) |
◆ poll()
| Message * eve::event::Event::poll | ( | ) |
Pops the oldest message, or nullptr if the queue is empty (caller must delete).
被这些函数引用 pollData(), pollName(), eve::rx::Rx::pump() , 以及 eve::event::sdl::Event::wait().
◆ pollData()
| std::string eve::event::Event::pollData | ( | ) |
Pops one message and returns its first string arg (or ""). Name is discarded — use pollName when you need the type.
引用了 a, eve::event::Message::args, data, lastData_, poll() , 以及 eve::event::Variant::String.
◆ pollName()
| std::string eve::event::Event::pollName | ( | ) |
Script helper: pops one message and returns its name, or "" if none.
引用了 a, eve::event::Message::args, lastData_, n, eve::event::Message::name, poll() , 以及 eve::event::Variant::String.
◆ pump()
|
pure virtual |
Platform hook: pumps the native event queue into this module.
在 eve::event::sdl::Event 内被实现.
◆ push()
| void eve::event::Event::push | ( | Message * | msg | ) |
Queues a message. Thread-safe: workers may push completions for the main loop to poll.
- 参数
-
msg Message to queue (must be non-null; ownership transfers to the queue).
引用了 EV_PARAM_CHECK, queue, queueMu_ , 以及 wakeWaiters().
被这些函数引用 eve::event::sdl::Event::pump() , 以及 pushData().
◆ pushData()
| void eve::event::Event::pushData | ( | std::string | name, |
| std::string | data = "" |
||
| ) |
◆ wait()
|
pure virtual |
Platform hook: blocks until a message is available, then polls it.
在 eve::event::sdl::Event 内被实现.
◆ wakeWaiters()
|
inlineprotectedvirtual |
类成员变量说明
◆ lastData_
|
protected |
被这些函数引用 getLastData(), pollData() , 以及 pollName().
◆ queue
|
protected |
◆ queueMu_
|
protected |
该类的文档由以下文件生成:
Public 成员函数 继承自