载入中...
搜索中...
未找到
eve::thread::Channel类 参考

Thread-safe message queue (love2d-style Channel). Values are strings so the API stays overload-free for Squirrel bindings. Exposed to scripts as "ThreadChannel" (network already owns "Channel"). 更多...

#include <Channel.h>

Public 成员函数

 Channel ()
 
 Channel (std::string name)
 
 ~Channel ()
 
std::string getName () const
 
void push (std::string value)
 
std::string pop ()
 Non-blocking pop; returns "" if empty.
 
std::string demand ()
 Block until a value is available, then pop it.
 
std::string supply (int timeoutMs)
 Block up to timeoutMs; returns "" on timeout.
 
bool hasData () const
 
int getCount () const
 
void clear ()
 

友元

class ThreadPool
 

详细描述

Thread-safe message queue (love2d-style Channel). Values are strings so the API stays overload-free for Squirrel bindings. Exposed to scripts as "ThreadChannel" (network already owns "Channel").

在文件 Channel.h17 行定义.

构造及析构函数说明

◆ Channel() [1/2]

eve::thread::Channel::Channel ( )

在文件 Channel.cpp8 行定义.

◆ Channel() [2/2]

eve::thread::Channel::Channel ( std::string  name)
explicit

在文件 Channel.cpp10 行定义.

◆ ~Channel()

eve::thread::Channel::~Channel ( )
default

成员函数说明

◆ clear()

void eve::thread::Channel::clear ( )

在文件 Channel.cpp64 行定义.

◆ demand()

std::string eve::thread::Channel::demand ( )

Block until a value is available, then pop it.

在文件 Channel.cpp33 行定义.

引用了 state , 以及 v.

◆ getCount()

int eve::thread::Channel::getCount ( ) const

在文件 Channel.cpp59 行定义.

◆ getName()

std::string eve::thread::Channel::getName ( ) const

在文件 Channel.cpp14 行定义.

◆ hasData()

bool eve::thread::Channel::hasData ( ) const

在文件 Channel.cpp54 行定义.

◆ pop()

std::string eve::thread::Channel::pop ( )

Non-blocking pop; returns "" if empty.

在文件 Channel.cpp24 行定义.

引用了 v.

◆ push()

void eve::thread::Channel::push ( std::string  value)

在文件 Channel.cpp16 行定义.

引用了 value.

◆ supply()

std::string eve::thread::Channel::supply ( int  timeoutMs)

Block up to timeoutMs; returns "" on timeout.

在文件 Channel.cpp42 行定义.

引用了 state , 以及 v.

友元及相关函数文档

◆ ThreadPool

friend class ThreadPool
friend

在文件 Channel.h49 行定义.


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