载入中...
搜索中...
未找到

#include <Event.h>

类 eve::event::Event 继承关系图:
eve::Module eve::event::sdl::Event

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.
 
Messagepoll ()
 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 Messagewait ()=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.h70 行定义.

构造及析构函数说明

◆ ~Event()

eve::event::Event::~Event ( )
virtual

eve::event::sdl::Event 重载.

在文件 Event.cpp29 行定义.

成员函数说明

◆ clear()

void eve::event::Event::clear ( )
virtual

Drops all queued messages and frees them.

eve::event::sdl::Event 重载.

在文件 Event.cpp93 行定义.

引用了 queue , 以及 queueMu_.

被这些函数引用 eve::event::sdl::Event::clear().

◆ getLastData()

std::string eve::event::Event::getLastData ( ) const

First string arg of the message most recently returned by pollName/pollData.

在文件 Event.cpp74 行定义.

引用了 lastData_.

◆ 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).

在文件 Event.cpp49 行定义.

引用了 queue , 以及 queueMu_.

被这些函数引用 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.

在文件 Event.cpp76 行定义.

引用了 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.

在文件 Event.cpp58 行定义.

引用了 a, eve::event::Message::args, lastData_, n, eve::event::Message::name, poll() , 以及 eve::event::Variant::String.

◆ pump()

virtual void eve::event::Event::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.

参数
msgMessage to queue (must be non-null; ownership transfers to the queue).

在文件 Event.cpp31 行定义.

引用了 EV_PARAM_CHECK, queue, queueMu_ , 以及 wakeWaiters().

被这些函数引用 eve::event::sdl::Event::pump() , 以及 pushData().

◆ pushData()

void eve::event::Event::pushData ( std::string  name,
std::string  data = "" 
)

Script helper: pushes an event with an optional string payload.

参数
nameEvent name.
dataOptional string payload stored as the first argument.

在文件 Event.cpp42 行定义.

引用了 data, eve::event::Variant::makeString(), name , 以及 push().

◆ wait()

virtual Message * eve::event::Event::wait ( )
pure virtual

Platform hook: blocks until a message is available, then polls it.

eve::event::sdl::Event 内被实现.

◆ wakeWaiters()

virtual void eve::event::Event::wakeWaiters ( )
inlineprotectedvirtual

Wake a platform-specific blocking wait after a message is queued.

在文件 Event.h107 行定义.

被这些函数引用 push().

类成员变量说明

◆ lastData_

std::string eve::event::Event::lastData_
protected

在文件 Event.h111 行定义.

被这些函数引用 getLastData(), pollData() , 以及 pollName().

◆ queue

std::queue<Message*> eve::event::Event::queue
protected

在文件 Event.h110 行定义.

被这些函数引用 clear(), poll() , 以及 push().

◆ queueMu_

std::mutex eve::event::Event::queueMu_
protected

在文件 Event.h109 行定义.

被这些函数引用 clear(), poll() , 以及 push().


该类的文档由以下文件生成: