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