Queue类 参考

Queue Class. 更多...

#include <cpp_queue.h>

Public 成员函数

kstat_t create (const name_t *name, void *buf, size_t size, size_t max_msg)
 This function will create a buf-queue 更多...
 
kstat_t destory (void)
 This function will delete a queue 更多...
 
kstat_t send (void *msg, size_t size)
 This function will send a msg at the end of queue 更多...
 
kstat_t receive (void *msg, size_t *size, uint32_t millisec)
 This function will receive msg form aqueue 更多...
 
kstat_t flush (void)
 This function will reset queue 更多...
 
kstat_t info_get (kbuf_queue_info_t *info)
 This function will get information of a queue 更多...
 
kbuf_queue_t * self (void)
 This function will get a Queue struct pointer 更多...
 

详细描述

Queue Class.

在文件 cpp_queue.h21 行定义.

成员函数说明

◆ create()

kstat_t create ( const name_t *  name,
void *  buf,
size_t  size,
size_t  max_msg 
)

This function will create a buf-queue

参数
[in]namename of the queue
[in]bufpointer to the buf
[in]sizesize of the buf
[in]max_msgmax size of one msg
返回
the operation status, RHINO_SUCCESS is OK, others is error

◆ destory()

kstat_t destory ( void  )

This function will delete a queue

参数
[in]NULL
返回
the operation status, RHINO_SUCCESS is OK, others is error

◆ flush()

kstat_t flush ( void  )

This function will reset queue

参数
[in]NULL
返回
the operation status, RHINO_SUCCESS is OK, others is error

◆ info_get()

kstat_t info_get ( kbuf_queue_info_t *  info)

This function will get information of a queue

参数
[out]freefree size of the queue buf
[out]totaltotal size of the queue buf
返回
the operation status, RHINO_SUCCESS is OK, others is error

◆ receive()

kstat_t receive ( void *  msg,
size_t *  size,
uint32_t  millisec 
)

This function will receive msg form aqueue

参数
[out]msgpointer to the buf to save msg
[out]sizesize of received msg
[in]millisecmillisec to wait before receiving msg
返回
the operation status, RHINO_SUCCESS is OK, others is error

◆ self()

kbuf_queue_t* self ( void  )

This function will get a Queue struct pointer

参数
[in]none
返回
Queue struct pointer

◆ send()

kstat_t send ( void *  msg,
size_t  size 
)

This function will send a msg at the end of queue

参数
[in]msgpointer to msg to be send
[in]sizesize of the msg
返回
the operation status, RHINO_SUCCESS is OK, others is error

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