ufe 5.5
Universal Front End is a DCC-agnostic component that will allow a DCC to browse and edit data in multiple data models
CfgUtilsMacros.h File Reference

General purpose macros. More...

#include "CfgCompilerMacros.h"
#include <cassert>
Include dependency graph for CfgUtilsMacros.h:

Go to the source code of this file.

Macros

#define PEPTIDE_END_MACRO   static_assert(true, "")
 Helper macro to force the use of a semi-colon at the end of macro invocation. More...
 
#define PEPTIDE_IDENTITY(X)   X
 The identity macro. More...
 
#define PEPTIDE_UNREACHABLE(MSG)   assert(false && MSG)
 Macro indicating that the code path is unreachable. More...
 
#define PEPTIDE_DEPRECATED(REASON)   [[deprecated(REASON)]]
 Macro indicating that a declaration is deprecated. More...
 
#define PEPTIDE_VERIFY(EXPR)   assert(EXPR)
 Helper macro to verify the validity of an expression. More...
 

Detailed Description

General purpose macros.

Definition in file CfgUtilsMacros.h.

Macro Definition Documentation

◆ PEPTIDE_DEPRECATED

#define PEPTIDE_DEPRECATED (   REASON)    [[deprecated(REASON)]]

Macro indicating that a declaration is deprecated.

The macro can be used to indicate that a declaration is deprecated and shouldn't be used anymore in new code. The deprecated declaration could be a function or a class, for example. The macro also allows one to provide an explanation concerning the deprecation.

For example:

#ifndef DOXYGEN
PEPTIDE_DEPRECATED("MAYA-1234 Use newerAndBetterFunction() instead.")
#endif
void aFunctionNowObsolete();
#define PEPTIDE_DEPRECATED(REASON)
Macro indicating that a declaration is deprecated.
Warning
The DOXYGEN guard is necessary to avoid the following bogus Doxygen warning: error: Found ';' while parsing initializer list! (doxygen could be confused by a macro call without semicolon) (warning treated as error, aborting now)
Note
The deprecation warning is disabled on MSC because it leads to an error being reported which causes the entire build to fail. This is due to the presence of the "warning as errors (/WX)" flag. There doesn't seem to be a way to turn off the warning as errors for a single specific warning.

Definition at line 98 of file CfgUtilsMacros.h.

◆ PEPTIDE_END_MACRO

#define PEPTIDE_END_MACRO   static_assert(true, "")

Helper macro to force the use of a semi-colon at the end of macro invocation.

It will work for declaration areas as well, so it can be used when defining macros for creating methods, functions, etc.

Definition at line 27 of file CfgUtilsMacros.h.

◆ PEPTIDE_IDENTITY

#define PEPTIDE_IDENTITY (   X)    X

The identity macro.

For example, it can be used for silencing clang-tidy misc-macro-parentheses warnings!

Definition at line 33 of file CfgUtilsMacros.h.

◆ PEPTIDE_UNREACHABLE

#define PEPTIDE_UNREACHABLE (   MSG)    assert(false && MSG)

Macro indicating that the code path is unreachable.

Macro indicating that the code path is unreachable. The code path might be unreachable for various reasons: class invariants, all cases covered by a switch statement, etc...

In debug builds, an assertion is raised if the macro is ever executed. In optimized builds, an intrinsic is used to tell the optimizer that the code path can be entirely pruned out. That often leads to significantly more efficient code being generated.

Definition at line 63 of file CfgUtilsMacros.h.

◆ PEPTIDE_VERIFY

#define PEPTIDE_VERIFY (   EXPR)    assert(EXPR)

Helper macro to verify the validity of an expression.

The expression EXPR is evaluated regardless of whether assertions are enabled or not. But when assertions are enabled, it asserts that EXPR is true.

Definition at line 106 of file CfgUtilsMacros.h.