cpp_queue.h
浏览该文件的文档.
1 /*
2  * Copyright (C) 2015-2017 Alibaba Group Holding Limited
3  */
4 
5 #include <stdint.h>
6 #include <k_api.h>
7 
12 namespace AOS {
13 
14 #define Queue_WAIT_FOREVER 0xFFFFFFFFU
15 
21  class Queue
22  {
23  public:
32  kstat_t create(const name_t *name, void *buf, size_t size,
33  size_t max_msg);
34 
40  kstat_t destory(void);
41 
48  kstat_t send(void *msg, size_t size);
49 
57  kstat_t receive(void *msg, size_t *size, uint32_t millisec);
58 
64  kstat_t flush(void);
65 
72  kstat_t info_get(kbuf_queue_info_t *info);
73 
79  kbuf_queue_t *self(void);
80 
81  private:
85  kbuf_queue_t _buf_queue_def;
86  };
87 
88 }
Queue Class.
Definition: cpp_queue.h:22
kstat_t destory(void)
This function will delete a queue
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
kstat_t send(void *msg, size_t size)
This function will send a msg at the end of queue
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 receive(void *msg, size_t *size, uint32_t millisec)
This function will receive msg form aqueue
Definition: cpp_mutex.h:21