reactor-c
C Runtime for Lingua Franca
|
Priority queue definitions for queues where the priority is a number that can be compared with ordinary numerical comparisons. More...
Functions | |
int | in_reverse_order (pqueue_pri_t thiz, pqueue_pri_t that) |
int | in_no_particular_order (pqueue_pri_t thiz, pqueue_pri_t that) |
int | reaction_matches (void *a, void *b) |
pqueue_pri_t | get_reaction_index (void *reaction) |
size_t | get_reaction_position (void *reaction) |
void | set_reaction_position (void *reaction, size_t pos) |
void | print_reaction (void *reaction) |
Priority queue definitions for queues where the priority is a number that can be compared with ordinary numerical comparisons.
This is used for the reaction queue. The event queue uses a tag_t
struct for its priority, so it cannot use this.
pqueue_pri_t get_reaction_index | ( | void * | reaction_t | ) |
Report a priority equal to the index of the given reaction. Used for sorting pointers to reaction_t structs in the blocked and executing queues.
reaction | A pointer to a reaction_t. |
size_t get_reaction_position | ( | void * | reaction | ) |
Return the given reaction's position in the queue.
reaction | A pointer to a reaction_t. |
int in_no_particular_order | ( | pqueue_pri_t | thiz, |
pqueue_pri_t | that ) |
Return 0 regardless of argument order.
thiz | First argument. |
that | Second argument. |
int in_reverse_order | ( | pqueue_pri_t | thiz, |
pqueue_pri_t | that ) |
Return 1 if the first argument is greater than the second and zero otherwise.
thiz | First argument. |
that | Second argument. |
void print_reaction | ( | void * | reaction | ) |
Print some information about the given reaction. This only prints something if logging is set to DEBUG.
reaction | A pointer to a reaction_t. |
int reaction_matches | ( | void * | a, |
void * | b ) |
Return 1 if the two arguments are identical pointers.
a | First argument. |
b | Second argument. |
void set_reaction_position | ( | void * | reaction, |
size_t | pos ) |
Set the given reaction's position in the queue.
event | A pointer to a reaction_t. |
pos | The position. |