UniMRCP  1.7.0
apt_cyclic_queue.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2015 Arsen Chaloyan
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef APT_CYCLIC_QUEUE_H
18 #define APT_CYCLIC_QUEUE_H
19 
20 /**
21  * @file apt_cyclic_queue.h
22  * @brief Cyclic FIFO Queue of Opaque void* Objects
23  */
24 
25 #include "apt.h"
26 
28 
29 /** Default size (number of elements) of cyclic queue */
30 #define CYCLIC_QUEUE_DEFAULT_SIZE 100
31 
32 /** Opaque cyclic queue declaration */
34 
35 /**
36  * Create cyclic queue.
37  * @param size the initial size of the queue
38  * @return the created queue
39  */
41 
42 /**
43  * Destroy cyclic queue.
44  * @param queue the queue to destroy
45  */
47 
48 /**
49  * Push object to the queue.
50  * @param queue the queue to push object to
51  * @param obj the object to push
52  */
54 
55 /**
56  * Pop object from the queue.
57  * @param queue the queue to pop message from
58  */
60 
61 /**
62  * Clear the queue (remove all the elements from the queue).
63  * @param queue the queue to clear
64  */
66 
67 /**
68  * Query whether the queue is empty.
69  * @param queue the queue to query
70  * @return TRUE if empty, otherwise FALSE
71  */
73 
74 
76 
77 #endif /* APT_CYCLIC_QUEUE_H */
apt_bool_t apt_cyclic_queue_push(apt_cyclic_queue_t *queue, void *obj)
#define APT_END_EXTERN_C
Definition: apt.h:38
void apt_cyclic_queue_destroy(apt_cyclic_queue_t *queue)
int apt_bool_t
Definition: apt.h:57
apt_bool_t apt_cyclic_queue_is_empty(const apt_cyclic_queue_t *queue)
#define APT_BEGIN_EXTERN_C
Definition: apt.h:36
#define APT_DECLARE(type)
Definition: apt.h:53
APR Toolkit Definitions.
void * apt_cyclic_queue_pop(apt_cyclic_queue_t *queue)
void apt_cyclic_queue_clear(apt_cyclic_queue_t *queue)
apt_cyclic_queue_t * apt_cyclic_queue_create(apr_size_t size)
struct apt_cyclic_queue_t apt_cyclic_queue_t
Definition: apt_cyclic_queue.h:33