reactor-c
C Runtime for Lingua Franca
Loading...
Searching...
No Matches
pqueue.h File Reference

Priority queue definitions for queues where the priority is a number that can be compared with ordinary numerical comparisons. More...

#include "pqueue_base.h"

Go to the source code of this file.

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_t)
 
size_t get_reaction_position (void *reaction)
 
void set_reaction_position (void *reaction, size_t pos)
 
void print_reaction (void *reaction)
 

Detailed Description

Priority queue definitions for queues where the priority is a number that can be compared with ordinary numerical comparisons.

Author
Marten Lohstroh
Edward A. Lee
Byeonggil Jun

This is used for the reaction queue. The event queue uses a tag_t struct for its priority, so it cannot use this.

Function Documentation

◆ get_reaction_index()

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.

Parameters
reactionA pointer to a reaction_t.

◆ get_reaction_position()

size_t get_reaction_position ( void * reaction)

Return the given reaction's position in the queue.

Parameters
reactionA pointer to a reaction_t.

◆ in_no_particular_order()

int in_no_particular_order ( pqueue_pri_t thiz,
pqueue_pri_t that )

Return 0 regardless of argument order.

Parameters
thizFirst argument.
thatSecond argument.

◆ in_reverse_order()

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.

Parameters
thizFirst argument.
thatSecond argument.

◆ print_reaction()

void print_reaction ( void * reaction)

Print some information about the given reaction. This only prints something if logging is set to DEBUG.

Parameters
reactionA pointer to a reaction_t.

◆ reaction_matches()

int reaction_matches ( void * a,
void * b )

Return 1 if the two arguments are identical pointers.

Parameters
aFirst argument.
bSecond argument.

◆ set_reaction_position()

void set_reaction_position ( void * reaction,
size_t pos )

Set the given reaction's position in the queue.

Parameters
eventA pointer to a reaction_t.
posThe position.