QP/C 6.9.1
qpset.h File Reference

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

This graph shows which files directly or indirectly include this file:

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

Typedefs

typedef uint8_t QPSetBits
 

Functions

uint_fast8_t QF_LOG2 (QPSetBits 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 68 of file qpset.h.

Collaboration diagram for QPSet:
Collaboration graph
Data Fields
QPSetBits volatile bits bitmask with a bit for each element

Macro Definition Documentation

◆ QPSet_setEmpty

#define QPSet_setEmpty (   me_)    ((me_)->bits = 0U)

Makes the priority set me_ empty.

Definition at line 73 of file qpset.h.

◆ QPSet_isEmpty

#define QPSet_isEmpty (   me_)    ((me_)->bits == 0U)

Evaluates to TRUE if the priority set me_ is empty.

Definition at line 76 of file qpset.h.

◆ QPSet_notEmpty

#define QPSet_notEmpty (   me_)    ((me_)->bits != 0U)

Evaluates to TRUE if the priority set me_ is not empty.

Definition at line 79 of file qpset.h.

◆ QPSet_hasElement

#define QPSet_hasElement (   me_,
  n_ 
)     (((me_)->bits & ((QPSetBits)1 << ((n_) - 1U))) != 0U)

Evaluates to TRUE if the priority set me_ has element n_.

Definition at line 82 of file qpset.h.

◆ QPSet_insert

#define QPSet_insert (   me_,
  n_ 
)     ((me_)->bits |= ((QPSetBits)1 << ((n_) - 1U)))

Insert element n_ into the set me_, n_= 1U..32U.

Definition at line 86 of file qpset.h.

◆ QPSet_remove

#define QPSet_remove (   me_,
  n_ 
)     ((me_)->bits &= (QPSetBits)(~((QPSetBits)1 << ((n_) - 1U))))

Remove element n_ from the set me_, n_= 1..32.

Definition at line 90 of file qpset.h.

◆ 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 96 of file qpset.h.

Typedef Documentation

◆ QPSetBits

typedef uint8_t QPSetBits

Definition at line 51 of file qpset.h.

Function Documentation

◆ QF_LOG2()

uint_fast8_t QF_LOG2 ( QPSetBits  x)

Definition at line 156 of file qf_act.c.