EmbeddedEtcher
heap.h File Reference

Heap implementation for the tasks of the operating system. More...

#include "ostypes.h"
Include dependency graph for heap.h:

Go to the source code of this file.

Functions

void osHeapInit (osHeapNode_t *ioarray)
 
void osHeapHeapify (osHeapNode_t *ioarray, uint8_t iind)
 
void osHeapBuild (osHeapNode_t *ioarray)
 
uint8_t osHeapMaximum (osHeapNode_t *ioarray, osHeapNode_t *iomax)
 
uint8_t osHeapExtractMaximum (osHeapNode_t *ioarray, osHeapNode_t *iomax)
 
uint8_t osHeapInsert (osHeapNode_t *ioarray, osHeapNode_t x)
 
void osHeapPrintS (osHeapNode_t *ioarray)
 
uint8_t osHeapIsEmpty (osHeapNode_t *ioarray)
 

Detailed Description

Heap implementation for the tasks of the operating system.

Author
Maximilian Stiefel
Date
8 Jan 2018

Function Documentation

◆ osHeapBuild()

void osHeapBuild ( osHeapNode_t ioarray)

Build the heap from the bottom up. Given an array which is not heapified at all.

Parameters
ioarrayArray where the heap is stored.

◆ osHeapExtractMaximum()

uint8_t osHeapExtractMaximum ( osHeapNode_t ioarray,
osHeapNode_t iomax 
)

Copy heap maximum and remove it (extract).

Parameters
ioarrayArray where the heap is stored.
iomaxNode, which is the maximum.
Return values
1(SUCCESS) or 0 (heap is empty).

◆ osHeapHeapify()

void osHeapHeapify ( osHeapNode_t ioarray,
uint8_t  iind 
)

Classic heapify operation.

Parameters
ioarrayArray where the heap is stored.
iindElement to be put in the right place.

◆ osHeapInit()

void osHeapInit ( osHeapNode_t ioarray)

Initializes all heap elements by setting them to NULL.

Parameters
Arraywhere the heap is stored.

◆ osHeapInsert()

uint8_t osHeapInsert ( osHeapNode_t ioarray,
osHeapNode_t  x 
)

Insert a node into the heap.

Parameters
ioarrayArray where the heap is stored.
xNode to be inserted into the heap.
Return values
1(SUCCESS) or 0 (heap is full).

◆ osHeapIsEmpty()

uint8_t osHeapIsEmpty ( osHeapNode_t ioarray)

Is the heap empty?

Parameters
ioarrayArray where the heap is stored.

◆ osHeapMaximum()

uint8_t osHeapMaximum ( osHeapNode_t ioarray,
osHeapNode_t iomax 
)

Copy heap maximum.

Parameters
ioarrayArray where the heap is stored.
iomaxNode, which is the maximum.
Return values
1(SUCCESS) or 0 (heap is empty).

◆ osHeapPrintS()

void osHeapPrintS ( osHeapNode_t ioarray)

Print heap all priorities for debugging purposes.

Parameters
ioarrayArray where the heap is stored.