XWOS API
4.0
XWOS C/C++ API参考手册
|
循环队列 更多...
#include <string.h>
#include <xwos/standard.h>
#include <xwos/lib/object.h>
#include <xwos/lib/bclst.h>
#include <xwos/osal/lock/spinlock.h>
#include <xwos/osal/sync/sem.h>
#include <xwmd/isc/xwcq/mif.h>
函数 | |
static void | xwcq_construct (struct xwcq *cq, xwu8_t *mem) |
循环队列对象的构造函数 | |
static void | xwcq_destruct (struct xwcq *cq) |
循环队列对象的析构函数 | |
static xwer_t | xwcq_gc (struct xwos_object *obj) |
循环队列对象的垃圾回收函数 | |
static xwer_t | xwcq_activate (struct xwcq *cq, xwsz_t slotsize, xwsz_t slotnum, xwobj_gc_f gcfunc) |
激活循环队列对象 | |
xwer_t | xwcq_init (struct xwcq *cq, xwsz_t slotsize, xwsz_t slotnum, xwu8_t *mem) |
XWCQ API:初始化循环队列 | |
xwer_t | xwcq_fini (struct xwcq *cq) |
XWCQ API:销毁循环队列对象 | |
xwsq_t | xwcq_get_tik (struct xwcq *cq) |
XWCQ API:获取循环队列对象的标签 | |
xwer_t | xwcq_acquire (xwcq_d cqd) |
XWCQ API:检查循环队列对象的标签并增加引用计数 | |
xwer_t | xwcq_release (xwcq_d cqd) |
XWCQ API:检查循环队列对象的标签并增加引用计数 | |
xwer_t | xwcq_grab (struct xwcq *cq) |
XWCQ API:增加循环队列对象的引用计数 | |
xwer_t | xwcq_put (struct xwcq *cq) |
XWCQ API:减少循环队列对象的引用计数 | |
xwer_t | xwcq_eq (struct xwcq *cq, const xwu8_t *data, xwsz_t *size) |
XWCQ API:将数据发送到循环队列的 尾端 (入队,EnQueue) | |
xwer_t | xwcq_jq (struct xwcq *cq, const xwu8_t *data, xwsz_t *size) |
XWCQ API:将数据发送循环队列的 首端 (插队,Jump the Queue) | |
xwer_t | xwcq_dq (struct xwcq *cq, xwu8_t *buf, xwsz_t *size) |
XWCQ API: 等待从循环队列的 首端 接收数据 (离队,DeQueue) | |
xwer_t | xwcq_dq_to (struct xwcq *cq, xwu8_t *buf, xwsz_t *size, xwtm_t to) |
XWCQ API: 限时等待从循环队列的 首端 接收数据 (离队,DeQueue) | |
xwer_t | xwcq_dq_unintr (struct xwcq *cq, xwu8_t *buf, xwsz_t *size) |
XWCQ API: 等待从循环队列的 首端 接收数据 (离队,DeQueue), 并且等待不可被中断 | |
xwer_t | xwcq_trydq (struct xwcq *cq, xwu8_t *buf, xwsz_t *size) |
XWCQ API: 尝试从循环队列的 首端 接收数据 (离队,DeQueue) | |
xwer_t | xwcq_rq (struct xwcq *cq, xwu8_t *buf, xwsz_t *size) |
XWCQ API: 等待从循环队列的 尾端 接收数据 (反向离队,Reversely deQueue) | |
xwer_t | xwcq_rq_to (struct xwcq *cq, xwu8_t *buf, xwsz_t *size, xwtm_t to) |
XWCQ API: 限时等待从循环队列的 尾端 接收数据 (反向离队,Reversely deQueue) | |
xwer_t | xwcq_rq_unintr (struct xwcq *cq, xwu8_t *buf, xwsz_t *size) |
XWCQ API: 等待从循环队列的 尾端 接收数据 (反向离队,Reversely deQueue), 并且等待不可被中断 | |
xwer_t | xwcq_tryrq (struct xwcq *cq, xwu8_t *buf, xwsz_t *size) |
XWCQ API: 尝试从循环队列的 尾端 接收数据 (反向离队,Reversely deQueue) | |
xwer_t | xwcq_pfq (struct xwcq *cq, xwu8_t *buf, xwsz_t *size) |
XWCQ API: 等待从循环队列 头端 拷贝数据 (Peek at the Front of Queue) | |
xwer_t | xwcq_pfq_to (struct xwcq *cq, xwu8_t *buf, xwsz_t *size, xwtm_t to) |
XWCQ API: 限时等待从循环队列 头端 拷贝数据 (Peek at the Front of Queue) | |
xwer_t | xwcq_pfq_unintr (struct xwcq *cq, xwu8_t *buf, xwsz_t *size) |
XWCQ API: 等待从循环队列 头端 拷贝数据 (Peek at the Front of Queue), 并且等待不可被中断 | |
xwer_t | xwcq_trypfq (struct xwcq *cq, xwu8_t *buf, xwsz_t *size) |
XWCQ API: 尝试从循环队列 头端 拷贝数据 (Peek at the Front of Queue) | |
xwer_t | xwcq_prq (struct xwcq *cq, xwu8_t *buf, xwsz_t *size) |
XWCQ API: 等待从循环队列 尾端 拷贝数据 (Peek at the Rear of Queue) | |
xwer_t | xwcq_prq_to (struct xwcq *cq, xwu8_t *buf, xwsz_t *size, xwtm_t to) |
XWCQ API: 限时等待从循环队列 尾端 拷贝数据 (Peek at the Rear of Queue) | |
xwer_t | xwcq_prq_unintr (struct xwcq *cq, xwu8_t *buf, xwsz_t *size) |
XWCQ API: 等待从循环队列 尾端 拷贝数据 (Peek at the Rear of Queue), 并且等待不可被中断 | |
xwer_t | xwcq_tryprq (struct xwcq *cq, xwu8_t *buf, xwsz_t *size) |
XWCQ API: 尝试从循环队列 尾端 拷贝数据 (Peek at the Rear of Queue) | |
xwer_t | xwcq_flush (struct xwcq *cq) |
XWCQ API: 清空循环队列 | |
xwer_t | xwcq_get_capacity (struct xwcq *cq, xwsz_t *capbuf) |
XWCQ API: 获取循环队列的容量 | |
xwer_t | xwcq_get_size (struct xwcq *cq, xwsz_t *szbuf) |
XWCQ API: 获取循环队列的单个数据槽的大小 | |
xwer_t | xwcq_get_availability (struct xwcq *cq, xwsz_t *avbbuf) |
XWCQ API: 获取循环队列中有效数据槽的数量 | |
xwer_t | xwcq_bind (struct xwcq *cq, struct xwos_sel *sel, xwsq_t pos) |
XWOS API:绑定循环队列对象到信号选择器 | |
xwer_t | xwcq_unbind (struct xwcq *cq, struct xwos_sel *sel) |
XWOS API:从信号选择器上解绑循环队列对象 | |
循环队列
This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at http://mozilla.org/MPL/2.0/.
在文件 xwcq.c 中定义.
|
static |
激活循环队列对象
[in] | cq | 循环队列对象的指针 |
[in] | slotsize | 数据槽的大小 |
[in] | slotnum | 数据槽的个数 |
[in] | gcfunc | 垃圾回收函数:当对象应用计数为0,调用此函数回收资源。 |
<No error
|
static |
循环队列对象的析构函数
[in] | cq | 循环队列对象的指针 |
|
static |
循环队列对象的垃圾回收函数
[in] | obj | 循环队列对象的指针 |
<No error