Common Update: Better Doxygen Style
This commit is contained in:
@@ -1,33 +1,25 @@
|
||||
/*****************************************************************************/
|
||||
/**
|
||||
* Description: A simple circular FIFO bounded queue
|
||||
*
|
||||
* Author: Fan Hao
|
||||
* Date: 2023-02-23 10:29
|
||||
* LastEditors: Fan Hao
|
||||
* LastEditTime: 2023-02-23 12:53
|
||||
* Revisions: Rev 0.0
|
||||
* History:
|
||||
* [2023-02-23]: Initial Version.
|
||||
*
|
||||
* Copyright(c) 2023 Beijing Institute of Technology.
|
||||
* Lab of Communication and Networking
|
||||
* NOTE: Forked from https://github.com/chrismerck/rpa_queue.git
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
* @file circ_queue.h
|
||||
* @author FanHao ([email protected])
|
||||
* @brief A simple circular FIFO bounded queue
|
||||
* @version 0.1
|
||||
* @date 2023-02-23
|
||||
* @note Forked from https://github.com/chrismerck/rpa_queue.git
|
||||
* @copyright Copyright(c) 2024 Beijing Institute of Technology.\n
|
||||
* Lab of Communication and Network
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
******************************************************************************/
|
||||
******************************************************************************/
|
||||
|
||||
/**
|
||||
* @addtogroup Utility
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup CircularQueue
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef CIRC_QUEUE_H
|
||||
#define CIRC_QUEUE_H
|
||||
@@ -36,20 +28,18 @@
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
/**
|
||||
* opaque structure
|
||||
*/
|
||||
typedef struct {
|
||||
typedef struct
|
||||
{
|
||||
void **data;
|
||||
volatile uint32_t nelts; /**< # elements */
|
||||
uint32_t in; /**< next empty location */
|
||||
uint32_t out; /**< next filled location */
|
||||
uint32_t bounds;/**< max size of queue */
|
||||
uint32_t in; /**< next empty location */
|
||||
uint32_t out; /**< next filled location */
|
||||
uint32_t bounds; /**< max size of queue */
|
||||
} CIRC_QUEUE;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* create a FIFO queue
|
||||
* @param queue The new queue
|
||||
@@ -58,10 +48,10 @@ typedef struct {
|
||||
*/
|
||||
bool CircQueueCreate(CIRC_QUEUE **queue, uint32_t queue_capacity);
|
||||
|
||||
/** free queue memory -- call after destroy
|
||||
/** free queue memory -- call after destroy
|
||||
* @note we do not free in destroy() to follow pthreads convention
|
||||
*/
|
||||
void CircQueueFree(CIRC_QUEUE * queue);
|
||||
*/
|
||||
void CircQueueFree(CIRC_QUEUE *queue);
|
||||
|
||||
/**
|
||||
* Detects when the CIRC_QUEUE is full. This utility function is expected
|
||||
@@ -86,7 +76,6 @@ bool isCircQueueEmpty(CIRC_QUEUE *queue);
|
||||
*/
|
||||
bool CircQueuePush(CIRC_QUEUE *queue, void *data);
|
||||
|
||||
|
||||
/**
|
||||
* pop/get an object from the queue, blocking if the queue is already empty
|
||||
*
|
||||
@@ -109,3 +98,7 @@ bool CircQueuePop(CIRC_QUEUE *queue, void **data);
|
||||
uint32_t CircQueueSize(CIRC_QUEUE *queue);
|
||||
|
||||
#endif /* CIRC_QUEUE_H */
|
||||
|
||||
/** @} CircularQueue*/
|
||||
|
||||
/** @} Utility*/
|
||||
Reference in New Issue
Block a user