reactor-c
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
pqueue_tag.h
Go to the documentation of this file.
1
16#ifndef PQUEUE_TAG_H
17#define PQUEUE_TAG_H
18
19#include "pqueue_base.h"
20#include "tag.h"
21
52typedef struct {
54 size_t pos; // Needed by any pqueue element.
55 int is_dynamic; // Non-zero to free this struct when the queue is freed.
57
62
71
78
85
94
106
118
126
133
140
150
160
168
177
178#endif // PQUEUE_TAG_H
return address
Definition hashmap.h:74
size_t pqueue_tag_size(pqueue_tag_t *q)
Return the size of the queue.
Definition pqueue_tag.c:104
int pqueue_tag_insert_if_no_match(pqueue_tag_t *q, tag_t t)
Insert a tag into the queue if the tag is not already in the queue.
Definition pqueue_tag.c:127
void pqueue_tag_remove_up_to(pqueue_tag_t *q, tag_t t)
Remove items from the queue with tags up to and including the specified tag.
Definition pqueue_tag.c:163
pqueue_tag_element_t * pqueue_tag_peek(pqueue_tag_t *q)
Return highest-ranking item (the one with the least tag) without removing it.
Definition pqueue_tag.c:135
pqueue_tag_t * pqueue_tag_init(size_t initial_size)
Create a priority queue sorted by tags.
Definition pqueue_tag.c:84
int pqueue_tag_insert(pqueue_tag_t *q, pqueue_tag_element_t *d)
Insert an element into the queue.
Definition pqueue_tag.c:108
void pqueue_tag_free(pqueue_tag_t *q)
Free all memory used by the queue including elements that are marked dynamic.
Definition pqueue_tag.c:95
int pqueue_tag_insert_tag(pqueue_tag_t *q, tag_t t)
Insert a tag into the queue.
Definition pqueue_tag.c:112
pqueue_tag_element_t * pqueue_tag_find_with_tag(pqueue_tag_t *q, tag_t t)
Return the first item with the specified tag or NULL if there is none.
Definition pqueue_tag.c:119
tag_t pqueue_tag_peek_tag(pqueue_tag_t *q)
Return the least tag in the queue or FOREVER if the queue is empty.
Definition pqueue_tag.c:139
tag_t pqueue_tag_pop_tag(pqueue_tag_t *q)
Pop the least-tag element from the queue and return its tag.
Definition pqueue_tag.c:149
pqueue_t pqueue_tag_t
Type of a priority queue sorted by tags.
Definition pqueue_tag.h:61
void pqueue_tag_remove(pqueue_tag_t *q, pqueue_tag_element_t *e)
Remove an item from the queue.
Definition pqueue_tag.c:159
pqueue_tag_element_t * pqueue_tag_pop(pqueue_tag_t *q)
Pop the least-tag element from the queue.
Definition pqueue_tag.c:145
Definition pqueue_base.h:67
The type for an element in a priority queue that is sorted by tag.
Definition pqueue_tag.h:52
tag_t tag
Definition pqueue_tag.h:53
size_t pos
Definition pqueue_tag.h:54
int is_dynamic
Definition pqueue_tag.h:55
Definition tag.h:73
Time and tag definitions and functions for Lingua Franca.