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

Priority queue declarations for the event queue and reaction queue. 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 event_matches (void *event1, void *event2)
 
int reaction_matches (void *a, void *b)
 
pqueue_pri_t get_event_time (void *event)
 
pqueue_pri_t get_reaction_index (void *reaction_t)
 
size_t get_event_position (void *event)
 
size_t get_reaction_position (void *reaction)
 
void set_event_position (void *event, size_t pos)
 
void set_reaction_position (void *reaction, size_t pos)
 
void print_reaction (void *reaction)
 
void print_event (void *event)
 

Detailed Description

Priority queue declarations for the event queue and reaction queue.

Author
Marten Lohstroh
Edward A. Lee

Function Documentation

◆ event_matches()

int event_matches ( void * event1,
void * event2 )

Return 1 if the two events have the same trigger.

Parameters
event1A pointer to an event_t.
event2A pointer to an event_t.

◆ get_event_position()

size_t get_event_position ( void * event)

Return the given event's position in the queue.

Parameters
eventA pointer to an event_t.

◆ get_event_time()

pqueue_pri_t get_event_time ( void * event)

Report a priority equal to the time of the given event. This is used for sorting pointers to event_t structs in the event queue.

Parameters
aA pointer to an event_t.

◆ 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_event()

void print_event ( void * event)

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

Parameters
eventA pointer to an event_t.

◆ 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_event_position()

void set_event_position ( void * event,
size_t pos )

Set the given event's position in the queue.

Parameters
eventA pointer to an event_t
posThe position.

◆ 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.