|
NexusForce 1.0.0
A rigorously engineered full-stack C++ backend library.
|
线程安全的有界环形队列(非阻塞) 更多...
#include <bounded_queue.hpp>
Public 成员函数 | |
| bounded_queue (const size_t cap) | |
| 构造指定容量的队列 | |
| bool | full () const noexcept |
| bool | empty () const noexcept |
| size_t | size () const noexcept |
| size_t | capacity () const noexcept |
| void | push (T &&item) noexcept |
| 向队尾压入元素(调用者需确保队列未满) | |
| T | pop () noexcept |
| 从队首弹出元素(调用者需确保队列非空) | |
| T & | front () noexcept |
| 访问队首元素 | |
线程安全的有界环形队列(非阻塞)
| T | 元素类型 |
基于环形缓冲区实现,push/pop 为 O(1) 操作。 调用者需自行处理满队列时的溢出策略。
在文件 bounded_queue.hpp 第 15 行定义.
|
inlineexplicit |
|
inlinenodiscardnoexcept |
在文件 bounded_queue.hpp 第 47 行定义.
|
inlinenodiscardnoexcept |
在文件 bounded_queue.hpp 第 41 行定义.
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |
|
inlinenoexcept |
|
inlinenodiscardnoexcept |
在文件 bounded_queue.hpp 第 44 行定义.