QP/C  6.0.2
qpset.h File Reference

QP native, platform-independent priority sets of 32 or 64 elements. More...

Go to the source code of this file.

Data Structures

struct  QPSet
 Priority Set of up to 32 elements. More...
 

Macros

#define QPSet_setEmpty(me_)   ((me_)->bits = (uint32_t)0)
 Makes the priority set me_ empty.
 
#define QPSet_isEmpty(me_)   ((me_)->bits == (uint32_t)0)
 Evaluates to TRUE if the priority set me_ is empty.
 
#define QPSet_notEmpty(me_)   ((me_)->bits != (uint32_t)0)
 Evaluates to TRUE if the priority set me_ is not empty.
 
#define QPSet_hasElement(me_, n_)   (((me_)->bits & ((uint32_t)1 << ((n_) - (uint_fast8_t)1))) != (uint32_t)0)
 Evaluates to TRUE if the priority set me_ has element n_.
 
#define QPSet_insert(me_, n_)   ((me_)->bits |= (uint32_t)((uint32_t)1 << ((n_) - (uint_fast8_t)1)))
 Insert element n_ into the set me_, n_= 1..32.
 
#define QPSet_remove(me_, n_)   ((me_)->bits &= (uint32_t)(~((uint32_t)1U << ((n_) - (uint_fast8_t)1))))
 Remove element n_ from the set me_, n_= 1..32.
 
#define QPSet_findMax(me_, n_)   ((n_) = QF_LOG2((me_)->bits))
 Find the maximum element in the set, and assign it to n_. More...
 

Functions

uint_fast8_t QF_LOG2 (uint32_t x)
 

Detailed Description

QP native, platform-independent priority sets of 32 or 64 elements.

Definition in file qpset.h.


Data Structure Documentation

◆ QPSet

struct QPSet

Priority Set of up to 32 elements.

The priority set represents the set of active objects that are ready to run and need to be considered by the scheduling algorithm. The set is capable of storing up to 32 priority levels.

Definition at line 56 of file qpset.h.

Data Fields
uint32_t volatile bits bitmask with a bit for each element

Macro Definition Documentation

◆ QPSet_findMax

#define QPSet_findMax (   me_,
  n_ 
)    ((n_) = QF_LOG2((me_)->bits))

Find the maximum element in the set, and assign it to n_.

Note
if the set me_ is empty, n_ is set to zero.

Definition at line 84 of file qpset.h.