Grid Community Toolkit  6.2.1541705016
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 
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;
105 
106 int
108  globus_priority_q_t * priority_q,
110 
111 int
113  globus_priority_q_t * priority_q);
114 
117  globus_priority_q_t * priority_q);
118 
119 int
121  globus_priority_q_t * priority_q);
122 
123 int
125  globus_priority_q_t * priority_q,
126  void * datum,
127  void * priority);
128 
129 void *
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 *
140  globus_priority_q_t * priority_q,
141  void * datum,
142  void * new_priority);
143 
144 void *
146  globus_priority_q_t * priority_q);
147 
148 void *
150  globus_priority_q_t * priority_q);
151 
152 void *
154  globus_priority_q_t * priority_q);
155 
156 
157 #ifdef __cplusplus
158 }
159 #endif
160 
161 #endif /* GLOBUS_PRIORITY_Q_H */
Common Primitive Types.
int globus_priority_q_init(globus_priority_q_t *priority_q, globus_priority_q_cmp_func_t cmp_func)
Initialize a priority queue.
Definition: globus_priority_q.c:118
int globus_priority_q_size(globus_priority_q_t *priority_q)
Priority Queue Size.
Definition: globus_priority_q.c:252
int globus_priority_q_enqueue(globus_priority_q_t *priority_q, void *datum, void *priority)
Add a Datum to a Priority Queue.
Definition: globus_priority_q.c:293
void * globus_priority_q_dequeue(globus_priority_q_t *priority_q)
Remove a Datum From A Priority Queue.
Definition: globus_priority_q.c:359
int globus_bool_t
Boolean type.
Definition: globus_types.h:93
int globus_priority_q_destroy(globus_priority_q_t *priority_q)
Destroy a Priority Queue.
Definition: globus_priority_q.c:180
globus_bool_t globus_priority_q_empty(globus_priority_q_t *priority_q)
Priority Queue Empty Predicate.
Definition: globus_priority_q.c:225
Memory Pool.
void * globus_priority_q_first_priority(globus_priority_q_t *priority_q)
Get the Highest Priority in Priority Queue.
Definition: globus_priority_q.c:440
void * globus_priority_q_remove(globus_priority_q_t *priority_q, void *datum)
Remove an Arbitrary Datum from a Priority Queue.
Definition: globus_priority_q.c:471
void * globus_priority_q_first(globus_priority_q_t *priority_q)
Get the Highest-Priority Datum From a Priority Queue.
Definition: globus_priority_q.c:408
Priority Queue Structure.
Definition: globus_priority_q.h:97
void * globus_priority_q_modify(globus_priority_q_t *priority_q, void *datum, void *new_priority)
Modify the Priority of Datum.
Definition: globus_priority_q.c:561
int(* globus_priority_q_cmp_func_t)(void *priority_1, void *priority_2)
Priority Comparison Predicate.
Definition: globus_priority_q.h:85
struct globus_priority_q_s globus_priority_q_t
Priority Queue Structure.