Arene Base
Fundamental Utilities For Safety Critical C++
Loading...
Searching...
No Matches
define_configuration.hpp File Reference

Go to the source code of this file.

Macro Definition Documentation

◆ ARENE_GUARANTEE_INTERNAL_DEFINITION

#define ARENE_GUARANTEE_INTERNAL_DEFINITION ( OP_SYMBOL)
Value:
(ARENE_IS_ON_RAW(/* NOLINTNEXTLINE(bugprone-macro-parentheses)*/ \
OP_SYMBOL##_I_ \
) || \
ARENE_IS_OFF_RAW(/* NOLINTNEXTLINE(bugprone-macro-parentheses)*/ \
OP_SYMBOL##_I_ \
) || \
ARENE_IS_ON_BY_DEFAULT_RAW(/* NOLINTNEXTLINE(bugprone-macro-parentheses)*/ \
OP_SYMBOL##_I_ \
) || \
ARENE_IS_OFF_BY_DEFAULT_RAW(/* NOLINTLINE(bugprone-macro-parentheses)*/ OP_SYMBOL##_I_))
#define ARENE_IS_ON_RAW(OP_SYMBOL)
Evaluates if the given compile time configuration symbol is "on".
Definition define_configuration.hpp:25

Rough validation that a given compile time configuration symbol has been correctly defined.

Parameters
OP_SYMBOLThe query symbol to evaluate.
Returns
true If one of ARENE_IS_ON(OP_SYMBOL) , ARENE_IS_OFF(OP_SYMBOL) , ARENE_IS_ON_BY_DEFAULT(OP_SYMBOL) , or ARENE_IS_OFF_BY_DEFAULT(OP_SYMBOL) returns true .
false otherwise
Precondition
The symbol must be defined in such a way as to be compatible such that the ARENE_IS_ON and similar queries are well formed, otherwise behavior is undefined (usually, but not always, a compiler error). This means:
  1. There is a symbol defined which is OP_SYMBOL_I_
  1. This symbol is defined as one of ARENE_ON , ARENE_OFF , ARENE_ON_BY_DEFAULT , or ARENE_OFF_BY_DEFAULT
Warning
This validation does not magically permute the set of possible states the define could be in. It just tries to validate that for the current conditions, the symbol works with ARENE_IS_ON and friends. It is up to the user to construct a test harness that would permute the define into the appropriate states to get full coverage.

Usage:

#define FOO_CONFIG_I_ ARENE_ON_BY_DEFAULT
static_assert(ARENE_GUARANTEE_INTERNAL_DEFINITION(FOO_CONFIG), "FOO_CONFIG must be defined");

◆ ARENE_IS_OFF

#define ARENE_IS_OFF ( OP_SYMBOL)
Value:
ARENE_IS_OFF_RAW(OP_SYMBOL##_I_)
#define ARENE_IS_OFF_RAW(OP_SYMBOL)
Evaluates if the given compile time configuration symbol is "off".
Definition define_configuration.hpp:43

Evaluates if the given compile time configuration symbol is "off".

Parameters
OP_SYMBOLThe "query name" of symbol to evaluate. It will have _I_ concatenated to it before evaluation.
Returns
true if the modified input symbol was defined as either ARENE_OFF or ARENE_OFF_BY_DEFAULT
false otherwise
Precondition
The modified symbol must be defined, and it must only be defined as one of ARENE_ON , ARENE_OFF , ARENE_ON_BY_DEFAULT , or ARENE_OFF_BY_DEFAULT else behavior is undefined.

◆ ARENE_IS_OFF_BY_DEFAULT

#define ARENE_IS_OFF_BY_DEFAULT ( OP_SYMBOL)
Value:
#define ARENE_IS_OFF_BY_DEFAULT_RAW(OP_SYMBOL)
Evaluates if the given compile time configuration symbol is "off by default.".
Definition define_configuration.hpp:80

Evaluates if the given compile time configuration symbol is "off by default.".

Parameters
OP_SYMBOLThe "query name" of symbol to evaluate. It will have _I_ concatenated to it before evaluation.
Returns
true if the modified input symbol was defined as ARENE_OFF_BY_DEFAULT
false otherwise
Precondition
The modified symbol must be defined, and it must only be defined as one of ARENE_ON , ARENE_OFF , ARENE_ON_BY_DEFAULT , or ARENE_OFF_BY_DEFAULT else behavior is undefined.

◆ ARENE_IS_OFF_BY_DEFAULT_RAW

#define ARENE_IS_OFF_BY_DEFAULT_RAW ( OP_SYMBOL)
Value:
((3U OP_SYMBOL 3U OP_SYMBOL 1U) == (0U - 1U))

Evaluates if the given compile time configuration symbol is "off by default.".

Parameters
OP_SYMBOLThe symbol to evaluate, unmodified.
Returns
true if the input symbol was defined as ARENE_OFF_BY_DEFAULT.
false otherwise.
Precondition
The symbol must be defined, and it must only be defined as one of ARENE_ON , ARENE_OFF , ARENE_ON_BY_DEFAULT , or ARENE_OFF_BY_DEFAULT else behavior is undefined.
Note
This is generally not used directly in user code, prefer ARENE_IS_OFF_BY_DEFAULT instead.

◆ ARENE_IS_OFF_RAW

#define ARENE_IS_OFF_RAW ( OP_SYMBOL)
Value:
((3U OP_SYMBOL 3U) == 0U)

Evaluates if the given compile time configuration symbol is "off".

Parameters
OP_SYMBOLThe symbol to evaluate, unmodified.
Returns
true if the input symbol was defined as either ARENE_OFF or ARENE_OFF_BY_DEFAULT
false otherwise
Precondition
The symbol must be defined, and it must only be defined as one of ARENE_ON , ARENE_OFF , ARENE_ON_BY_DEFAULT , or ARENE_OFF_BY_DEFAULT else behavior is undefined.
Note
This is generally not used directly in user code, prefer ARENE_IS_OFF instead.

◆ ARENE_IS_ON

#define ARENE_IS_ON ( OP_SYMBOL)
Value:
ARENE_IS_ON_RAW(OP_SYMBOL##_I_)

Evaluates if the given compile time configuration symbol is "on".

Parameters
OP_SYMBOLThe "query name" of symbol to evaluate. It will have _I_ concatenated to it before evaluation.
Returns
true if the modified input symbol was defined as either ARENE_ON or ARENE_ON_BY_DEFAULT
false otherwise
Precondition
The modified symbol must be defined, and it must only be defined as one of ARENE_ON , ARENE_OFF , ARENE_ON_BY_DEFAULT , or ARENE_OFF_BY_DEFAULT else behavior is undefined.

◆ ARENE_IS_ON_BY_DEFAULT

#define ARENE_IS_ON_BY_DEFAULT ( OP_SYMBOL)
Value:
#define ARENE_IS_ON_BY_DEFAULT_RAW(OP_SYMBOL)
Evaluates if the given compile time configuration symbol is "on by default.".
Definition define_configuration.hpp:61

Evaluates if the given compile time configuration symbol is "on by default.".

Parameters
OP_SYMBOLThe "query name" of symbol to evaluate. It will have _I_ concatenated to it before evaluation.
Returns
true if the modified input symbol was defined as ARENE_ON_BY_DEFAULT
false otherwise
Precondition
The modified symbol must be defined, and it must only be defined as one of ARENE_ON , ARENE_OFF , ARENE_ON_BY_DEFAULT , or ARENE_OFF_BY_DEFAULT else behavior is undefined.

◆ ARENE_IS_ON_BY_DEFAULT_RAW

#define ARENE_IS_ON_BY_DEFAULT_RAW ( OP_SYMBOL)
Value:
((3U OP_SYMBOL 3U) > 3U)

Evaluates if the given compile time configuration symbol is "on by default.".

Parameters
OP_SYMBOLThe symbol to evaluate, unmodified.
Returns
true if the input symbol was defined as ARENE_ON_BY_DEFAULT.
false otherwise.
Precondition
The symbol must be defined, and it must only be defined as one of ARENE_ON , ARENE_OFF , ARENE_ON_BY_DEFAULT , or ARENE_OFF_BY_DEFAULT else behavior is undefined.
Note
This is generally not used directly in user code, prefer ARENE_IS_ON_BY_DEFAULT instead.

◆ ARENE_IS_ON_RAW

#define ARENE_IS_ON_RAW ( OP_SYMBOL)
Value:
((3U OP_SYMBOL 3U) != 0U)

Evaluates if the given compile time configuration symbol is "on".

Parameters
OP_SYMBOLThe symbol to evaluate, unmodified.
Returns
true if the input symbol was defined as either ARENE_ON or ARENE_ON_BY_DEFAULT
false otherwise
Precondition
The symbol must be defined, and it must only be defined as one of ARENE_ON , ARENE_OFF , ARENE_ON_BY_DEFAULT , or ARENE_OFF_BY_DEFAULT else behavior is undefined.
Note
This is generally not used directly in user code, prefer ARENE_IS_ON instead.

◆ ARENE_OFF

#define ARENE_OFF   ^

A compile-time config state that specifies that the given symbol should be considered explicitly "off.".

Usage:

#define FOO_CONFIG_I_ ARENE_OFF

◆ ARENE_OFF_BY_DEFAULT

#define ARENE_OFF_BY_DEFAULT   -

A compile-time config state that specifies that the given symbol should be considered implicitly "off.".

Usage:

#define FOO_CONFIG_I_ ARENE_OFF_BY_DEFAULT

◆ ARENE_ON

#define ARENE_ON   |

A compile-time config state that specifies that the given symbol should be considered explicitly "on.".

Usage:

#define FOO_CONFIG_I_ ARENE_ON

◆ ARENE_ON_BY_DEFAULT

#define ARENE_ON_BY_DEFAULT   +

A compile-time config state that specifies that the given symbol should be considered implicitly "on.".

Usage:

#define FOO_CONFIG_I_ ARENE_ON_BY_DEFAULT