YSTest  PreAlpha_b400_20130424
The YSLib Test Project
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
YSLib::Messaging::MessageQueue类 参考

消息队列。 更多...

#include <ymsg.h>

类 YSLib::Messaging::MessageQueue 继承关系图:
YSLib::Messaging::MessageQueue 的协作图:

Public 类型

typedef size_type SizeType
 
typedef const_iterator Iterator
 迭代器。
 

Public 成员函数

 MessageQueue ()=default
 无参数构造:默认实现。
 
 ~MessageQueue ()
 
bool IsEmpty () const ynothrow
 判断消息队列是否为空。
 
SizeType GetSize () const ynothrow
 取队列中消息容量。
 
Iterator GetBegin () const ynothrow
 取队列起始迭代器。
 
Iterator GetEnd () const ynothrow
 取队列终止迭代器。
 
Priority GetMaxPriority () const ynothrow
 取消息队列中消息的最大优先级。
 
void Clear ()
 清除消息队列。
 
bool Erase (Iterator i)
 从队列中删除迭代器指定的消息。、
 
void Merge (MessageQueue &)
 合并消息队列:移动指定消息队列中的所有消息至此消息队列中。
 
void Peek (Message &msg) const
 从消息队列中取优先级最高的消息存至 msg 中。
 
void Pop ()
 丢弃消息队列中优先级最高的消息。
 
void Push (const Message &msg, Priority prior)
 若消息有效,以指定优先级插入至消息队列中。
 
void Push (const Message &&msg, Priority prior)
 若消息有效,以指定优先级插入至消息队列中。
 
void Remove (Priority)
 移除不大于指定优先级的消息。
 

额外继承的成员函数

- Private 成员函数 继承自 ystdex::noncopyable
 noncopyable (const noncopyable &)=delete
 禁止复制构造。
 
noncopyableoperator= (const noncopyable &)=delete
 禁止赋值复制。
 
 noncopyable ()=default
 protected 构造:默认实现。
 
 ~noncopyable ()=default
 protected 析构:默认实现。
 

详细描述

消息队列。

注解
使用 multiset 模拟。
警告
非虚析构。
自从
build 211

在文件 ymsg.h169 行定义.

成员类型定义说明

迭代器。

自从
build 317

在文件 ymsg.h178 行定义.

在文件 ymsg.h173 行定义.

构造及析构函数说明

YSLib::Messaging::MessageQueue::MessageQueue ( )
inlinedefault

无参数构造:默认实现。

YSLib::Messaging::MessageQueue::~MessageQueue ( )
inline

在文件 ymsg.h184 行定义.

成员函数说明

void YSLib::Messaging::MessageQueue::Clear ( )
inline

清除消息队列。

在文件 ymsg.h210 行定义.

bool YSLib::Messaging::MessageQueue::Erase ( Iterator  i)
inline

从队列中删除迭代器指定的消息。、

前置条件
迭代器从属于本消息队列。
自从
build 317

在文件 ymsg.h218 行定义.

Iterator YSLib::Messaging::MessageQueue::GetBegin ( ) const
inline

取队列起始迭代器。

自从
build 317

在文件 ymsg.h193 行定义.

Iterator YSLib::Messaging::MessageQueue::GetEnd ( ) const
inline

取队列终止迭代器。

自从
build 317

在文件 ymsg.h198 行定义.

Priority YSLib::Messaging::MessageQueue::GetMaxPriority ( ) const
inline

取消息队列中消息的最大优先级。

返回
若消息队列为空则 0 ,否则为最大优先级。
自从
build 288

在文件 ymsg.h205 行定义.

SizeType YSLib::Messaging::MessageQueue::GetSize ( ) const
inline

取队列中消息容量。

在文件 ymsg.h188 行定义.

bool YSLib::Messaging::MessageQueue::IsEmpty ( ) const
inline

判断消息队列是否为空。

在文件 ymsg.h186 行定义.

void MessageQueue::Merge ( MessageQueue mq)

合并消息队列:移动指定消息队列中的所有消息至此消息队列中。

在文件 ymsg.cpp57 行定义.

void YSLib::Messaging::MessageQueue::Peek ( Message msg) const
inline

从消息队列中取优先级最高的消息存至 msg 中。

注解
在队列中保留消息;不检查消息是否有效。
自从
build 271

在文件 ymsg.h233 行定义.

参考 YSLib::begin() , 以及 YB_LIKELY.

函数调用图:

void YSLib::Messaging::MessageQueue::Pop ( )
inline

丢弃消息队列中优先级最高的消息。

注解
消息队列为空时忽略。

在文件 ymsg.h244 行定义.

参考 YSLib::begin() , 以及 YB_LIKELY.

函数调用图:

void YSLib::Messaging::MessageQueue::Push ( const Message msg,
Priority  prior 
)
inline

若消息有效,以指定优先级插入至消息队列中。

自从
build 317

在文件 ymsg.h255 行定义.

void YSLib::Messaging::MessageQueue::Push ( const Message &&  msg,
Priority  prior 
)
inline

若消息有效,以指定优先级插入至消息队列中。

自从
build 317

在文件 ymsg.h265 行定义.

void MessageQueue::Remove ( Priority  p)

移除不大于指定优先级的消息。

自从
build 320

在文件 ymsg.cpp67 行定义.

参考 YSLib::end().

函数调用图:


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