ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
CxxUtils
CxxUtils
libcalg
queue.h
Go to the documentation of this file.
1
/*
2
3
Copyright (c) 2005-2008, Simon Howard
4
5
Permission to use, copy, modify, and/or distribute this software
6
for any purpose with or without fee is hereby granted, provided
7
that the above copyright notice and this permission notice appear
8
in all copies.
9
10
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL
11
WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED
12
WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE
13
AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR
14
CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
16
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
17
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
18
19
*/
20
40
41
#ifndef ALGORITHM_QUEUE_H
42
#define ALGORITHM_QUEUE_H
43
44
#ifdef __cplusplus
45
extern
"C"
{
46
#endif
47
51
52
typedef
struct
_Queue
Queue
;
53
57
58
typedef
void
*
QueueValue
;
59
63
64
#define QUEUE_NULL ((void *) 0)
65
72
73
Queue
*
queue_new
(
void
);
74
80
81
void
queue_free
(
Queue
*queue);
82
92
93
int
queue_push_head
(
Queue
*queue,
QueueValue
data);
94
102
103
QueueValue
queue_pop_head
(
Queue
*queue);
104
113
114
QueueValue
queue_peek_head
(
Queue
*queue);
115
125
126
int
queue_push_tail
(
Queue
*queue,
QueueValue
data);
127
135
136
QueueValue
queue_pop_tail
(
Queue
*queue);
137
146
147
QueueValue
queue_peek_tail
(
Queue
*queue);
148
156
157
int
queue_is_empty
(
Queue
*queue);
158
159
#ifdef __cplusplus
160
}
161
#endif
162
163
#endif
/* #ifndef ALGORITHM_QUEUE_H */
164
queue_peek_tail
QueueValue queue_peek_tail(Queue *queue)
Read a value from the tail of a queue, without removing it from the queue.
queue_free
void queue_free(Queue *queue)
Destroy a queue.
queue_push_head
int queue_push_head(Queue *queue, QueueValue data)
Add a value to the head of a queue.
queue_push_tail
int queue_push_tail(Queue *queue, QueueValue data)
Add a value to the tail of a queue.
queue_peek_head
QueueValue queue_peek_head(Queue *queue)
Read value from the head of a queue, without removing it from the queue.
queue_is_empty
int queue_is_empty(Queue *queue)
Query if any values are currently in a queue.
QueueValue
void * QueueValue
A value stored in a Queue.
Definition
queue.h:58
Queue
struct _Queue Queue
A double-ended queue.
Definition
queue.h:52
queue_pop_head
QueueValue queue_pop_head(Queue *queue)
Remove a value from the head of a queue.
queue_new
Queue * queue_new(void)
Create a new double-ended queue.
queue_pop_tail
QueueValue queue_pop_tail(Queue *queue)
Remove a value from the tail of a queue.
Generated on
for ATLAS Offline Software by
1.17.0