QP is an event-driven, RTOS-like, active object framework for microcontrollers, such as mbed. The QP framework provides thread-safe execution of active objects (concurrent state machines) and support both manual and automatic coding of UML statecharts in readable, production-quality C or C++. Automatic code generation of QP code is supported by the free QM modeling tool.

Dependents:   qp_hangman qp_dpp qp_blinky

Embed: (wiki syntax)

« Back to documentation index

QPSet64 Class Reference

QPSet64 Class Reference

Priority Set of up to 64 elements for building various schedulers, but also useful as a general set of up to 64 elements of any kind. More...

#include <qp.h>

Public Member Functions

bool isEmpty (void) const
 the function evaluates to TRUE if the set is empty, which means that no active objects are ready to run.
bool notEmpty (void) const
 the function evaluates to TRUE if the set has elements, which means that some active objects are ready to run.
bool hasElement (uint8_t const n) const
 the function evaluates to TRUE if the priority set has the element n.
void insert (uint8_t const n)
 insert element n into the set, n = 1..64
void remove (uint8_t const n)
 remove element n from the set, n = 1..64
uint8_t findMax (void) const
 find the maximum element in the set,

Detailed Description

Priority Set of up to 64 elements for building various schedulers, but also useful as a general set of up to 64 elements of any kind.

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

The priority set allows to build cooperative multitasking schedulers to manage up to 64 tasks. It is also used in the Quantum Kernel (QK) preemptive scheduler.

The inherited 8-bit set is used as the 8-elemtn set of of 8-bit subsets Each bit in the super.bits set represents a subset (8-elements) as follows:
bit 0 in this->m_bits is 1 when subset[0] is not empty
bit 1 in this->m_bits is 1 when subset[1] is not empty
bit 2 in this->m_bits is 1 when subset[2] is not empty
bit 3 in this->m_bits is 1 when subset[3] is not empty
bit 4 in this->m_bits is 1 when subset[4] is not empty
bit 5 in this->m_bits is 1 when subset[5] is not empty
bit 6 in this->m_bits is 1 when subset[6] is not empty
bit 7 in this->m_bits is 1 when subset[7] is not empty

Definition at line 1026 of file qp.h.


Member Function Documentation

uint8_t findMax ( void   ) const

find the maximum element in the set,

Note:
returns zero if the set is empty

Definition at line 1084 of file qp.h.

bool hasElement ( uint8_t const   n ) const

the function evaluates to TRUE if the priority set has the element n.

Definition at line 1059 of file qp.h.

void insert ( uint8_t const   n )

insert element n into the set, n = 1..64

Definition at line 1066 of file qp.h.

bool isEmpty ( void   ) const

the function evaluates to TRUE if the set is empty, which means that no active objects are ready to run.

Definition at line 1047 of file qp.h.

bool notEmpty ( void   ) const

the function evaluates to TRUE if the set has elements, which means that some active objects are ready to run.

Definition at line 1053 of file qp.h.

void remove ( uint8_t const   n )

remove element n from the set, n = 1..64

Definition at line 1073 of file qp.h.