globus_common
15.26
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
globus_priority_q.h
Go to the documentation of this file.
1
/*
2
* Copyright 1999-2006 University of Chicago
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
22
#ifndef GLOBUS_PRIORITY_Q_H
23
#define GLOBUS_PRIORITY_Q_H
24
25
#include "
globus_types.h
"
26
#include "
globus_memory.h
"
27
28
#ifdef __cplusplus
29
extern
"C"
{
30
#endif
31
85
typedef
int (*
globus_priority_q_cmp_func_t
)(
86
void
* priority_1,
87
void
* priority_2);
88
97
typedef
struct
globus_priority_q_s
98
{
99
struct
globus_l_priority_q_entry_s ** heap;
100
int
next_slot;
101
size_t
max_len;
102
globus_memory_t memory;
103
globus_priority_q_cmp_func_t
cmp_func;
104
}
globus_priority_q_t
;
105
106
int
107
globus_priority_q_init
(
108
globus_priority_q_t
* priority_q,
109
globus_priority_q_cmp_func_t
cmp_func);
110
111
int
112
globus_priority_q_destroy
(
113
globus_priority_q_t
* priority_q);
114
115
globus_bool_t
116
globus_priority_q_empty
(
117
globus_priority_q_t
* priority_q);
118
119
int
120
globus_priority_q_size
(
121
globus_priority_q_t
* priority_q);
122
123
int
124
globus_priority_q_enqueue
(
125
globus_priority_q_t
* priority_q,
126
void
* datum,
127
void
* priority);
128
129
void
*
130
globus_priority_q_remove
(
131
globus_priority_q_t
* priority_q,
132
void
* datum);
133
134
/*
135
* it is acceptable to modify the priority already stored within the queue
136
* before making this call. The old priority is not looked at
137
*/
138
void
*
139
globus_priority_q_modify
(
140
globus_priority_q_t
* priority_q,
141
void
* datum,
142
void
* new_priority);
143
144
void
*
145
globus_priority_q_dequeue
(
146
globus_priority_q_t
* priority_q);
147
148
void
*
149
globus_priority_q_first
(
150
globus_priority_q_t
* priority_q);
151
152
void
*
153
globus_priority_q_first_priority
(
154
globus_priority_q_t
* priority_q);
155
156
157
#ifdef __cplusplus
158
}
159
#endif
160
161
#endif
/* GLOBUS_PRIORITY_Q_H */
Generated by
1.8.3.1