UniMRCP
1.3.0
Main Page
Related Pages
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
libs
apr-toolkit
include
apt_cyclic_queue.h
Go to the documentation of this file.
1
/*
2
* Copyright 2008-2014 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
* $Id: apt_cyclic_queue.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
17
*/
18
19
#ifndef APT_CYCLIC_QUEUE_H
20
#define APT_CYCLIC_QUEUE_H
21
22
/**
23
* @file apt_cyclic_queue.h
24
* @brief Cyclic FIFO Queue of Opaque void* Objects
25
*/
26
27
#include "
apt.h
"
28
29
APT_BEGIN_EXTERN_C
30
31
/** Default size (number of elements) of cyclic queue */
32
#define CYCLIC_QUEUE_DEFAULT_SIZE 100
33
34
/** Opaque cyclic queue declaration */
35
typedef
struct
apt_cyclic_queue_t
apt_cyclic_queue_t
;
36
37
/**
38
* Create cyclic queue.
39
* @param size the initial size of the queue
40
* @return the created queue
41
*/
42
APT_DECLARE
(
apt_cyclic_queue_t
*)
apt_cyclic_queue_create
(apr_size_t size);
43
44
/**
45
* Destroy cyclic queue.
46
* @param queue the queue to destroy
47
*/
48
APT_DECLARE
(
void
)
apt_cyclic_queue_destroy
(
apt_cyclic_queue_t
*queue);
49
50
/**
51
* Push object to the queue.
52
* @param queue the queue to push object to
53
* @param obj the object to push
54
*/
55
APT_DECLARE
(
apt_bool_t
)
apt_cyclic_queue_push
(
apt_cyclic_queue_t
*queue,
void
*obj);
56
57
/**
58
* Pop object from the queue.
59
* @param queue the queue to pop message from
60
*/
61
APT_DECLARE
(
void
*)
apt_cyclic_queue_pop
(
apt_cyclic_queue_t
*queue);
62
63
/**
64
* Clear the queue (remove all the elements from the queue).
65
* @param queue the queue to clear
66
*/
67
APT_DECLARE
(
void
)
apt_cyclic_queue_clear
(
apt_cyclic_queue_t
*queue);
68
69
/**
70
* Query whether the queue is empty.
71
* @param queue the queue to query
72
* @return TRUE if empty, otherwise FALSE
73
*/
74
APT_DECLARE
(
apt_bool_t
)
apt_cyclic_queue_is_empty
(const
apt_cyclic_queue_t
*queue);
75
76
77
APT_END_EXTERN_C
78
79
#endif
/* APT_CYCLIC_QUEUE_H */
Generated on Mon Feb 2 2015 19:41:38 for UniMRCP by
1.8.3.1