Grid Community Toolkit  6.2.1566487665 (tag: v6.2.20190829)
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 
87  void * priority_1,
88  void * priority_2);
89 
98 typedef struct globus_priority_q_s
99 {
100  struct globus_l_priority_q_entry_s ** heap;
101  int next_slot;
102  size_t max_len;
103  globus_memory_t memory;
106 
107 int
109  globus_priority_q_t * priority_q,
111 
112 int
114  globus_priority_q_t * priority_q);
115 
118  globus_priority_q_t * priority_q);
119 
120 int
122  globus_priority_q_t * priority_q);
123 
124 int
126  globus_priority_q_t * priority_q,
127  void * datum,
128  void * priority);
129 
130 void *
132  globus_priority_q_t * priority_q,
133  void * datum);
134 
135 /*
136  * it is acceptable to modify the priority already stored within the queue
137  * before making this call. The old priority is not looked at
138  */
139 void *
141  globus_priority_q_t * priority_q,
142  void * datum,
143  void * new_priority);
144 
145 void *
147  globus_priority_q_t * priority_q);
148 
149 void *
151  globus_priority_q_t * priority_q);
152 
153 void *
155  globus_priority_q_t * priority_q);
156 
157 
158 #ifdef __cplusplus
159 }
160 #endif
161 
162 #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:98
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:86
struct globus_priority_q_s globus_priority_q_t
Priority Queue Structure.