SuperTinyKernel™ RTOS 1.06.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
Loading...
Searching...
No Matches
STK_ALLOCATE_COUNT< MODE, FLAG, ONTRUE, ONFALSE > Struct Template Reference

Selects a static array element count at compile time based on a mode flag. More...

#include <stk_defs.h>

Static Public Attributes

static constexpr size_t Value = (((MODE & FLAG) != 0U) ? ONTRUE : ONFALSE)

Detailed Description

template<size_t MODE, size_t FLAG, size_t ONTRUE, size_t ONFALSE>
struct STK_ALLOCATE_COUNT< MODE, FLAG, ONTRUE, ONFALSE >

Selects a static array element count at compile time based on a mode flag.

Note
On GCC/Clang: evaluates to ONTRUE if (MODE & FLAG) is non-zero, otherwise ONFALSE. On MSVC/IAR: always evaluates to the maximum of ONTRUE and ONFALSE because these compilers do not support zero-sized arrays.
Template Parameters
MODEBitmask of active kernel modes (e.g., EKernelMode flags).
FLAGThe specific mode bit to test.
ONTRUEArray count to use when FLAG is active.
ONFALSEArray count to use when FLAG is inactive (may be 0 on GCC/Clang).

Definition at line 561 of file stk_defs.h.

Member Data Documentation

◆ Value

template<size_t MODE, size_t FLAG, size_t ONTRUE, size_t ONFALSE>
size_t STK_ALLOCATE_COUNT< MODE, FLAG, ONTRUE, ONFALSE >::Value = (((MODE & FLAG) != 0U) ? ONTRUE : ONFALSE)
staticconstexpr

Definition at line 568 of file stk_defs.h.


The documentation for this struct was generated from the following file: