ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
ALib Preprocessor Macros

Description:

This document lists all preprocessor macros of ALib used to generate code or prune code pieces. Often, the definition of macros depend on the ALib Compiler Symbols,

The following sections of this document lists macros that are not related to a specific ALib Module :

   ALib Version And Feature Verification
   C/C++ Preprocessor Helpers
   C/C++ Language And Linkage
   C/C++ Compiler Warning Control
   Debug Assertions, Warnings and Errors
   C++ Template Meta Programming
   Resource Locking and Recursive Programming

Followed to this, module-specific macros are documented:

   Module ALox - Debug Logging
   Module ALox - Release Logging
   Module ALox - Lowlevel Macros
   Module Boxing
   Module Characters
   Module Enums
   Module Expressions
   Module BaseCamp
   Module Strings

The last section provides macros used to include or exclude (prune) code:
   Code Pruning

ALib Version And Feature Verification

Macros used to verify that the ALib binary used has the right version is compiled with the same feature set as the current compilation unit. For this, version and feature flags are compiled statically into the library. The macros are used internally, respectively 'automatically'. Hence, they need not to be used directly clients of the library.

#define ALIB_VERSION   2402
 
#define ALIB_REVISION   1
 
#define ALIB_COMPILATION_FLAGS
 
#define ALIB_ASSERT_MODULE(modulename)
 
#define ALIB_BASE_DIR
 

C/C++ Preprocessor Helper Macros

The following macros are fundamental and building blocks for other macros.

#define ALIB_STRINGIFY(a)
 
#define ALIB_NSTRINGIFY(a)
 
#define ALIB_CONCAT(a, b)   a ## b
 
#define ALIB_IDENTIFIER(prefix)
 
#define ALIB_EMPTY
 
#define ALIB_COMMA   ,
 
#define ALIB_COMMA_DBG   ,
 
#define ALIB_STATIC_ASSERT(CondVariable, Cond, Message)
 
#define ALIB_STATIC_DENY(CondVariable, Cond, Message)
 

C/C++ Language And Linkage Macros

The macros listed here are supporting C++ compilation and linking control and language specific utilities.

#define ALIB_API   __declspec(dllexport)
 
#define ALIB_NO_RETURN   [[ noreturn ]]
 
#define ALIB_ASSERT_GLOBAL_NAMESPACE
 
#define ALIB_SIZEOF_WCHAR_T   4
 
#define ALIB_FORCE_INLINE   __forceinline
 
#define ALIB_CALLER   __FILE__, __LINE__, __func__
 
#define ALIB_CALLER_PRUNED   ALIB_CALLER
 
#define ALIB_CALLER_NULLED   ALIB_CALLER
 
#define bitsof(type)   static_cast<int>(sizeof(type) * 8)
 

C/C++ Compiler Warning Control

ALib sources are designed to be compiled on different compilers using the highest possible compiler warning levels available. In some situations, some warnings need to be temporarily disabled. The following macros do this in a compiler agnostic way.

#define ALIB_WARNINGS_RESTORE    _Pragma("clang diagnostic pop") \
 
#define ALIB_WARNINGS_UNINITIALIZED_OFF
 
#define ALIB_WARNINGS_ALLOW_NULL_POINTER_PASSING    _Pragma("clang diagnostic push") \
 
#define ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE
 
#define ALIB_WARNINGS_MACRO_NOT_USED_OFF
 
#define ALIB_WARNINGS_RESERVED_MACRO_NAME_OFF
 
#define ALIB_WARNINGS_ALLOW_MACRO_REDEFINITION
 
#define ALIB_WARNINGS_ALLOW_UNSAFE_FUNCTION_OR_VARIABLE
 
#define ALIB_WARNINGS_OVERLOAD_VIRTUAL_OFF
 
#define ALIB_WARNINGS_ALLOW_SPARSE_ENUM_SWITCH
 
#define ALIB_WARNINGS_ALLOW_BITWISE_SWITCH
 
#define ALIB_WARNINGS_IGNORE_DOCS
 
#define ALIB_WARNINGS_ALLOW_SHIFT_COUNT_OVERFLOW
 
#define ALIB_WARNINGS_IGNORE_UNUSED_PARAMETER
 
#define ALIB_WARNINGS_IGNORE_UNUSED_MACRO
 
#define ALIB_WARNINGS_IGNORE_FUNCTION_TEMPLATE
 
#define ALIB_WARNINGS_IGNORE_RESERVED_IDENTIFIER
 
#define ALIB_WARNINGS_IGNORE_NOTHING_RETURNED
 
#define ALIB_FALLTHROUGH   [[clang::fallthrough]];
 
#define ALIB_WARNINGS_IGNORE_INTEGRAL_CONSTANT_OVERFLOW    _Pragma("clang diagnostic push") \
 
#define ALIB_WARNINGS_IGNORE_INTEGER_OVERFLOW
 

Debug Assertions, Warnings and Errors

The macros listed here are defined in two different versions, depending on the ALib distribution. With single ALib Modules that do not incorporate class alib::lang::Report and family, namespace function alib::lang::DbgSimpleALibMsg (and overloads) are used to write the messages. The default implementation of this message invokes assert(false) if the message is of error type.
There is a very simple "plug-in" concept in place that allows to redirect this method to a user defined one which may act differently.

If class report is included in the selected ALib distribution, two things happen:

  • the aforementioned plug-in is implemented and an ALib Report is generated inside the plug-in function.
  • The macros themselves are redefined to directly use the ALib Report facility. Such redefinition happens "in the middle" of header inclusion (as early as possible), with the effect that most classes of ALib are compiled using the simple version, but still use the mechanics of ALib Reports. Other parts of ALib classes, and of-course all user code, will have the more sophisticated, report-based versions of the macros in place. The huge advantage of them is, that those accept an arbitrary list of arguments which are boxed and passed to a formatter. This allows to easily compose detailed and formatted debug messages.

If also module ALox is compiled into the library, then a plug-in that uses ALox for the message output is used. See class ALoxReportWriter for more information.

#define ALIB_ERROR(...)   { alib::lang::DbgSimpleALibMsg( ALIB_CALLER_PRUNED, 0, __VA_ARGS__); }
 
#define ALIB_WARNING(...)   { alib::lang::DbgSimpleALibMsg( ALIB_CALLER_PRUNED, 1, __VA_ARGS__); }
 
#define ALIB_MESSAGE(...)   { alib::lang::DbgSimpleALibMsg( ALIB_CALLER_PRUNED, 2, __VA_ARGS__); }
 
#define ALIB_ASSERT(cond)   { if(!(cond)) ALIB_ERROR( "Assertion Failed" ); }
 
#define ALIB_ASSERT_ERROR(cond, ...)   { if(!(cond)) ALIB_ERROR( __VA_ARGS__ ); }
 
#define ALIB_ASSERT_WARNING(cond, ...)   { if(!(cond)) ALIB_WARNING( __VA_ARGS__ ); }
 
#define ALIB_ASSERT_MESSAGE(cond, ...)   { if(!(cond)) ALIB_MESSAGE( __VA_ARGS__ ); }
 
#define ALIB_ASSERT_RESULT_EQUALS( func, value)   { auto result= func; assert(result == value); ((void) result); }
 
#define ALIB_ASSERT_RESULT_NOT_EQUALS( func, value)   { auto result= func; assert(result != value); ((void) result); }
 
#define ALIB_ASSERT_RESULT_GREATER_THAN(func, value)   { auto result= func; assert(result > value); ((void) result); }
 
#define ALIB_ASSERT_RESULT_LESS_THAN( func, value)   { auto result= func; assert(result < value); ((void) result); }
 

C++ Template Meta Programming

Simple shortcut macros usable with template meta programming. Unlike other ALib macros, their prefix is "ATMP_". This is for reducing their size as they are frequently used in more complex type expressions.

#define ATMP_IS_ENUM(T)   std::is_enum <T>::value
 
#define ATMP_IS_CONST(T)   std::is_const <T>::value
 
#define ATMP_IS_PTR(T)   std::is_pointer <T>::value
 
#define ATMP_IS_ARR(T)   std::is_array <T>::value
 
#define ATMP_IS_INT(T)   std::is_integral<T>::value
 
#define ATMP_IS_UINT(T)   (std::is_integral<T>::value && std::is_unsigned<T>::value)
 
#define ATMP_IS_SINT(T)   (std::is_integral<T>::value && std::is_signed <T>::value)
 
#define ATMP_EQ( T, TEqual)   std::is_same <T, TEqual>::value
 
#define ATMP_ISOF( T, TBase)   std::is_base_of <TBase, T >::value
 
#define ATMP_RC( T)   typename std::remove_const <T>::type
 
#define ATMP_RR( T)   typename std::remove_reference<T>::type
 
#define ATMP_RP( T)   typename std::remove_pointer <T>::type
 
#define ATMP_RE( T)   typename std::remove_extent <T>::type
 
#define ATMP_RCV( T)   typename std::remove_cv <T>::type
 
#define ATMP_RCVR( T)
 
#define ATMP_RCVP( T)
 
#define ATMP_RECVP( T)
 
#define ATMP_VOID_IF(Cond)   typename std::enable_if<Cond >::type
 
#define ATMP_T_IF(T, Cond)   typename std::enable_if<Cond,T>::type
 
#define ATMP_IF_T_F( Cond, T, F)   typename std::conditional<Cond,T,F>::type
 
#define ATMP_SELECT_IF_1TP(TParam, ...)
 
#define ATMP_SELECT_IF_2TP(TParam1, TParam2, ...)
 
#define ATMP_SELECT_IF_3TP(TParam1, TParam2, TParam3, ...)
 
#define ATMP_SELECT_IF_4TP(TParam1, TParam2, TParam3, TParam4, ...)
 
#define ATMP_RETURN_IF_1TP(TReturn, TParam, ...)
 
#define ATMP_RETURN_IF_2TP(TReturn, TParam1, TParam2, ...)
 

Macros for Resource Locking and Recursive Programming

The macros listed here have a direct relationship with classes defined in ALib and with their use.

#define ALIB_OWN(ownable)   alib::Owner<decltype(ownable)> ALIB_IDENTIFIER(owner) (ownable ALIB_COMMA_DBG ALIB_CALLER_PRUNED);
 
#define ALIB_LOCK   ALIB_OWN(*this)
 
#define ALIB_LOCK_WITH(lock)   ALIB_OWN(lock)
 
#define ALIB_DBG_PREVENT_RECURSIVE_METHOD_CALLS
 
#define ALIB_DBG_PREVENT_RECURSIVE_METHOD_CALLS_MEMBER_DECL   bool dbgRecursionDetectionFlag = false;
 

ALox Macros For Debug Logging

The macros listed here, are provided to place debug Log Statements within source code using module ALox . Besides that, macros controlling and setting preferences for ALox exists.

The exclusive use of these macros should be sufficient to support most of common debug logging statements with ALox . Should some functionality be not available easily with using the macros, of-course, the normal C++ API of ALox can be used in parallel to using the macros. For proper pruning of code that is using the C++ API, such code has to be enclosed by

#if ALOX_DBG_LOG
   ...
   ...
#endif

lines, or embedded in macro Log_Prune.

Note
To be clear: When using the macros, the #if / #endif statements are not needed!

All macro names are prefixed "Log_". This implies that they are macros to implement debug logging. In contrast to this, a set of similar macros exists for release logging (see release logging macros). Those are prefixed "Lox_". (The choice of the prefixes Log_ and Lox provide maximum source code compatibility of ALox for C++ log lines in comparison to ALox for C# and ALox for Java.

Most macros make use of the macro LOG_LOX, which references a singleton object of class Lox that is used for all debug logging. This singleton concept covers most uses cases for debug logging. If more flexibility is wanted, then either macro LOG_LOX might be changed for different compilation units or the ALox for C++ API might be used instead of the macros listed here.

Note
The Scope Domain mechanism of ALox , as well as other ALox functionality which relies on Scopes use the information provided by ALib macro ALIB_CALLER. Changing this macro, might cause these mechanism to fail.
#define Log_Prune(...)   __VA_ARGS__
 
#define Log_SetSourcePathTrimRule(...)   Log_Prune( LOG_ACQUIRE _log.SetSourcePathTrimRule( __VA_ARGS__ ); LOG_RELEASE )
 
#define Log_ClearSourcePathTrimRules(...)   Log_Prune( LOG_ACQUIRE _log.ClearSourcePathTrimRules( __VA_ARGS__ ); LOG_RELEASE )
 
#define Log_AddDebugLogger()   Log_Prune( LOG_ACQUIRE alib::Log::AddDebugLogger ( &_log ); LOG_RELEASE )
 
#define Log_RemoveDebugLogger()   Log_Prune( LOG_ACQUIRE alib::Log::RemoveDebugLogger( &_log ); LOG_RELEASE )
 
#define Log_GetLogger(identifier, name)
 
#define Log_RemoveLogger(logger)   Log_Prune( LOG_ACQUIRE _log.RemoveLogger ( logger ); LOG_RELEASE )
 
#define Log_SetDomain(...)   Log_Prune( LOG_ACQUIRE _log.SetDomain ( __VA_ARGS__ ); LOG_RELEASE )
 
#define Log_RemoveThreadDomain(...)   Log_Prune( LOG_ACQUIRE _log.RemoveThreadDomain( __VA_ARGS__ ); LOG_RELEASE )
 
#define Log_SetDomainSubstitutionRule(...)   Log_Prune( LOG_ACQUIRE _log.SetDomainSubstitutionRule( __VA_ARGS__); LOG_RELEASE )
 
#define Log_SetVerbosity(...)   Log_Prune( LOG_ACQUIRE _log.SetVerbosity ( __VA_ARGS__ ); LOG_RELEASE )
 
#define Log_SetStartTime(...)   Log_Prune( LOG_ACQUIRE _log.SetStartTime ( __VA_ARGS__ ); LOG_RELEASE )
 
#define Log_MapThreadName(...)   Log_Prune( LOG_ACQUIRE _log.MapThreadName( __VA_ARGS__ ); LOG_RELEASE )
 
#define Log_LogState(...)   Log_Prune( LOG_ACQUIRE _log.State ( __VA_ARGS__ ); LOG_RELEASE )
 
#define Log_Verbose(...)   Log_Prune( LOG_ACQUIRE _log.Verbose ( __VA_ARGS__ ); LOG_RELEASE )
 
#define Log_Info(...)   Log_Prune( LOG_ACQUIRE _log.Info ( __VA_ARGS__ ); LOG_RELEASE )
 
#define Log_Warning(...)   Log_Prune( LOG_ACQUIRE _log.Warning ( __VA_ARGS__ ); LOG_RELEASE )
 
#define Log_Error(...)   Log_Prune( LOG_ACQUIRE _log.Error ( __VA_ARGS__ ); LOG_RELEASE )
 
#define Log_Assert(...)   Log_Prune( LOG_ACQUIRE _log.Assert ( __VA_ARGS__ ); LOG_RELEASE )
 
#define Log_If(...)   Log_Prune( LOG_ACQUIRE _log.If ( __VA_ARGS__ ); LOG_RELEASE )
 
#define Log_Once(...)   Log_Prune( LOG_ACQUIRE _log.Once ( __VA_ARGS__ ); LOG_RELEASE )
 
#define Log_Entry(...)   Log_Prune( LOG_ACQUIRE _log.Entry ( __VA_ARGS__ ); LOG_RELEASE )
 
#define Log_SetPrefix(...)   Log_Prune( LOG_ACQUIRE _log.SetPrefix ( __VA_ARGS__ ); LOG_RELEASE )
 
#define Log_Store(...)   Log_Prune( LOG_ACQUIRE _log.Store ( __VA_ARGS__ ); LOG_RELEASE )
 
#define Log_Retrieve(data, ...)   Log_Prune( Box data; LOG_ACQUIRE data= _log.Retrieve( __VA_ARGS__ ); LOG_RELEASE )
 
#define Log_IsActive(result, ...)   Log_Prune( LOG_ACQUIRE result= _log.IsActive( __VA_ARGS__ ); LOG_RELEASE )
 
#define Log_Exception(...)   Log_Prune( alib::lox::LogTools::Exception( LOG_LOX, __VA_ARGS__ ); )
 

ALox Macros For Release Logging

The macros listed here, are provided to place release Log Statements within source code using module ALox . Besides that, macros controlling and setting preferences for ALox exists.

The exclusive use of these macros should be sufficient to support most of common release logging statements with ALox . Should some functionality be not available easily using the macros, of-course, the normal C++ API of ALox can be used in parallel to using the macros. Code that is using the C++ API might be enclosed by preprocessor directives

#if ALOX_REL_LOG
   ...
   ...
#endif

to remove them when compiling a release version of the software unit with pruned release log macros. Alternatively, such code might be embedded in macro Lox_Prune. (Pruning of release logging can be enabled by defining compiler symbol ALOX_REL_LOG to 0 and could be useful in certain situations.)

Prior to using the macros, each code entity has to set the preprocessor macro LOX_LOX This can be done in a general header file of the software, (e.g. the same that exposes the release-Lox object to that source), or, in more complex scenarios with more than one release-Lox object, at any other appropriate source location.

All macro names are prefixed with the term Lox_. This implies that they are macros to implement release logging. In contrast to this, a set of similar macros exists for debug logging (see debug logging macros). Those are prefixed Log_.

Note
The choice of the prefixes Log_ and Lox_ was made to provide maximum source code compatibility of ALox for C++ log lines in comparison to other ALox implementations in other programming languages, which provide a class Log as a kind of 'mirror' class of class Lox. Invocations to class Log get pruned in these languages.

Most macros make use of the macro LOX_LOX, which references a singleton object of class Lox that is used for all release logging. This singleton concept covers most uses cases for release logging. If more flexibility is wanted, then either the macro LOX_LOX might be changed for different compilation units or the ALox C++ API might be used instead of the macros listed here.

#define Lox_Prune(...)   __VA_ARGS__
 
#define Lox_SetSourcePathTrimRule(...)   Lox_Prune( LOX_ACQUIRE _lox.SetSourcePathTrimRule( __VA_ARGS__ ); LOX_RELEASE )
 
#define Lox_ClearSourcePathTrimRules(...)   Lox_Prune( LOX_ACQUIRE _lox.ClearSourcePathTrimRules( __VA_ARGS__ ); LOX_RELEASE )
 
#define Lox_GetLogger(identifier, name)   Lox_Prune( alib::lox::detail::Logger* identifier; LOX_ACQUIRE identifier= _lox.GetLogger ( name ); LOX_RELEASE )
 
#define Lox_RemoveLogger(logger)   Lox_Prune( LOX_ACQUIRE _lox.RemoveLogger ( logger ); LOX_RELEASE )
 
#define Lox_SetDomain(...)   Lox_Prune( LOX_ACQUIRE _lox.SetDomain (__VA_ARGS__); LOX_RELEASE )
 
#define Lox_RemoveThreadDomain(...)   Lox_Prune( LOX_ACQUIRE _lox.RemoveThreadDomain( __VA_ARGS__ ); LOX_RELEASE )
 
#define Lox_SetDomainSubstitutionRule(...)   Lox_Prune( LOX_ACQUIRE _lox.SetDomainSubstitutionRule( __VA_ARGS__ ); LOX_RELEASE )
 
#define Lox_SetVerbosity(...)   Lox_Prune( LOX_ACQUIRE _lox.SetVerbosity ( __VA_ARGS__ ); LOX_RELEASE )
 
#define Lox_SetStartTime(...)   Lox_Prune( LOX_ACQUIRE _lox.SetStartTime ( __VA_ARGS__ ); LOX_RELEASE )
 
#define Lox_MapThreadName(...)   Lox_Prune( LOX_ACQUIRE _lox.MapThreadName( __VA_ARGS__ ); LOX_RELEASE )
 
#define Lox_LogState(...)   Lox_Prune( LOX_ACQUIRE _lox.State ( __VA_ARGS__ ); LOX_RELEASE )
 
#define Lox_Verbose(...)   Lox_Prune( LOX_ACQUIRE _lox.Verbose ( __VA_ARGS__ ); LOX_RELEASE )
 
#define Lox_Info(...)   Lox_Prune( LOX_ACQUIRE _lox.Info ( __VA_ARGS__ ); LOX_RELEASE )
 
#define Lox_Warning(...)   Lox_Prune( LOX_ACQUIRE _lox.Warning ( __VA_ARGS__ ); LOX_RELEASE )
 
#define Lox_Error(...)   Lox_Prune( LOX_ACQUIRE _lox.Error ( __VA_ARGS__ ); LOX_RELEASE )
 
#define Lox_Assert(...)   Lox_Prune( LOX_ACQUIRE _lox.Assert ( __VA_ARGS__); LOX_RELEASE )
 
#define Lox_If(...)   Lox_Prune( LOX_ACQUIRE _lox.If ( __VA_ARGS__); LOX_RELEASE )
 
#define Lox_Once(...)   Lox_Prune( LOX_ACQUIRE _lox.Once ( __VA_ARGS__ ); LOX_RELEASE )
 
#define Lox_Entry(...)   Lox_Prune( LOX_ACQUIRE _lox.Entry ( __VA_ARGS__ ); LOX_RELEASE )
 
#define Lox_Store(...)   Lox_Prune( LOX_ACQUIRE _lox.Store ( __VA_ARGS__ ); LOX_RELEASE )
 
#define Lox_Retrieve(data, ...)   Lox_Prune( LOX_ACQUIRE LogData* data= _lox.Retrieve( __VA_ARGS__ ); LOX_RELEASE )
 
#define Lox_SetPrefix(...)   Lox_Prune( LOX_ACQUIRE _lox.SetPrefix ( __VA_ARGS__ ); LOX_RELEASE )
 
#define Lox_IsActive(result, ...)   Lox_Prune( LOX_ACQUIRE result= _lox.IsActive( __VA_ARGS__ ); LOX_RELEASE )
 
#define Lox_Exception(...)   Lox_Prune( alib::lox::LogTools::Exception( LOX_LOX, __VA_ARGS__ ); )
 

ALox Low level Macros

The preprocessor macros listed here are the foundation for debug logging and release logging macros introduced below.

Developers that use ALox in standard use cases do not need to know and use the macros listed here.

#define LOG_LOX   (*alib::lox::Log::Get())
 
#define LOX_LOX
 
#define LOG_CI   ALIB_CALLER
 
#define LOX_CI   ALIB_CALLER
 
#define LOG_ACQUIRE   { alib::lox::Lox& _log= LOG_LOX; _log.Acquire( LOG_CI );
 
#define LOG_RELEASE   _log.Release(); }
 
#define LOX_ACQUIRE   { alib::lox::Lox& _lox= LOX_LOX; _lox.Acquire( LOX_CI );
 
#define LOX_RELEASE   _lox.Release(); }
 

ALib Module Boxing

The macros in this section are introduced by module ALib Boxing .

#define ALIB_BOXING_CUSTOMIZE(TSource, TTarget, ...)
 
#define ALIB_BOXING_CUSTOMIZE_TYPE_MAPPING(TSource, TTarget)
 
#define ALIB_BOXING_CUSTOMIZE_TYPE_MAPPING_CONSTEXPR(TSource, TTarget)
 
#define ALIB_BOXING_CUSTOMIZE_NOT_UNBOXABLE(TSource, TTarget)
 
#define ALIB_BOXING_CUSTOMIZE_NOT_UNBOXABLE_CONSTEXPR(TSource, TTarget)
 
#define ALIB_BOXING_CUSTOMIZE_ARRAY_TYPE(TSource, TElement, ...)
 
#define ALIB_BOXING_CUSTOMIZE_ARRAY_TYPE_NON_UNBOXABLE(TSource, TElement, ...)
 
#define ALIB_BOXING_CUSTOMIZE_DENY_BOXING(TSource)
 
#define ALIB_BOXING_VTABLE_DECLARE(TMapped, Identifier)
 
#define ALIB_BOXING_VTABLE_DECLARE_ARRAYTYPE(TMapped, Identifier)
 
#define ALIB_BOXING_VTABLE_DEFINE(TMapped, Identifier)
 
#define ALIB_BOXING_VTABLE_DEFINE_ARRAYTYPE(TMapped, Identifier)
 
#define ALIB_BOXING_BOOTSTRAP_VTABLE_DBG_REGISTER(Identifier)
 
#define ALIB_BOXING_DEFINE_FEQUALS_FOR_COMPARABLE_TYPE(TComparable)
 
#define ALIB_BOXING_DEFINE_FISLESS_FOR_COMPARABLE_TYPE(TComparable)
 
#define ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE(TAppendable)
 
#define ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE_N(TAppendable)
 
#define ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE_W(TAppendable)
 
#define ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE_X(TAppendable)
 

ALib Module Characters

The macros in this section are introduced by module ALib Characters .

#define A_CHAR(STR)
 
#define A_CCHAR(STR)
 
#define A_SCHAR(STR)
 
#define A_NCHAR(STR)
 
#define A_WCHAR(STR)
 
#define A_XCHAR(STR)
 
#define ATMP_CHAR_COMPLEMENT(TChar)
 
#define ALIB_CHARACTER_ARRAY( TString, TChar, Access, Construction)   ALIB_CHARACTER_ARRAY_internal( C , TString, TChar, const, Access , Construction )
 
#define ALIB_CHARACTER_ARRAY_MUTABLE( TString, TChar, Construction)   ALIB_CHARACTER_ARRAY_internal( C , TString, TChar, , MutableOnly, Construction )
 
#define ALIB_CHARACTER_ZT_ARRAY( TString, TChar, Access, Construction)   ALIB_CHARACTER_ARRAY_internal( ZTC, TString, TChar, const, Access , Construction )
 
#define ALIB_CHARACTER_ZT_ARRAY_MUTABLE(TString, TChar, Construction)   ALIB_CHARACTER_ARRAY_internal( ZTC, TString, TChar, , MutableOnly, Construction )
 
#define ALIB_CHARACTER_ARRAY_IMPL_BUFFER( TString, TChar, ...)   const TChar* T_CharArray<TString,TChar>::Buffer(TString const& src ) { __VA_ARGS__ }
 
#define ALIB_CHARACTER_ZT_ARRAY_IMPL_BUFFER( TString, TChar, ...)   const TChar* T_ZTCharArray<TString,TChar>::Buffer( TString const& src ) { __VA_ARGS__ }
 
#define ALIB_CHARACTER_ARRAY_IMPL_BUFFER_MUTABLE( TString, TChar, ...)   const TChar* T_CharArray<TString,TChar>::Buffer(TString & src ) { __VA_ARGS__ }
 
#define ALIB_CHARACTER_ZT_ARRAY_IMPL_BUFFER_MUTABLE(TString, TChar, ...)   const TChar* T_ZTCharArray<TString,TChar>::Buffer( TString & src ) { __VA_ARGS__ }
 
#define ALIB_CHARACTER_ARRAY_IMPL_LENGTH( TString, TChar, ...)   integer T_CharArray<TString,TChar>::Length(TString const& src ) { __VA_ARGS__ }
 
#define ALIB_CHARACTER_ZT_ARRAY_IMPL_LENGTH( TString, TChar, ...)   integer T_ZTCharArray<TString,TChar>::Length( TString const& src ) { __VA_ARGS__ }
 
#define ALIB_CHARACTER_ARRAY_IMPL_LENGTH_MUTABLE( TString, TChar, ...)   integer T_CharArray<TString,TChar>::Length(TString & src ) { __VA_ARGS__ }
 
#define ALIB_CHARACTER_ZT_ARRAY_IMPL_LENGTH_MUTABLE(TString, TChar, ...)   integer T_ZTCharArray<TString,TChar>::Length( TString & src ) { __VA_ARGS__ }
 
#define ALIB_CHARACTER_ARRAY_IMPL_CONSTRUCT( TString, TChar, ...)    TString T_CharArray <TString,TChar>::Construct( const TChar* array, integer length ) { __VA_ARGS__ }
 
#define ALIB_CHARACTER_ZT_ARRAY_IMPL_CONSTRUCT( TString, TChar, ...)    TString T_ZTCharArray<TString,TChar>::Construct( const TChar* array, integer length ) { __VA_ARGS__ }
 

ALib Module Enums

The macros in this section are introduced by module ALib Enums and allow to specialize type-traits structs T_EnumRecords , T_EnumIsArithmetical , T_EnumIsBitwise and T_EnumIsIterable for scoped or non-scoped enum types.

Attention
  • All macros (except ALIB_ENUMS_UNDERLYING_TYPE) in this section have to be placed in global scope (outside of namespaces and types).
  • For technical reasons, neither the macros nor the concepts behind them are applicable to enum types that are defined as private or protected inner types of structs or classes.
#define ALIB_ENUMS_UNDERLYING_TYPE(TEnum)   typename std::underlying_type<TEnum>::type
 
#define ALIB_ENUMS_ASSIGN_RECORD(TEnum, TRecord)
 
#define ALIB_ENUMS_MAKE_ARITHMETICAL(TEnum)
 
#define ALIB_ENUMS_MAKE_BITWISE(TEnum)
 
#define ALIB_ENUMS_MAKE_ITERABLE(TEnum, StopElement)   ALIB_ENUMS_MAKE_ITERABLE_BEGIN_END( TEnum, TEnum(0), StopElement )
 
#define ALIB_ENUMS_MAKE_ITERABLE_BEGIN_END(TEnum, StartElement, StopElement)
 

ALib Module Expressions

The macros in this section are introduced by module ALib Expressions .

#define CALCULUS_CALLBACK(func)   func, ALIB_NSTRINGIFY(func)
 
#define CALCULUS_DEFAULT_AUTOCAST   nullptr, nullptr
 
#define CALCULUS_SIGNATURE(BoxPointerArray)   BoxPointerArray, std::extent<decltype(BoxPointerArray)>::value
 

ALib Module Strings

The macros in this section are introduced by module ALib Strings .

#define ALIB_STRINGS_APPENDABLE_TYPE(TYPE)
 
#define ALIB_STRINGS_APPENDABLE_TYPE_N(TYPE)
 
#define ALIB_STRINGS_APPENDABLE_TYPE_W(TYPE)
 
#define ALIB_STRINGS_APPENDABLE_TYPE_DEF(TYPE, IMPL)
 
#define ALIB_STRINGS_APPENDABLE_TYPE_DEF_N(TYPE, IMPL)
 
#define ALIB_STRINGS_APPENDABLE_TYPE_DEF_W(TYPE, IMPL)
 
#define ALIB_STRINGS_APPENDABLE_TYPE_INLINE(TYPE, IMPL)
 
#define ALIB_STRINGS_APPENDABLE_TYPE_INLINE_N(TYPE, IMPL)
 
#define ALIB_STRINGS_APPENDABLE_TYPE_INLINE_W(TYPE, IMPL)
 
#define ALIB_STRINGS_SUPPRESS_STD_OSTREAM_OPERATOR(TYPE)
 
#define ALIB_STRING_DBG_CHK(instance)
 
#define ALIB_STRINGS_TO_NARROW( src, dest, bufSize)   decltype(src)& dest(src);
 
#define ALIB_STRINGS_FROM_NARROW( src, dest, bufSize)   decltype(src)& dest(src);
 
#define ALIB_STRINGS_TO_NARROW_ARG( src, bufSize)   src;
 
#define ALIB_STRINGS_FROM_NARROW_ARG( src, bufSize)   src;
 
#define ALIB_STRINGS_TO_WIDE( src, dest, bufSize)   alib::strings::TLocalString<wchar,bufSize> dest(src);
 
#define ALIB_STRINGS_FROM_WIDE( src, dest, bufSize)   alib::strings::TLocalString<nchar,bufSize> dest(src);
 
#define ALIB_STRINGS_TO_WIDE_ARG( src, bufSize)   alib::strings::TLocalString<wchar,bufSize>(src);
 
#define ALIB_STRINGS_FROM_WIDE_ARG   src,bufSize ) alib::strings::TLocalString<nchar,bufSize>(src);
 
#define ALIB_STRING_RESETTER(astring)
 

ALib Module BaseCamp

The macros in this section are introduced by sub-namespace alib::lang::resources of module ALib BaseCamp .

#define ALIB_RESOURCED(T, ResPool, ResCategory, ResName)
 
#define ALIB_RESOURCED_IN_MODULE(T, Camp, ResName)    ALIB_RESOURCED( T, &Camp.GetResourcePool(), Camp.ResourceCategory, ResName )
 

Code Selection

The macros listed here include or prune code, dependent on different preprocessor symbols. They are mainly given to avoid #if/#else/#endif statements for small code pieces.

#define ALIB_DBG(...)   __VA_ARGS__
 
#define ALIB_REL_DBG(releaseCode, ...)   __VA_ARGS__
 
#define ALIB_REL(...)
 
#define ALIB_CPP_23(...)
 
#define ALIB_CPP_BEFORE_23(...)   __VA_ARGS__
 
#define ALIB_IF_ALOX(...)   __VA_ARGS__
 
#define ALIB_IFN_ALOX(...)
 
#define ALIB_IF_BOXING(...)   __VA_ARGS__
 
#define ALIB_IFN_BOXING(...)
 
#define ALIB_IF_BITBUFFER(...)   __VA_ARGS__
 
#define ALIB_IFN_BITBUFFER(...)
 
#define ALIB_IF_CONFIGURATION(...)   __VA_ARGS__
 
#define ALIB_IFN_CONFIGURATION(...)
 
#define ALIB_IF_CLI(...)   __VA_ARGS__
 
#define ALIB_IFN_CLI(...)
 
#define ALIB_IF_CAMP(...)   __VA_ARGS__
 
#define ALIB_IFN_CAMP(...)
 
#define ALIB_IF_ENUMS(...)   __VA_ARGS__
 
#define ALIB_IFN_ENUMS(...)
 
#define ALIB_IF_EXPRESSIONS(...)   __VA_ARGS__
 
#define ALIB_IFN_EXPRESSIONS(...)
 
#define ALIB_IF_FILES(...)   __VA_ARGS__
 
#define ALIB_IFN_FILES(...)
 
#define ALIB_IF_THREADS(...)   __VA_ARGS__
 
#define ALIB_IFN_THREADS(...)
 
#define ALIB_IF_STRINGS(...)   __VA_ARGS__
 
#define ALIB_IFN_STRINGS(...)
 
#define ALIB_IF_MONOMEM(...)   __VA_ARGS__
 
#define ALIB_IFN_MONOMEM(...)
 
#define ALIB_IF_CHARACTERS(...)   __VA_ARGS__
 
#define ALIB_IFN_CHARACTERS(...)
 
#define ALIB_IF_TIME(...)   __VA_ARGS__
 
#define ALIB_IFN_TIME(...)
 
#define ALIB_IF_SINGLETONS(...)   __VA_ARGS__
 
#define ALIB_IFN_SINGLETONS(...)
 

Macro Definition Documentation

◆ A_CCHAR

#define A_CCHAR ( STR)

Macro used to express C++ string literals in a platform independent way. Dependent on the definition of type complementChar (which is in turn dependent on the platform, the compiler and optional compiler symbols), this macro defines string literals, which have either a one, two or four byte character width, namely the width corresponding to the width of complementChar.

See also
Sibling macro A_CHAR for more information. Further sibling macros are A_SCHAR, A_NCHAR, A_WCHAR and A_XCHAR.
Details are described in chapter 3.3 Character And String Literals of the Programmer's Manual of module ALib Characters .
Parameters
STRThe character or string literal to eventually prefix with 'u', 'U' or 'L' .

Definition at line 13 of file prepro_macros.dox.

◆ A_CHAR

#define A_CHAR ( STR)

Macro used to express C++ character and string literals in a platform independent way. Dependent on code selection symbols ALIB_CHARACTERS_WIDE and eventually ALIB_CHARACTERS_NATIVE_WCHAR, this macro possibly prepends character 'L', 'u' or 'U' to the character or string literal given with parameter STR .

Whenever a software targets different platforms that change the underlying character width of the string types, the string literals have to change as well. To be able to compile on different platforms while using different compiler symbols to manipulate the character width, almost all string literals in ALib sources are enclosed by this macro. The exclamation are of-course such literals which are assigned to narrow string type NString , or those where explicit string types WString or XString are used.

Note
To avoid too much code clutter, this macro, as well as its siblings A_CCHAR, A_SCHAR, A_NCHAR, A_WCHAR and A_XCHAR, have an abbreviated name, as they are quite frequently used. (According to the ALib naming scheme, the macros would be prefixed with "ALIB_CHARACTERS_")
See also
For more information, consult chapter 3.3 Character And String Literals of the Programmer's Manual of module ALib Characters .
Parameters
STRThe character or string literal to be eventually prefix with 'L', 'u' or 'U'.

Definition at line 11 of file prepro_macros.dox.

◆ A_NCHAR

#define A_NCHAR ( STR)

This is an "ident macro" that just produces the given parameter STR . It is provided only for completeness. ALib does not use this macro internally, as string literals that are not surrounded by one of the character literal macros are very well identifiable as narrow literals.

See also
Sibling macro A_CHAR for more information. Further sibling macros are A_CCHAR, A_SCHAR, A_WCHAR and A_XCHAR.
Details are described in chapter 3.3 Character And String Literals of the Programmer's Manual of module ALib Characters .
Parameters
STRThe character or string literal that is returned as is.

Definition at line 14 of file prepro_macros.dox.

◆ A_SCHAR

#define A_SCHAR ( STR)

Macro used to express C++ string literals in a platform independent way. Dependent on the definition of type strangeChar (which is in turn dependent on the platform, the compiler and optional compiler symbols), this macro defines string literals, which have either a two or four byte character width, namely the width corresponding to the width of complementChar.

Note
The same as type strangeChar is always equivalent to type xchar , this macro is always equivalent to macro A_XCHAR.
See also
Sibling macro A_CHAR for more information. Further sibling macros are A_CCHAR, A_NCHAR, A_WCHAR and A_XCHAR.
Details are described in chapter 3.3 Character And String Literals of the Programmer's Manual of module ALib Characters .
Parameters
STRThe character or string literal to prefix with 'u', 'U' or 'L' .

Definition at line 12 of file prepro_macros.dox.

◆ A_WCHAR

#define A_WCHAR ( STR)

Macro used to express C++ string literals in a platform independent way. Dependent on the definition of type wchar (which is in turn dependent on the platform, the compiler and optional compiler symbols), this macro defines string literals, which have an either two bytes or four byte character width, namely the width corresponding to the width of wchar.

See also
Sibling macro A_CHAR for more information. Further sibling macros are A_CCHAR, A_SCHAR, A_NCHAR and A_XCHAR.
Details are described in chapter 3.3 Character And String Literals of the Programmer's Manual of module ALib Characters .
Parameters
STRThe character or string literal to prefix with 'u', 'U' or 'L' .

Definition at line 15 of file prepro_macros.dox.

◆ A_XCHAR

#define A_XCHAR ( STR)

Macro used to express C++ string literals in a platform independent way. Dependent on the definition of type xchar (which is in turn dependent on the platform, the compiler and optional compiler symbols), this macro defines string literals, which have an either two bytes or four byte character width, namely the width corresponding to the width of xchar.

Note
The same as type strangeChar is always equivalent to type xchar , this macro is always equivalent to macro A_SCHAR.
See also
Sibling macro A_CHAR for more information. Further sibling macros are A_CCHAR, A_SCHAR, A_NCHAR and A_WCHAR.
Details are described in chapter 3.3 Character And String Literals of the Programmer's Manual of module ALib Characters .
Parameters
STRThe character or string literal to prefix with 'u', 'U' or 'L' .

Definition at line 16 of file prepro_macros.dox.

◆ ALIB_API

#define ALIB_API   __declspec(dllexport)

Used to export/import C++ symbols into a dynamic link library. Defined under Windows/MSC when compiling or using ALib classes inside a DLL. Dependent on ALIB_API_IS_DLL and ALIB_API_NO_DLL.

Definition at line 538 of file alib.hpp.

◆ ALIB_ASSERT

#define ALIB_ASSERT ( cond)    { if(!(cond)) ALIB_ERROR( "Assertion Failed" ); }

If given condition is false, error message "Assertion Failed" is written.

Parameters
condThe condition assert.

Definition at line 983 of file alib.hpp.

◆ ALIB_ASSERT_ERROR

#define ALIB_ASSERT_ERROR ( cond,
... )   { if(!(cond)) ALIB_ERROR( __VA_ARGS__ ); }

If given condition is false, given message objects are written as an error.

Parameters
condThe condition assert.
...The objects used to format the message string.

Definition at line 984 of file alib.hpp.

◆ ALIB_ASSERT_GLOBAL_NAMESPACE

#define ALIB_ASSERT_GLOBAL_NAMESPACE
Value:
struct ALibTestGlobalNamespace; \
static_assert(std::is_same<ALibTestGlobalNamespace, ::ALibTestGlobalNamespace>::value, \
"This is not the global namespace!");

If this macro is placed outside the global namespace, a static_assert is raised at compile time.

Definition at line 866 of file alib.hpp.

◆ ALIB_ASSERT_MESSAGE

#define ALIB_ASSERT_MESSAGE ( cond,
... )   { if(!(cond)) ALIB_MESSAGE( __VA_ARGS__ ); }

If given condition is false, given message objects are written as a message.

Parameters
condThe condition assert.
...The objects used to format the message string.

Definition at line 986 of file alib.hpp.

◆ ALIB_ASSERT_MODULE

#define ALIB_ASSERT_MODULE ( modulename)
Value:
static_assert( ALIB_ ## modulename, \
"This module is not included in the ALib distribution/built. " \
"See " ALIB_DOCUMENTATION_URL "alib_manual.html for more information" ); \
#define ALIB_DOCUMENTATION_URL
defined(ALIB_DOX)
Definition alib.hpp:188

Asserts if a given module is included in the ALib Distribution .

Parameters
modulenameThe name of the module to assert as available.

Definition at line 190 of file alib.hpp.

◆ ALIB_ASSERT_RESULT_EQUALS

#define ALIB_ASSERT_RESULT_EQUALS ( func,
value )   { auto result= func; assert(result == value); ((void) result); }

Asserts that a return value of a function call equals the given expected value. In release compilation, the function is still invoked, but no check is performed.

Parameters
funcThe function to invoke.
valueThe value to test for.

Definition at line 999 of file alib.hpp.

◆ ALIB_ASSERT_RESULT_GREATER_THAN

#define ALIB_ASSERT_RESULT_GREATER_THAN ( func,
value )   { auto result= func; assert(result > value); ((void) result); }

Asserts that a return value of a function call is greater than the given value. In release compilation, the function is still invoked, but no check is performed.

Parameters
funcThe function to invoke.
valueThe value to test for.

Definition at line 1001 of file alib.hpp.

◆ ALIB_ASSERT_RESULT_LESS_THAN

#define ALIB_ASSERT_RESULT_LESS_THAN ( func,
value )   { auto result= func; assert(result < value); ((void) result); }

Asserts that a return value of a function call is less than the given expected value. In release compilation, the function is still invoked, but no check is performed.

Parameters
funcThe function to invoke.
valueThe value to test for.

Definition at line 1002 of file alib.hpp.

◆ ALIB_ASSERT_RESULT_NOT_EQUALS

#define ALIB_ASSERT_RESULT_NOT_EQUALS ( func,
value )   { auto result= func; assert(result != value); ((void) result); }

Asserts that a return value of a function call is not equal to the given value. In release compilation, the function is still invoked, but no check is performed.

Parameters
funcThe function to invoke.
valueThe value to test for.

Definition at line 1000 of file alib.hpp.

◆ ALIB_ASSERT_WARNING

#define ALIB_ASSERT_WARNING ( cond,
... )   { if(!(cond)) ALIB_WARNING( __VA_ARGS__ ); }

If given condition is false, given message objects are written as a warning.

Parameters
condThe condition assert.
...The objects used to format the message string.

Definition at line 985 of file alib.hpp.

◆ ALIB_BASE_DIR

#define ALIB_BASE_DIR

String containing the source folder of ALib . Used with unit tests.

Definition at line 36 of file prepro.dox.

◆ ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE

#define ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE ( TAppendable)
Value:

This macro registers templated box-function implementation FAppend::Appendable for the given type TAppendable .

The macro is to be placed in the bootstrap section of an application, for any type that is appendable to class AString.

This macro selects version box-function type FAppend<character>. If a custom type is appendable to two or three underlying character types of class AString, then macros

should be used. Note that for each character type of ALib Strings , a different box-function is registered.

Note
As by default, custom types get boxed as pointers, the type in question usually has to be provided here as pointer type, for example:
   ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE( my_namespace::MyType* )
Parameters
TAppendableThe appendable type.

Definition at line 502 of file functions.inl.

◆ ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE_N

#define ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE_N ( TAppendable)
Value:
alib::boxing::BootstrapRegister<FAppend<nchar >, alib::boxing::TMappedTo<TAppendable>>\

Same as macro ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE but implements interface FAppend<nchar> instead of FAppend<character>.

Parameters
TAppendableThe appendable type.

Definition at line 506 of file functions.inl.

◆ ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE_W

#define ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE_W ( TAppendable)
Value:
alib::boxing::BootstrapRegister<FAppend<wchar >, alib::boxing::TMappedTo<TAppendable>>\

Same as macro ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE but implements interface FAppend<wchar> instead of FAppend<character>.

Parameters
TAppendableThe appendable type.

Definition at line 510 of file functions.inl.

◆ ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE_X

#define ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE_X ( TAppendable)
Value:
alib::boxing::BootstrapRegister<FAppend<xchar >, alib::boxing::TMappedTo<TAppendable>>\

Same as macro ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE but implements interface FAppend<xchar> instead of FAppend<character>.

Parameters
TAppendableThe appendable type.

Definition at line 514 of file functions.inl.

◆ ALIB_BOXING_BOOTSTRAP_VTABLE_DBG_REGISTER

#define ALIB_BOXING_BOOTSTRAP_VTABLE_DBG_REGISTER ( Identifier)
Value:
DbgRegisterVTable( &alib::boxing::detail::SNGLTN_ ## Identifier, \
@ Static
A static VTable is in place.

Registers a statically created vtable singleton declared with either ALIB_BOXING_VTABLE_DECLARE or ALIB_BOXING_VTABLE_DECLARE_ARRAYTYPE.

This macro has to be placed in the bootstrap code of a software. In debug-compilations, this macro is empty.

See also
Chapter 12.2 Optimizations With Static VTables of the Programmer's Manual of module ALib Boxing .
Parameters
IdentifierThe identifier name of the vtable singleton.

Definition at line 506 of file vtable.inl.

◆ ALIB_BOXING_CUSTOMIZE

#define ALIB_BOXING_CUSTOMIZE ( TSource,
TTarget,
... )
Value:
namespace alib::boxing { \
template<> struct T_Boxer<TSource> \
{ \
using Mapping= TMappedTo<TTarget>; \
__VA_ARGS__ \
}; } \
TMappedTo< detail::TDefaultBoxing > Mapping

Macro used to specialize template struct T_Boxer , which customizes boxing for given boxable type TSource to be mapped to non-array type TTarget .

Type definition T_Boxer::Mapping is implemented by the macro to be TMappedTo . The implementations of methods T_Boxer::Write and T_Boxer::Read are to be provided with the variadic macro arguments.

This macro belongs to set of sibling macros. For a customization of boxing the best suitable macro should be chosen. The set is

See also
For more information, consult chapter 7. Customizing Boxing of the Programmer's Manual of module ALib Boxing .

Two further macros exist:

Details for the use of those are given in manual chapter 12.3 Optimizations With "constexpr"-Boxing.

Parameters
TSourceThe C++ 'source' type to specialize struct T_Boxer for.
TTargetThe target type to map TSource to.
...Definition of static inline methods T_Boxer::Write and T_Boxer::Read .

Definition at line 537 of file typetraits.inl.

◆ ALIB_BOXING_CUSTOMIZE_ARRAY_TYPE

#define ALIB_BOXING_CUSTOMIZE_ARRAY_TYPE ( TSource,
TElement,
... )
Value:
namespace alib::boxing { \
template<> struct T_Boxer<TSource> \
{ \
using Mapping= TMappedToArrayOf<TElement>; \
__VA_ARGS__ \
}; }

Specializes template struct T_Boxer , to customize boxing for given boxable type TSource to be mapped to array type TTarget[] .

Type definition T_Boxer::Mapping is implemented by the macro to be TMappedToArrayOf . The implementations of methods T_Boxer::Write and T_Boxer::Read are to be provided with the variadic macro arguments.

See also
Macro ALIB_BOXING_CUSTOMIZE for information about the sibling macros.
Parameters
TSourceThe C++ 'source' type to specialize struct T_Boxer for.
TElementThe element type of the array to map TSource to.
...Definition of static inline methods T_Boxer::Write and T_Boxer::Read .

Definition at line 545 of file typetraits.inl.

◆ ALIB_BOXING_CUSTOMIZE_ARRAY_TYPE_NON_UNBOXABLE

#define ALIB_BOXING_CUSTOMIZE_ARRAY_TYPE_NON_UNBOXABLE ( TSource,
TElement,
... )
Value:
namespace alib::boxing { \
template<> struct T_Boxer<TSource> \
{ using Mapping= TMappedToArrayOf<TElement>; \
__VA_ARGS__ \
static void Read( const Placeholder& src); \
}; }
static Read(const Placeholder &src)

Specializes template struct T_Boxer , to customize boxing for given boxable type TSource to be mapped to array type TTarget[] .

Type definition T_Boxer::Mapping is implemented by the macro to be TMappedToArrayOf .
Static method T_Boxer::Read is declared to return void. No implementation is given (as not needed).
The implementation of method T_Boxer::Write are to be provided with the variadic macro arguments.

See also
Macro ALIB_BOXING_CUSTOMIZE for information about the sibling macros.
Parameters
TSourceThe C++ 'source' type to specialize struct T_Boxer for.
TElementThe element type of the array to map TSource to.
...Definition of static inline method T_Boxer::Write .

Definition at line 587 of file typetraits.inl.

◆ ALIB_BOXING_CUSTOMIZE_DENY_BOXING

#define ALIB_BOXING_CUSTOMIZE_DENY_BOXING ( TSource)
Value:
namespace alib::boxing { \
template<> struct T_Boxer<TSource> \
{ using Mapping= TMappedTo<detail::TNotBoxable>; \
static void Write( Placeholder& target, TSource const & value ); \
static void Read ( const Placeholder& src); \
}; }
static void Write(Placeholder &target, const TBoxable &value)

Specializes template struct T_Boxer , to completely forbid boxing and unboxing of type TSource .

For this, type definition T_Boxer::Mapping is implemented by the macro to be TMappedTo and just declarations of static methods T_Boxer::Write and T_Boxer::Read are given.
The latter is declared to return void. Note that this in principle is not necessary, because using detail::TNotBoxable already forbids unboxing. Nevertheless, this way helper struct TT_IsLocked is of std::true_type for TSource as well.

See also
Macro ALIB_BOXING_CUSTOMIZE for information about the sibling macros.
Parameters
TSourceThe type that should be denied to be used with ALib Boxing .

Definition at line 596 of file typetraits.inl.

◆ ALIB_BOXING_CUSTOMIZE_NOT_UNBOXABLE

#define ALIB_BOXING_CUSTOMIZE_NOT_UNBOXABLE ( TSource,
TTarget )
Value:
namespace alib::boxing { \
template<> struct T_Boxer<TSource> \
{ using Mapping= TMappedTo<TTarget>; \
static void Write( Placeholder& target, TSource const & value ) { target.Write( static_cast<typename Mapping::Type>( value ) ); } \
static void Read( const Placeholder& src); \
}; }

Specializes template struct T_Boxer . This version of a set of sibling macros, is to be used when a simple type mapping is to be performed for types TSource that are statically castable to TTarget .
In contrast to macro ALIB_BOXING_CUSTOMIZE_TYPE_MAPPING, with this macro, unboxing the source type will be is denied.

The macro provides the implementations of all three entities of type traits struct T_Boxer:

  • Type Mapping is using TMappedTo .
  • Static method Write is to do a static cast of the source value to the destination type and to then pass the result to Placeholder::Write .
  • Static method T_Boxer::Read is declared to return void. No implementation is given (as not needed).
See also
Macro ALIB_BOXING_CUSTOMIZE for information about the sibling macros.
Parameters
TSourceThe C++ 'source' type to specialize struct T_Boxer for.
TTargetThe target type to map TSource to.

Definition at line 570 of file typetraits.inl.

◆ ALIB_BOXING_CUSTOMIZE_NOT_UNBOXABLE_CONSTEXPR

#define ALIB_BOXING_CUSTOMIZE_NOT_UNBOXABLE_CONSTEXPR ( TSource,
TTarget )
Value:
namespace alib::boxing { \
template<> struct T_Boxer<TSource> \
{ using Mapping= TMappedTo<TTarget>; \
static constexpr Placeholder Write( TSource const & value ) { return Placeholder( static_cast<typename Mapping::Type>( value ) ); } \
static void Read( const Placeholder& src); \
}; }

Alternative version of macro ALIB_BOXING_CUSTOMIZE_NOT_UNBOXABLE. Details for the use of this macro are given in manual chapter 12.3 Optimizations With "constexpr"-Boxing.

See also
Macro ALIB_BOXING_CUSTOMIZE for information about the sibling macros.
Parameters
TSourceThe C++ 'source' type to specialize struct T_Boxer for.
TTargetThe target type to map TSource to.

Definition at line 578 of file typetraits.inl.

◆ ALIB_BOXING_CUSTOMIZE_TYPE_MAPPING

#define ALIB_BOXING_CUSTOMIZE_TYPE_MAPPING ( TSource,
TTarget )
Value:
namespace alib::boxing { \
template<> struct T_Boxer<TSource> \
{ using Mapping= TMappedTo<TTarget>; \
static void Write( Placeholder& target, TSource const & value ) { target.Write( static_cast<TTarget>( value ) ); } \
static TSource Read (const Placeholder& src) { return static_cast<TSource>(src.Read<TTarget>()); } \
}; }

Specializes template struct T_Boxer . This version of a set of sibling macros, is to be used when simple type mappings are to be performed between types that are statically castable, or when boxing as pointer should be enforced.

The macro provides the implementations of all three entities of type traits struct T_Boxer:

See also
Macro ALIB_BOXING_CUSTOMIZE for information about the sibling macros.
Parameters
TSourceThe C++ 'source' type to specialize struct T_Boxer for.
TTargetThe target type to map TSource to.

Definition at line 553 of file typetraits.inl.

◆ ALIB_BOXING_CUSTOMIZE_TYPE_MAPPING_CONSTEXPR

#define ALIB_BOXING_CUSTOMIZE_TYPE_MAPPING_CONSTEXPR ( TSource,
TTarget )
Value:
namespace alib::boxing { \
template<> struct T_Boxer<TSource> \
{ using Mapping= TMappedTo<TTarget>; \
static constexpr Placeholder Write( TSource const & value ) { return Placeholder( static_cast<TTarget>( value ) );} \
static TSource Read (const Placeholder& src) { return static_cast<TSource>(src.Read<TTarget>() );} \
}; }

Alternative version of macro ALIB_BOXING_CUSTOMIZE_TYPE_MAPPING. Details for the use of this macro are given in manual chapter 12.3 Optimizations With "constexpr"-Boxing.

See also
Macro ALIB_BOXING_CUSTOMIZE for information about the sibling macros.
Parameters
TSourceThe C++ 'source' type to specialize struct T_Boxer for.
TTargetThe target type to map TSource to.

Definition at line 561 of file typetraits.inl.

◆ ALIB_BOXING_DEFINE_FEQUALS_FOR_COMPARABLE_TYPE

#define ALIB_BOXING_DEFINE_FEQUALS_FOR_COMPARABLE_TYPE ( TComparable)
Value:
alib::boxing::TMappedTo<TComparable >>(FEquals::ComparableTypes<TComparable>); \
void BootstrapRegister(typename TFDecl::Signature function)
Definition boxing.hpp:120

This macro registers templated box-function FEquals::ComparableTypes for given mapped type TComparable .

If a type is boxed as pointer type, then TComparable has to be given as pointer type. For comparison, the unboxed pointers will be dereferenced. If both are nulled, true is returned, if one is nulled, false.

As all function registrations have to be performed at run-time, this macro is to be placed in the bootstrap section of an application.

Parameters
TComparableThe comparable type name.

Definition at line 175 of file functions.inl.

◆ ALIB_BOXING_DEFINE_FISLESS_FOR_COMPARABLE_TYPE

#define ALIB_BOXING_DEFINE_FISLESS_FOR_COMPARABLE_TYPE ( TComparable)
Value:
alib::boxing::TMappedTo<TComparable >>(FIsLess::ComparableTypes<TComparable>); \

This macro registers templated box-function FIsLess::ComparableTypes for given type TComparable .

If a type is boxed as pointer type, then TComparable has to be given as pointer type. For comparison, the unboxed pointers will be dereferenced. If both are nulled, false is returned, if only lhs is nulled, true and if only rhs is nulled, then false.

As all function registrations have to be performed at run-time, this macro is to be placed in the bootstrap section of an application.

Parameters
TComparableThe comparable type name.

Definition at line 293 of file functions.inl.

◆ ALIB_BOXING_VTABLE_DECLARE

#define ALIB_BOXING_VTABLE_DECLARE ( TMapped,
Identifier )
Value:
namespace alib::boxing::detail { \
extern ALIB_API VTable SNGLTN_ ## Identifier; \
template<> struct T_VTableFactory< TMappedTo<TMapped> > \
{ static constexpr VTable* Get() { return &SNGLTN_ ## Identifier; } }; } \
#define ALIB_API
Definition alib.hpp:538
static constexpr VTable * Get()
Definition vtable.inl:456

Declares an extern object of type VTable named TMapped in namespace alib::boxing::detail.
Furthermore specializes template struct detail::T_VTableFactory for type TMappedTo to have its method Get return the object named Identifier .

This macro has to be placed in a header included by each compilation unit that creates or access boxes of type TMapped .

See also
Chapter 12.2 Optimizations With Static VTables of the Programmer's Manual of module ALib Boxing .
Parameters
TMappedThe mapped type to declare a vtable singleton for.
IdentifierThe identifier name of the vtable singleton.

Definition at line 477 of file vtable.inl.

◆ ALIB_BOXING_VTABLE_DECLARE_ARRAYTYPE

#define ALIB_BOXING_VTABLE_DECLARE_ARRAYTYPE ( TMapped,
Identifier )
Value:
namespace alib::boxing::detail { \
extern ALIB_API VTable SNGLTN_ ## Identifier; \
template<> struct T_VTableFactory< TMappedToArrayOf<TMapped> > \
{ static constexpr VTable* Get() { return &SNGLTN_ ## Identifier; } }; } \

Same as ALIB_BOXING_VTABLE_DECLARE, but used with mapped array types. Specializes detail::T_VTableFactory for type TMappedToArrayOf , instead of TMappedTo,

Parameters
TMappedThe mapped type to declare a vtable singleton for.
IdentifierThe identifier name of the vtable singleton.

Definition at line 483 of file vtable.inl.

◆ ALIB_BOXING_VTABLE_DEFINE

#define ALIB_BOXING_VTABLE_DEFINE ( TMapped,
Identifier )
Value:
alib::boxing::detail::VTable alib::boxing::detail::SNGLTN_ ## Identifier \
( typeid(TMapped), typeid(void) , \
std::is_pointer<TMapped>::value \
? VTable::MappingType::Pointer \
: std::is_enum<TMapped>::value \
? VTable::MappingType::Enum \
: VTable::MappingType::Value , \

Defines the external object declared with ALIB_BOXING_VTABLE_DECLARE.

This macro has to be placed in a compilation unit.

Parameters
TMappedThe mapped type to define a vtable singleton for.
IdentifierThe identifier name of the vtable singleton.

Definition at line 490 of file vtable.inl.

◆ ALIB_BOXING_VTABLE_DEFINE_ARRAYTYPE

#define ALIB_BOXING_VTABLE_DEFINE_ARRAYTYPE ( TMapped,
Identifier )
Value:
alib::boxing::detail::VTable alib::boxing::detail::SNGLTN_ ## Identifier \
(typeid(TMapped[1]) , typeid(TMapped), VTable::MappingType(sizeof(TMapped)), sizeof(Placeholder)); \

Defines the external object declared with ALIB_BOXING_VTABLE_DECLARE_ARRAYTYPE.

This macro has to be placed in a compilation unit.

Parameters
TMappedThe mapped type to define a vtable singleton for.
IdentifierThe identifier name of the vtable singleton.

Definition at line 500 of file vtable.inl.

◆ ALIB_CALLER

#define ALIB_CALLER   __FILE__, __LINE__, __func__

This macro fills in the built-in compiler symbols that provide the current source file, line number and function strings.

The macro should be used anywhere where this information is passed (as a nested macro in debug macros)

Definition at line 835 of file alib.hpp.

◆ ALIB_CALLER_NULLED

#define ALIB_CALLER_NULLED   ALIB_CALLER

In debug builds this macro is the same as ALIB_CALLER. Otherwise evaluates to nullptr, 0, nullptr.
In comparison to ALIB_CALLER_PRUNED, this macro is to be used with invocations of methods that keep the corresponding parameters in release compilations.

Definition at line 846 of file alib.hpp.

◆ ALIB_CALLER_PRUNED

#define ALIB_CALLER_PRUNED   ALIB_CALLER

This macro is the same as ALIB_CALLER but empty if ALIB_DEBUG is not defined.
In comparison to ALIB_CALLER_NULLED, this macro is to be used with invocations of methods that lack the corresponding parameters in release compilations.

Definition at line 845 of file alib.hpp.

◆ ALIB_CHARACTER_ARRAY

#define ALIB_CHARACTER_ARRAY ( TString,
TChar,
Access,
Construction )   ALIB_CHARACTER_ARRAY_internal( C , TString, TChar, const, Access , Construction )

Specializes type traits struct T_CharArray for type TString .

To implement the corresponding static methods in alignment with the specialized access and construction flags, macros ALIB_CHARACTER_ARRAY_IMPL_BUFFER, ALIB_CHARACTER_ARRAY_IMPL_LENGTH and ALIB_CHARACTER_ARRAY_IMPL_CONSTRUCT are proposed to be used.

See also
For more information about character array traits, see chapter 4. Character Arrays of the Programmer's Manual of module ALib Characters .
Parameters
TStringThe type to provide array type traits for.
TCharThe character type of character arrays that TString represents or might be created of.
AccessOne of the values NONE, Implicit or ExplicitOnly. Value Mutable is not permitted. Instead macro ALIB_CHARACTER_ARRAY_MUTABLE is to be used for that case.
ConstructionOne of the values NONE, Implicit or ExplicitOnly.

Definition at line 465 of file characters.hpp.

◆ ALIB_CHARACTER_ARRAY_IMPL_BUFFER

#define ALIB_CHARACTER_ARRAY_IMPL_BUFFER ( TString,
TChar,
... )   const TChar* T_CharArray<TString,TChar>::Buffer(TString const& src ) { __VA_ARGS__ }

This macro may be used to implement static method T_CharArray::Buffer of specializations of T_CharArray that have been defined using macro ALIB_CHARACTER_ARRAY.

If macro ALIB_CHARACTER_ARRAY_MUTABLE was used, corresponding macro ALIB_CHARACTER_ARRAY_IMPL_BUFFER_MUTABLE has to be used instead of this one.

The argument providing a constant reference of type TString to the method's implementation, and which has to be accessed in the given implementation code, is named src . The implementation has to return a constant pointer to an array of character type TChar .

Parameters
TStringThe type to provide the specialized static method for.
TCharThe character type of character arrays that TString represents or might be created of.
...The variadic arguments of the macro constitute the implementation code of the method.

Definition at line 479 of file characters.hpp.

◆ ALIB_CHARACTER_ARRAY_IMPL_BUFFER_MUTABLE

#define ALIB_CHARACTER_ARRAY_IMPL_BUFFER_MUTABLE ( TString,
TChar,
... )   const TChar* T_CharArray<TString,TChar>::Buffer(TString & src ) { __VA_ARGS__ }

Alternative macro version of ALIB_CHARACTER_ARRAY_IMPL_BUFFER, which declares method argument src as a mutual reference of type TString .

This version is to be used if specialization was performed using ALIB_CHARACTER_ARRAY_IMPL_BUFFER_MUTABLE.

Parameters
TStringThe type to provide the specialized static method for.
TCharThe character type of character arrays that TString represents or might be created of.
...The variadic arguments of the macro constitute the implementation code of the method.

Definition at line 485 of file characters.hpp.

◆ ALIB_CHARACTER_ARRAY_IMPL_CONSTRUCT

#define ALIB_CHARACTER_ARRAY_IMPL_CONSTRUCT ( TString,
TChar,
... )    TString T_CharArray <TString,TChar>::Construct( const TChar* array, integer length ) { __VA_ARGS__ }

This macro may be used to implement static method T_CharArray::Construct of specializations of T_CharArray that have been defined using macro ALIB_CHARACTER_ARRAY or ALIB_CHARACTER_ARRAY_MUTABLE.

The arguments providing the array data to the method's implementation, which is to be used to create the object of type TString , are named array and length . The implementation has to return a value of type TString .

Parameters
TStringThe type to provide the specialized static method for.
TCharThe character type of character arrays that TString represents or might be created of.
...The variadic arguments of the macro constitute the implementation code of the method.

Definition at line 491 of file characters.hpp.

◆ ALIB_CHARACTER_ARRAY_IMPL_LENGTH

#define ALIB_CHARACTER_ARRAY_IMPL_LENGTH ( TString,
TChar,
... )   integer T_CharArray<TString,TChar>::Length(TString const& src ) { __VA_ARGS__ }

This macro may be used to implement static method T_CharArray::Length of specializations of T_CharArray that have been defined using macro ALIB_CHARACTER_ARRAY.

The argument providing a constant reference of type TString to the method's implementation, and which has to be accessed in the given implementation code, is named src . The implementation has to return the length of the character array as type integer .

Parameters
TStringThe type to provide the specialized static method for.
TCharThe character type of character arrays that TString represents or might be created of.
...The variadic arguments of the macro constitute the implementation code of the method.

Definition at line 482 of file characters.hpp.

◆ ALIB_CHARACTER_ARRAY_IMPL_LENGTH_MUTABLE

#define ALIB_CHARACTER_ARRAY_IMPL_LENGTH_MUTABLE ( TString,
TChar,
... )   integer T_CharArray<TString,TChar>::Length(TString & src ) { __VA_ARGS__ }

Alternative macro version of ALIB_CHARACTER_ARRAY_IMPL_LENGTH, which declares method argument src as a mutual reference of type TString .

Parameters
TStringThe type to provide the specialized static method for.
TCharThe character type of character arrays that TString represents or might be created of.
...The variadic arguments of the macro constitute the implementation code of the method.

Definition at line 488 of file characters.hpp.

◆ ALIB_CHARACTER_ARRAY_MUTABLE

#define ALIB_CHARACTER_ARRAY_MUTABLE ( TString,
TChar,
Construction )   ALIB_CHARACTER_ARRAY_internal( C , TString, TChar, , MutableOnly, Construction )

Specializes type traits struct T_CharArray for type TString with access modifier Mutable.

To implement the corresponding static methods in alignment with the specialized access and construction flags, macros ALIB_CHARACTER_ARRAY_IMPL_BUFFER_MUTABLE, ALIB_CHARACTER_ARRAY_IMPL_LENGTH_MUTABLE and ALIB_CHARACTER_ARRAY_IMPL_CONSTRUCT are proposed to be used.

See also
For more information about character array traits, see chapter 4. Character Arrays of the Programmer's Manual of module ALib Characters .
Parameters
TStringThe type to provide array type traits for.
TCharThe character type of character arrays that TString represents or might be created of.
ConstructionOne of the values NONE, Implicit or ExplicitOnly.

Definition at line 468 of file characters.hpp.

◆ ALIB_CHARACTER_ZT_ARRAY

#define ALIB_CHARACTER_ZT_ARRAY ( TString,
TChar,
Access,
Construction )   ALIB_CHARACTER_ARRAY_internal( ZTC, TString, TChar, const, Access , Construction )

Specializes type traits struct T_ZTCharArray for type TString .

To implement the corresponding static methods in alignment with the specialized access and construction flags, macros ALIB_CHARACTER_ZT_ARRAY_IMPL_BUFFER, ALIB_CHARACTER_ZT_ARRAY_IMPL_LENGTH and ALIB_CHARACTER_ZT_ARRAY_IMPL_CONSTRUCT are proposed to be used.

See also
For more information about character array traits, see chapter 4. Character Arrays of the Programmer's Manual of module ALib Characters .
Parameters
TStringThe type to provide array type traits for.
TCharThe character type of character arrays that TString represents or might be created of.
AccessOne of the values NONE, Implicit or ExplicitOnly. Value Mutable is not permitted. Instead macro ALIB_CHARACTER_ARRAY_MUTABLE is to be used for that case.
ConstructionOne of the values NONE, Implicit or ExplicitOnly.

Definition at line 471 of file characters.hpp.

◆ ALIB_CHARACTER_ZT_ARRAY_IMPL_BUFFER

#define ALIB_CHARACTER_ZT_ARRAY_IMPL_BUFFER ( TString,
TChar,
... )   const TChar* T_ZTCharArray<TString,TChar>::Buffer( TString const& src ) { __VA_ARGS__ }

Same as ALIB_CHARACTER_ARRAY_IMPL_BUFFER, but for zero-terminated character arrays.
(Implements method T_ZTCharArray::Buffer instead of T_CharArray::Buffer .)

Parameters
TStringThe type to provide the specialized static method for.
TCharThe character type of character arrays that TString represents or might be created of.
...The variadic arguments of the macro constitute the implementation code of the method.

Definition at line 494 of file characters.hpp.

◆ ALIB_CHARACTER_ZT_ARRAY_IMPL_BUFFER_MUTABLE

#define ALIB_CHARACTER_ZT_ARRAY_IMPL_BUFFER_MUTABLE ( TString,
TChar,
... )   const TChar* T_ZTCharArray<TString,TChar>::Buffer( TString & src ) { __VA_ARGS__ }

Same as ALIB_CHARACTER_ARRAY_IMPL_BUFFER_MUTABLE, but for zero-terminated character arrays.
(Implements method T_ZTCharArray::Buffer instead of T_CharArray::Buffer .)

Parameters
TStringThe type to provide the specialized static method for.
TCharThe character type of character arrays that TString represents or might be created of.
...The variadic arguments of the macro constitute the implementation code of the method.

Definition at line 500 of file characters.hpp.

◆ ALIB_CHARACTER_ZT_ARRAY_IMPL_CONSTRUCT

#define ALIB_CHARACTER_ZT_ARRAY_IMPL_CONSTRUCT ( TString,
TChar,
... )    TString T_ZTCharArray<TString,TChar>::Construct( const TChar* array, integer length ) { __VA_ARGS__ }

Same as ALIB_CHARACTER_ARRAY_IMPL_CONSTRUCT, but for zero-terminated character arrays.
(Implements method T_ZTCharArray::Construct instead of T_CharArray::Construct .)

Parameters
TStringThe type to provide the specialized static method for.
TCharThe character type of character arrays that TString represents or might be created of.
...The variadic arguments of the macro constitute the implementation code of the method.

Definition at line 506 of file characters.hpp.

◆ ALIB_CHARACTER_ZT_ARRAY_IMPL_LENGTH

#define ALIB_CHARACTER_ZT_ARRAY_IMPL_LENGTH ( TString,
TChar,
... )   integer T_ZTCharArray<TString,TChar>::Length( TString const& src ) { __VA_ARGS__ }

Same as ALIB_CHARACTER_ARRAY_IMPL_LENGTH, but for zero-terminated character arrays.
(Implements method T_ZTCharArray::Length instead of T_CharArray::Length .)

Parameters
TStringThe type to provide the specialized static method for.
TCharThe character type of character arrays that TString represents or might be created of.
...The variadic arguments of the macro constitute the implementation code of the method.

Definition at line 497 of file characters.hpp.

◆ ALIB_CHARACTER_ZT_ARRAY_IMPL_LENGTH_MUTABLE

#define ALIB_CHARACTER_ZT_ARRAY_IMPL_LENGTH_MUTABLE ( TString,
TChar,
... )   integer T_ZTCharArray<TString,TChar>::Length( TString & src ) { __VA_ARGS__ }

Same as ALIB_CHARACTER_ARRAY_IMPL_LENGTH_MUTABLE, but for zero-terminated character arrays.
(Implements method T_ZTCharArray::Length instead of T_CharArray::Length .)

Parameters
TStringThe type to provide the specialized static method for.
TCharThe character type of character arrays that TString represents or might be created of.
...The variadic arguments of the macro constitute the implementation code of the method.

Definition at line 503 of file characters.hpp.

◆ ALIB_CHARACTER_ZT_ARRAY_MUTABLE

#define ALIB_CHARACTER_ZT_ARRAY_MUTABLE ( TString,
TChar,
Construction )   ALIB_CHARACTER_ARRAY_internal( ZTC, TString, TChar, , MutableOnly, Construction )

Specializes type traits struct T_ZTCharArray for type TString with access modifier Mutable.

To implement the corresponding static methods in alignment with the specialized access and construction flags, macros ALIB_CHARACTER_ZT_ARRAY_IMPL_BUFFER_MUTABLE, ALIB_CHARACTER_ZT_ARRAY_IMPL_LENGTH_MUTABLE and ALIB_CHARACTER_ZT_ARRAY_IMPL_CONSTRUCT are proposed to be used.

See also
For more information about character array traits, see chapter 4. Character Arrays of the Programmer's Manual of module ALib Characters .
Parameters
TStringThe type to provide array type traits for.
TCharThe character type of character arrays that TString represents or might be created of.
ConstructionOne of the values NONE, Implicit or ExplicitOnly.

Definition at line 474 of file characters.hpp.

◆ ALIB_COMMA

#define ALIB_COMMA   ,

Defines a simple comma (','). Used with macros when otherwise the use of a comma symbol leads to ambiguous syntax. For example when passing template types to macros.

Used with macros when otherwise the use of a comma symbol leads to ambiguous syntax. For example when passing template types to macros as shown here:

    MY_MACRO( std::vector<int ALIB_COMMA double> )

Definition at line 825 of file alib.hpp.

◆ ALIB_COMMA_DBG

#define ALIB_COMMA_DBG   ,

Defines a simple comma (',') with debug builds. In release compilations the macro is empty. This is useful for example when methods change their signature depending on the compilation type. The latter is unavoidable i.e if caller source code information should be passed for debugging.

Used with macros when otherwise the use of a comma symbol leads to ambiguous syntax. For example when passing template types to macros.

Definition at line 827 of file alib.hpp.

◆ ALIB_COMPILATION_FLAGS

#define ALIB_COMPILATION_FLAGS

Macro to provide a compilation flag verifier value to be used with method alib::AssertALibVersionAndFlags which is automatically invoked with function alib::Bootstrap (and overloads). The value of this macro is stored in namespace variable alib::Revision.

See also
Programmer's manual chapter 4.7 Assuring Compilation Compatibility.

Definition at line 8 of file prepro_macros.dox.

◆ ALIB_CONCAT

#define ALIB_CONCAT ( a,
b )   a ## b

Concatenates two preprocessor macro parameters into one symbol.

Parameters
aThe first part of the concatenated code.
bThe second part of the concatenated code.

Definition at line 812 of file alib.hpp.

◆ ALIB_CPP_23

#define ALIB_CPP_23 ( ...)

This simple macro may be used for placing code that is only applicable to the C++ language standard 23 or higher. With lower standard the code given is pruned.

See also
Macro ALIB_CPP_BEFORE_23

Definition at line 530 of file alib.hpp.

◆ ALIB_CPP_BEFORE_23

#define ALIB_CPP_BEFORE_23 ( ...)    __VA_ARGS__

This simple macro may be used for placing code that is only applicable to the C++ language standard 20 or below. With higher standard the code given is pruned.

See also
Macro ALIB_CPP_23

This group of simple macros either include or prune code dependent on the inclusion of ALib Modules in an ALib Distribution .

The symbols are defined in header alib/alib.hpp which always is and has to be the first ALib header file included (directly or indirectly).

Definition at line 531 of file alib.hpp.

◆ ALIB_DBG

#define ALIB_DBG ( ...)    __VA_ARGS__

This simple macro may be used for placing debug statements into source code. Those get 'pruned' in release versions of ALib (respectively of the software that uses ALib and then this macro). It replaces

    #if ALIB_DEBUG
        // do stuff
        ...
        ...
    #endif

and is useful especially for single line statements.

Parameters
...Source code to prune in release builds.

Definition at line 457 of file alib.hpp.

◆ ALIB_DBG_PREVENT_RECURSIVE_METHOD_CALLS

#define ALIB_DBG_PREVENT_RECURSIVE_METHOD_CALLS
Value:
struct RecursionDetection \
{ \
bool& TestMember; \
RecursionDetection( bool& testMember ) : TestMember(testMember) {} \
\
void Acquire( const NCString&, int, const NCString& func ) \
{ \
ALIB_ASSERT_ERROR(TestMember==false, "FSOWNER", "Forbidden recursive use of method ", func) \
TestMember= true; \
} \
void Release() { TestMember= false; } \
}; \
RecursionDetection dbgRecursionDetection( dbgRecursionDetectionFlag ); \
ALIB_OWN(dbgRecursionDetection);

This macro may be placed at the beginning of a function to detect and assert recursive calls of that function. It is useful when recursion might happen, but must not.
The macro internally uses macro ALIB_OWN and hence class Owner that uses C++ stack unwinding to be sure to always clear the flag, even if an exception occurs.

In the case that the macro is placed in more than one method, it can be used to assure that none of he methods calls any of the others.

A prerequisite of the use of the macro is to have macro ALIB_DBG_PREVENT_RECURSIVE_METHOD_CALLS_MEMBER_DECL placed in the member declaration area of the type.

This macro is only active in debug-compilations and is available with the inclusion of header filer "alib/lib/owner.hpp.

Definition at line 122 of file owner.hpp.

◆ ALIB_DBG_PREVENT_RECURSIVE_METHOD_CALLS_MEMBER_DECL

#define ALIB_DBG_PREVENT_RECURSIVE_METHOD_CALLS_MEMBER_DECL   bool dbgRecursionDetectionFlag = false;

Used with macro ALIB_DBG_PREVENT_RECURSIVE_METHOD_CALLS, usually in header compilation unit to declare a boolean class member that is used for detecting recursions.

Definition at line 119 of file owner.hpp.

◆ ALIB_EMPTY

#define ALIB_EMPTY

Defines an empty macro. This is useful for example if a macro defined variadic arguments ('...') and a user wants to omit to provide a value. Some compilers (preprocessors) might warn about empty variadic arguments, if nothing was given. This macro avoids this and increased the readability.

Definition at line 822 of file alib.hpp.

◆ ALIB_ENUMS_ASSIGN_RECORD

#define ALIB_ENUMS_ASSIGN_RECORD ( TEnum,
TRecord )
Value:
namespace alib::enums { \
template<> struct T_EnumRecords<TEnum> : public std::true_type \
{ \
using Type= TRecord; \
};}
enums::T_EnumRecords< TEnum > T_EnumRecords
Type alias in namespace alib.
Definition records.hpp:741

Macro used to specialize type-traits struct T_EnumRecords to associate C++ enumeration type TEnum with ALib Enum Records of type TRecord .

Parameters
TEnumThe enumeration type to define data records for.
TRecordThe type of the data record to assign.

Definition at line 752 of file records.hpp.

◆ ALIB_ENUMS_MAKE_ARITHMETICAL

#define ALIB_ENUMS_MAKE_ARITHMETICAL ( TEnum)
Value:
namespace alib::enums { \
template<> struct T_EnumIsArithmetical<TEnum> : public std::true_type {}; } \
enums::T_EnumIsArithmetical< TEnum > T_EnumIsArithmetical
Type alias in namespace alib.

Specializes TMP struct T_EnumIsArithmetical to inherit std::true_type to enable a set of arithmetic operators on the elements of TEnum .

Usually, this macro is placed in a header file, probably close to the enum type definition. However, it has to be placed in global (no) namespace.

See also
Chapter 2.1 Standard Arithmetical Operators of the Programmer's Manual of module ALib Enums for more information.
Parameters
TEnumType of a scoped or non-scoped enumeration that is to be declared an arithmetical type.

Definition at line 90 of file arithmetical.hpp.

◆ ALIB_ENUMS_MAKE_BITWISE

#define ALIB_ENUMS_MAKE_BITWISE ( TEnum)
Value:
namespace alib::enums { \
template<> \
struct T_EnumIsBitwise<TEnum> : public std::true_type {}; }
enums::T_EnumIsBitwise< TEnum > T_EnumIsBitwise
Type alias in namespace alib.
Definition bitwise.hpp:112

Specializes TMP struct T_EnumIsBitwise to inherit std::true_type.

Usually, this macro is placed in a header file, probably close to the enum type definition. However, it has to be placed in global (no) namespace.

See also
Chapter 2.2 Bitwise Operators of the Programmer's Manual of module ALib Enums for more information.
Parameters
TEnumType of a scoped or non-scoped enumeration that is to be declared a bitwise type.

Definition at line 120 of file bitwise.hpp.

◆ ALIB_ENUMS_MAKE_ITERABLE

#define ALIB_ENUMS_MAKE_ITERABLE ( TEnum,
StopElement )   ALIB_ENUMS_MAKE_ITERABLE_BEGIN_END( TEnum, TEnum(0), StopElement )

Shortcut to ALIB_ENUMS_MAKE_ITERABLE_BEGIN_END, providing TEnum(0) as macro parameter StartElement .

Usually, this macro is placed in a header file, probably close to the enum type definition. However, it has to be placed in global (no) namespace.

See also
Sibling macro ALIB_ENUMS_MAKE_ITERABLE_BEGIN_END and chapter 3. Enum Iteration of the Programmer's Manual of module ALib Enums for more information.
Parameters
TEnumType of a scoped or non-scoped enumeration that is to be declared an iterable enum type.
StopElementThe enum element after the last "valid" element in the enumeration.
Will be used as expression for constexpr T_EnumIsIterable::End .

Definition at line 114 of file iterable.hpp.

◆ ALIB_ENUMS_MAKE_ITERABLE_BEGIN_END

#define ALIB_ENUMS_MAKE_ITERABLE_BEGIN_END ( TEnum,
StartElement,
StopElement )
Value:
namespace alib::enums { \
template<> struct T_EnumIsIterable<TEnum> : std::true_type \
{ \
static constexpr TEnum Begin = StartElement; \
static constexpr TEnum End = StopElement; \
};}
static constexpr TEnum Begin
Definition iterable.hpp:85
static constexpr TEnum End
Definition iterable.hpp:95

Specializes type-traits struct T_EnumIsIterable to implement methods:

  • Begin to return StartElement
  • End to return StopElement

Usually, this macro is placed in a header file, probably close to the enum type definition. However, it has to be placed in global (no) namespace.

See also
Sibling macro ALIB_ENUMS_MAKE_ITERABLE and chapter 3. Enum Iteration of the Programmer's Manual of module ALib Enums for more information.
Parameters
TEnumType of a scoped or non-scoped enumeration that is to be declared an iterable enum type.
StartElementThe first element of the enumeration.
Will be used as expression for constexpr T_EnumIsIterable::End .
StopElementThe enum element after the last "valid" element in the enumeration.
Will be used as expression for constexpr T_EnumIsIterable::End .

Definition at line 106 of file iterable.hpp.

◆ ALIB_ENUMS_UNDERLYING_TYPE

#define ALIB_ENUMS_UNDERLYING_TYPE ( TEnum)    typename std::underlying_type<TEnum>::type

Simple shortcut to typename std::underlying_type<TEnum>::type.

Definition at line 22 of file underlyingintegral.hpp.

◆ ALIB_ERROR

#define ALIB_ERROR ( ...)    { alib::lang::DbgSimpleALibMsg( ALIB_CALLER_PRUNED, 0, __VA_ARGS__); }

Writes the given message objects as an error.

Parameters
...The objects used to format the message string.

Definition at line 980 of file alib.hpp.

◆ ALIB_FALLTHROUGH

#define ALIB_FALLTHROUGH   [[clang::fallthrough]];

Used with keyword switch to annotate a case block that has no break or (return, etc.). Avoids a warning with some compilers.

Definition at line 718 of file alib.hpp.

◆ ALIB_FORCE_INLINE

#define ALIB_FORCE_INLINE   __forceinline

Uses compiler-specific annotation (including keyword inline if necessary) to mark a method or function to be compiled and linked inline.

Note
While this symbol might be used for "manual" performance optimization, such use is recommended only in seldom cases. ALib itself uses this if technical reasons impose a strict requirement for inlining. This is for example the case, if template meta programming select different versions depending on type traits. Such traits might be selected differently per compilation unit (CPP-file). If not inlined, the selection might not be effective.

Definition at line 549 of file alib.hpp.

◆ ALIB_IDENTIFIER

#define ALIB_IDENTIFIER ( prefix)
Value:
ALIB_WARNINGS_IGNORE_RESERVED_IDENTIFIER \
ALIB_CONCAT(prefix, __LINE__) \
#define ALIB_WARNINGS_RESTORE
Definition alib.hpp:715

This macro assembles an 'anonymous' identifier using the given prefix and the current line number within the source code file. This macro is used within other macros that need a C/C++ identifier internally.
As a sample, see macro ALIB_OWN.

Parameters
prefixA prefix token to use.

Definition at line 815 of file alib.hpp.

◆ ALIB_IF_ALOX

#define ALIB_IF_ALOX ( ...)    __VA_ARGS__

Prunes given code ... if ALox is not included in the ALib Distribution .

See also
Symbol ALIB_ALOX and sibling macro ALIB_IFN_ALOX.
Parameters
...The source to select.

Definition at line 199 of file alib.hpp.

◆ ALIB_IF_BITBUFFER

#define ALIB_IF_BITBUFFER ( ...)    __VA_ARGS__

Prunes given code ... if ALib BitBuffer is not included in the ALib Distribution .

See also
Symbol ALIB_BITBUFFER and sibling macro ALIB_IFN_BITBUFFER.
Parameters
...The source to select.

Definition at line 207 of file alib.hpp.

◆ ALIB_IF_BOXING

#define ALIB_IF_BOXING ( ...)    __VA_ARGS__

Prunes given code ... if ALib Boxing is not included in the ALib Distribution .

See also
Symbol ALIB_BOXING and sibling macro ALIB_IFN_BOXING.
Parameters
...The source to select.

Definition at line 215 of file alib.hpp.

◆ ALIB_IF_CAMP

#define ALIB_IF_CAMP ( ...)    __VA_ARGS__

Prunes given code ... if ALib BaseCamp is not included in the ALib Distribution .

See also
Symbol ALIB_CAMP and sibling macro ALIB_IFN_CAMP.
Parameters
...The source to select.

Definition at line 295 of file alib.hpp.

◆ ALIB_IF_CHARACTERS

#define ALIB_IF_CHARACTERS ( ...)    __VA_ARGS__

Prunes given code ... if ALib Characters is not included in the ALib Distribution .

See also
Symbol ALIB_CHARACTERS and sibling macro ALIB_IFN_CHARACTERS.
Parameters
...The source to select.

Definition at line 223 of file alib.hpp.

◆ ALIB_IF_CLI

#define ALIB_IF_CLI ( ...)    __VA_ARGS__

Prunes given code ... if ALib CLI is not included in the ALib Distribution .

See also
Symbol ALIB_CLI and sibling macro ALIB_IFN_CLI.
Parameters
...The source to select.

Definition at line 231 of file alib.hpp.

◆ ALIB_IF_CONFIGURATION

#define ALIB_IF_CONFIGURATION ( ...)    __VA_ARGS__

Prunes given code ... if ALib Configuration is not included in the ALib Distribution .

See also
Symbol ALIB_CONFIGURATION and sibling macro ALIB_IFN_CONFIGURATION.
Parameters
...The source to select.

Definition at line 239 of file alib.hpp.

◆ ALIB_IF_ENUMS

#define ALIB_IF_ENUMS ( ...)    __VA_ARGS__

Prunes given code ... if ALib Enums is not included in the ALib Distribution .

See also
Symbol ALIB_ENUMS and sibling macro ALIB_IFN_ENUMS.
Parameters
...The source to select.

Definition at line 247 of file alib.hpp.

◆ ALIB_IF_EXPRESSIONS

#define ALIB_IF_EXPRESSIONS ( ...)    __VA_ARGS__

Prunes given code ... if ALib Expressions is not included in the ALib Distribution .

See also
Symbol ALIB_EXPRESSIONS and sibling macro ALIB_IFN_EXPRESSIONS.
Parameters
...The source to select.

Definition at line 255 of file alib.hpp.

◆ ALIB_IF_FILES

#define ALIB_IF_FILES ( ...)    __VA_ARGS__

Prunes given code ... if ALib Files is not included in the ALib Distribution .

See also
Symbol ALIB_FILES and sibling macro ALIB_IFN_FILES.
Parameters
...The source to select.

Definition at line 263 of file alib.hpp.

◆ ALIB_IF_MONOMEM

#define ALIB_IF_MONOMEM ( ...)    __VA_ARGS__

Prunes given code ... if ALib Monomem is not included in the ALib Distribution .

See also
Symbol ALIB_MONOMEM and sibling macro ALIB_IFN_MONOMEM.
Parameters
...The source to select.

Definition at line 271 of file alib.hpp.

◆ ALIB_IF_SINGLETONS

#define ALIB_IF_SINGLETONS ( ...)    __VA_ARGS__

Prunes given code ... if ALib Singletons is not included in the ALib Distribution .

See also
Symbol ALIB_SINGLETONS and sibling macro ALIB_IFN_SINGLETONS.
Parameters
...The source to select.

Definition at line 279 of file alib.hpp.

◆ ALIB_IF_STRINGS

#define ALIB_IF_STRINGS ( ...)    __VA_ARGS__

Prunes given code ... if ALib Strings is not included in the ALib Distribution .

See also
Symbol ALIB_STRINGS and sibling macro ALIB_IFN_STRINGS.
Parameters
...The source to select.

Definition at line 287 of file alib.hpp.

◆ ALIB_IF_THREADS

#define ALIB_IF_THREADS ( ...)    __VA_ARGS__

Prunes given code ... if ALib Threads is not included in the ALib Distribution .

See also
Symbol ALIB_THREADS and sibling macro ALIB_IFN_THREADS.
Parameters
...The source to select.

Definition at line 303 of file alib.hpp.

◆ ALIB_IF_TIME

#define ALIB_IF_TIME ( ...)    __VA_ARGS__

Prunes given code ... if ALib Time is not included in the ALib Distribution .

See also
Symbol ALIB_TIME and sibling macro ALIB_IFN_TIME.
Parameters
...The source to select.

Definition at line 311 of file alib.hpp.

◆ ALIB_IFN_ALOX

#define ALIB_IFN_ALOX ( ...)

Prunes given code ... if ALox is not included in the ALib Distribution .

See also
Symbol ALIB_ALOX and sibling macro ALIB_IF_ALOX.
Parameters
...The source to select.

Definition at line 200 of file alib.hpp.

◆ ALIB_IFN_BITBUFFER

#define ALIB_IFN_BITBUFFER ( ...)

Prunes given code ... if ALib BitBuffer is not included in the ALib Distribution .

See also
Symbol ALIB_BITBUFFER and sibling macro ALIB_IF_BITBUFFER.
Parameters
...The source to select.

Definition at line 208 of file alib.hpp.

◆ ALIB_IFN_BOXING

#define ALIB_IFN_BOXING ( ...)

Prunes given code ... if ALib Boxing is not included in the ALib Distribution .

See also
Symbol ALIB_BOXING and sibling macro ALIB_IF_BOXING.
Parameters
...The source to select.

Definition at line 216 of file alib.hpp.

◆ ALIB_IFN_CAMP

#define ALIB_IFN_CAMP ( ...)

Prunes given code ... if ALib BaseCamp is not included in the ALib Distribution .

See also
Symbol ALIB_CAMP and sibling macro ALIB_IF_CAMP.
Parameters
...The source to select.

Definition at line 296 of file alib.hpp.

◆ ALIB_IFN_CHARACTERS

#define ALIB_IFN_CHARACTERS ( ...)

Prunes given code ... if ALib Characters is not included in the ALib Distribution .

See also
Symbol ALIB_CHARACTERS and sibling macro ALIB_IF_CHARACTERS.
Parameters
...The source to select.

Definition at line 224 of file alib.hpp.

◆ ALIB_IFN_CLI

#define ALIB_IFN_CLI ( ...)

Prunes given code ... if ALib CLI is not included in the ALib Distribution .

See also
Symbol ALIB_CLI and sibling macro ALIB_IF_CLI.
Parameters
...The source to select.

Definition at line 232 of file alib.hpp.

◆ ALIB_IFN_CONFIGURATION

#define ALIB_IFN_CONFIGURATION ( ...)

Prunes given code ... if ALib Configuration is not included in the ALib Distribution .

See also
Symbol ALIB_CONFIGURATION and sibling macro ALIB_IF_CONFIGURATION.
Parameters
...The source to select.

Definition at line 240 of file alib.hpp.

◆ ALIB_IFN_ENUMS

#define ALIB_IFN_ENUMS ( ...)

Prunes given code ... if ALib Enums is not included in the ALib Distribution .

See also
Symbol ALIB_ENUMS and sibling macro ALIB_IF_ENUMS.
Parameters
...The source to select.

Definition at line 248 of file alib.hpp.

◆ ALIB_IFN_EXPRESSIONS

#define ALIB_IFN_EXPRESSIONS ( ...)

Prunes given code ... if ALib Expressions is not included in the ALib Distribution .

See also
Symbol ALIB_EXPRESSIONS and sibling macro ALIB_IF_EXPRESSIONS.
Parameters
...The source to select.

Definition at line 256 of file alib.hpp.

◆ ALIB_IFN_FILES

#define ALIB_IFN_FILES ( ...)

Prunes given code ... if ALib Files is not included in the ALib Distribution .

See also
Symbol ALIB_FILES and sibling macro ALIB_IF_FILES.
Parameters
...The source to select.

Definition at line 264 of file alib.hpp.

◆ ALIB_IFN_MONOMEM

#define ALIB_IFN_MONOMEM ( ...)

Prunes given code ... if ALib Monomem is not included in the ALib Distribution .

See also
Symbol ALIB_MONOMEM and sibling macro ALIB_IF_MONOMEM.
Parameters
...The source to select.

Definition at line 272 of file alib.hpp.

◆ ALIB_IFN_SINGLETONS

#define ALIB_IFN_SINGLETONS ( ...)

Prunes given code ... if ALib Singletons is not included in the ALib Distribution .

See also
Symbol ALIB_SINGLETONS and sibling macro ALIB_IF_SINGLETONS.
Parameters
...The source to select.

Definition at line 280 of file alib.hpp.

◆ ALIB_IFN_STRINGS

#define ALIB_IFN_STRINGS ( ...)

Prunes given code ... if ALib Strings is not included in the ALib Distribution .

See also
Symbol ALIB_STRINGS and sibling macro ALIB_IF_STRINGS.
Parameters
...The source to select.

Definition at line 288 of file alib.hpp.

◆ ALIB_IFN_THREADS

#define ALIB_IFN_THREADS ( ...)

Prunes given code ... if ALib Threads is not included in the ALib Distribution .

See also
Symbol ALIB_THREADS and sibling macro ALIB_IF_THREADS.
Parameters
...The source to select.

Definition at line 304 of file alib.hpp.

◆ ALIB_IFN_TIME

#define ALIB_IFN_TIME ( ...)

Prunes given code ... if ALib Time is not included in the ALib Distribution .

See also
Symbol ALIB_TIME and sibling macro ALIB_IF_TIME.
Parameters
...The source to select.

Definition at line 312 of file alib.hpp.

◆ ALIB_LOCK

#define ALIB_LOCK   ALIB_OWN(*this)

Shortcut to macro ALIB_OWN, providing *this as the owner. Usually used with methods of types derived from classes ThreadLock or ThreadLockNR

Note
If module ALib Threads is not available in the ALib Distribution , this macro is still defined. In this case, namespace functionDbgCheckSingleThreaded is invoked. This allows to keep this macro in the source code when compiled against a single-threaded version of ALib and only the declaration/definition of the locks have to be enclosed by preprocessor #if/#endif statements which are testing for symbol ALIB_THREADS.

Definition at line 33 of file threadlocknr.hpp.

◆ ALIB_LOCK_WITH

#define ALIB_LOCK_WITH ( lock)    ALIB_OWN(lock)

Alias name for macro ALIB_OWN to have better readable code if parameter owner of macro ALIB_OWN is of type ThreadLock or ThreadLockNR .

Note
If module ALib Threads is not available in the ALib Distribution , this macro is still defined. In this case, parameter lock is ignored and namespace function DbgCheckSingleThreaded is invoked. This allows to keep this macro in the source code when compiled against a single-threaded version of ALib .
See also
See also the note in documentation of ALIB_LOCK.
Parameters
lockThe Ownable to acquire and release.

Definition at line 34 of file threadlocknr.hpp.

◆ ALIB_MESSAGE

#define ALIB_MESSAGE ( ...)    { alib::lang::DbgSimpleALibMsg( ALIB_CALLER_PRUNED, 2, __VA_ARGS__); }

Writes the given message.

Parameters
...The objects used to format the message string.

Definition at line 982 of file alib.hpp.

◆ ALIB_NO_RETURN

#define ALIB_NO_RETURN   [[ noreturn ]]

Used as alias to C++ attribute [[noreturn]]. Defined if the compiler has support for it, else empty.

Definition at line 553 of file alib.hpp.

◆ ALIB_NSTRINGIFY

#define ALIB_NSTRINGIFY ( a)

Makes as narrow string from a preprocessor macro parameter.

Parameters
aThe token to stringyfy.

Definition at line 803 of file alib.hpp.

◆ ALIB_OWN

#define ALIB_OWN ( ownable)    alib::Owner<decltype(ownable)> ALIB_IDENTIFIER(owner) (ownable ALIB_COMMA_DBG ALIB_CALLER_PRUNED);

This preprocessor macro defines an object Owner . The template type is deduced from parameter ownable using C++ keyword decltype.

By using this macro there is no need to "invent" an (otherwise unreferenced) identifier for that definition. (Note: this macro exists, because C++ does not support anonymous local instances.)
As a sample, without using this macros a piece of code code using class Owner could look like this:

 {
     Owner myOwner( myOwnable );

do stuff ... (this code never refers to "myOwner") }

With the use of this macro, the code changes to:

{
    ALIB_OWN( myOwnable ); // internally created identifier name, avoids confusion :-)

do stuff ... }

See also
Macros ALIB_LOCK and ALIB_LOCK_WITH are using this macro to lock types ThreadLockNR and ThreadLock .
Macro ALIB_DBG_PREVENT_RECURSIVE_METHOD_CALLS implements a mechanism to detect and assert recursive function calls.
Parameters
ownableThe Ownable to acquire and release.

Definition at line 109 of file owner.hpp.

◆ ALIB_REL

#define ALIB_REL ( ...)

As a counterpart to ALIB_DBG, this macro may be used for placing code that is only available in release compilations. The macro is provided for completeness only and should be used seldom and with care, as it generally implies more intense release code testing. As of Version 1810, ALib does not use this macro internally.

Definition at line 458 of file alib.hpp.

◆ ALIB_REL_DBG

#define ALIB_REL_DBG ( releaseCode,
... )   __VA_ARGS__

Similar to ALIB_DBG, but accepts a release version of the code as well. The release version is expected as first macro parameter. Note, that the release code must not contain a comma (',') while the debug code is allowed to. A comma in release code may be substituted with macro ALIB_COMMA. However, more complicated stuff should be placed in usual #if/#else/#endif statements.

Definition at line 459 of file alib.hpp.

◆ ALIB_RESOURCED

#define ALIB_RESOURCED ( T,
ResPool,
ResCategory,
ResName )
Value:
namespace alib::lang::resources { \
template<> struct T_Resourced<T> : public std::true_type \
{ \
static ResourcePool* Pool() { return ResPool; } \
static constexpr NString Category() { return ResCategory; } \
static constexpr NString Name() { return ResName; } \
};}
strings::TString< nchar > NString
Type alias in namespace alib.
lang::resources::T_Resourced< T > T_Resourced
Type alias in namespace alib.
lang::resources::ResourcePool ResourcePool
Type alias in namespace alib.
static constexpr ResourcePool * Pool()
static constexpr NString Category()
static constexpr NString Name()

Macro used to specialize type-traits struct T_Resourced for given type T .

Parameters
TThe type to specialize TMP struct T_Resourced for.
ResPoolExpression providing a pointer to the ResourcePool object.
ResCategoryExpression providing the resource category.
ResNameExpression providing the resource name.

Definition at line 634 of file resources.hpp.

◆ ALIB_RESOURCED_IN_MODULE

#define ALIB_RESOURCED_IN_MODULE ( T,
Camp,
ResName )    ALIB_RESOURCED( T, &Camp.GetResourcePool(), Camp.ResourceCategory, ResName )

Variant of macro ALIB_RESOURCED, which specializes type-traits struct T_Resourced for type T to use the resource-backend found in the given Camp , as well as its default ResourceCategory .

Availability
This macro is available only if ALIB_CAMP equals true.
Parameters
TThe type to specialize TMP struct T_Resourced for.
CampPointer to the Camp that provides the ResourcePool object.
ResNameExpression providing the resource name.

Definition at line 644 of file resources.hpp.

◆ ALIB_REVISION

#define ALIB_REVISION   1

The ALib revision number. The value of this macro is stored in namespace variable alib::Revision.

See also
Programmer's manual chapter 4.7 Assuring Compilation Compatibility.

Definition at line 24 of file alib.hpp.

◆ ALIB_SIZEOF_WCHAR_T

#define ALIB_SIZEOF_WCHAR_T   4

Compiler/platform dependent value. Gives the sizeof values of type wchar_t in bytes. Possible values are 2 and 4.

Definition at line 337 of file alib.hpp.

◆ ALIB_STATIC_ASSERT

#define ALIB_STATIC_ASSERT ( CondVariable,
Cond,
Message )
Value:
{ constexpr bool CondVariable= Cond; \
static_assert( CondVariable, Message ); } \

A simple macro that wraps language keyword static_assert. Common compilers display the condition expression that failed with the compilation error. The purpose of this macro is to hide this expression away. For this, the expression is assigned to a constexpr boolean value first and then assertion uses is only this variable as its expression.

The variable name is given with parameter CondVariable and should be speaking for itself, while the assertion text gives a longer explanation.

Definition at line 854 of file alib.hpp.

◆ ALIB_STATIC_DENY

#define ALIB_STATIC_DENY ( CondVariable,
Cond,
Message )
Value:
{ constexpr bool CondVariable= !(Cond); \
static_assert( CondVariable, Message ); } \

See macro ALIB_STATIC_ASSERT for a general explanation. The only difference from this is that the negation of the given expression is used. Hence the opposite of an assert, a "denial".

Definition at line 858 of file alib.hpp.

◆ ALIB_STRING_DBG_CHK

#define ALIB_STRING_DBG_CHK ( instance)
Value:
{ \
(instance)->dbgCheck(); \
}

Simple macro that just invokes method _dbgCheck(), which is defined for classes String , CString and AString . It is active only when compiler symbol ALIB_DEBUG_STRINGS is true. The macro is placed in almost every method.

Definition at line 20 of file strings/fwds.hpp.

◆ ALIB_STRING_RESETTER

#define ALIB_STRING_RESETTER ( astring)
Value:
std::remove_reference<decltype(astring)>::type::CharType> \
ALIB_IDENTIFIER(astring)(astring)
#define ALIB_IDENTIFIER(prefix)
Definition alib.hpp:815

Creates an 'anonymous' instance of class TStringLengthResetter . Its identifier name is assembled using macro ALIB_IDENTIFIER, hence from the given AString's identifier and the line number in the code.

Parameters
astringThe AString to reset to its original length when the C++ block scope where this macro is placed, is left.

Definition at line 2126 of file astring.hpp.

◆ ALIB_STRINGIFY

#define ALIB_STRINGIFY ( a)

Makes as string from a preprocessor macro parameter. The string character type equals the default character type character .

Parameters
aThe token to stringyfy.

Definition at line 804 of file alib.hpp.

◆ ALIB_STRINGS_APPENDABLE_TYPE

#define ALIB_STRINGS_APPENDABLE_TYPE ( TYPE)
Value:
namespace alib::strings { \
template<> struct T_Append<TYPE, alib::character> \
{ \
ALIB_API void operator()( TAString<alib::character>& target, const TYPE src ); \
}; } \
Definition alib.cpp:57
characters::character character
Type alias in namespace alib.
void operator()(TAString< TChar > &target, const TAppendable &src)

Helper macro for specializing functor T_Append for type TYPE . This macro has to be positioned outside of any namespace and the given type has to include its full namespace qualification.

This macro is to be used in combination with macro ALIB_STRINGS_APPENDABLE_TYPE_DEF.
As an alternative to the two macros, ALIB_STRINGS_APPENDABLE_TYPE_INLINE might be used, which will specialize T_Append and define its operator() inline.

See also
Chapter 5.1 Appending Custom Types of the Programmer's Manual of module ALib Strings .
Parameters
TYPEThe type to specialize functor T_Append for.

Definition at line 135 of file astring.hpp.

◆ ALIB_STRINGS_APPENDABLE_TYPE_DEF

#define ALIB_STRINGS_APPENDABLE_TYPE_DEF ( TYPE,
IMPL )
Value:
::operator()( TAString<alib::character>& target, const TYPE src) { IMPL } \

Macro used in combination with ALIB_STRINGS_APPENDABLE_TYPE which specializes functor T_Append for type TYPE and standard character type, and with this declares its member operator().
This macro is used for the implementation of this member function.

Parameters
TYPEThe type to specialize functor T_Append for.
IMPLThe implementation code for operator().

Definition at line 156 of file astring.hpp.

◆ ALIB_STRINGS_APPENDABLE_TYPE_DEF_N

#define ALIB_STRINGS_APPENDABLE_TYPE_DEF_N ( TYPE,
IMPL )
Value:
::operator()( TAString<alib::nchar>& target, const TYPE src) { IMPL } \

Same as ALIB_STRINGS_APPENDABLE_TYPE_DEF but for character type alib::nchar.

Parameters
TYPEThe type to specialize functor T_Append for.
IMPLThe implementation code for operator().

Definition at line 160 of file astring.hpp.

◆ ALIB_STRINGS_APPENDABLE_TYPE_DEF_W

#define ALIB_STRINGS_APPENDABLE_TYPE_DEF_W ( TYPE,
IMPL )
Value:
::operator()( TAString<alib::wchar>& target, const TYPE src) { IMPL } \

Same as ALIB_STRINGS_APPENDABLE_TYPE_DEF but for character type alib::wchar.

Parameters
TYPEThe type to specialize functor T_Append for.
IMPLThe implementation code for operator().

Definition at line 164 of file astring.hpp.

◆ ALIB_STRINGS_APPENDABLE_TYPE_INLINE

#define ALIB_STRINGS_APPENDABLE_TYPE_INLINE ( TYPE,
IMPL )
Value:
namespace alib::strings { \
template<> struct T_Append<TYPE,alib::character> \
{ \
void operator()( TAString<alib::character>& target, const TYPE& src ){ IMPL} \
}; } \

Helper macro for specializing functor T_Append for a custom type TYPE . This macro has to be positioned outside of any namespace and the given type has to include its full namespace qualification.

With the specialization of struct, T_Append<TYPE>::operator() will be defined and implemented inline.

Macros ALIB_STRINGS_APPENDABLE_TYPE and ALIB_STRINGS_APPENDABLE_TYPE_DEF provide a non-inline alternative to this macro.

See also
Chapter 5.1 Appending Custom Types of the Programmer's Manual of module ALib Strings .
Parameters
TYPEThe type to specialize functor T_Append for.
IMPLThe implementation code for operator().

Definition at line 169 of file astring.hpp.

◆ ALIB_STRINGS_APPENDABLE_TYPE_INLINE_N

#define ALIB_STRINGS_APPENDABLE_TYPE_INLINE_N ( TYPE,
IMPL )
Value:
namespace alib::strings { \
template<> struct T_Append<TYPE,alib::nchar> \
{ \
void operator()( TAString<alib::nchar>& target, const TYPE& src ){ IMPL} \
}; } \
characters::nchar nchar
Type alias in namespace alib.

Same as ALIB_STRINGS_APPENDABLE_TYPE_INLINE but for character type alib::nchar.

Parameters
TYPEThe type to specialize functor T_Append for.
IMPLThe implementation code for operator().

Definition at line 176 of file astring.hpp.

◆ ALIB_STRINGS_APPENDABLE_TYPE_INLINE_W

#define ALIB_STRINGS_APPENDABLE_TYPE_INLINE_W ( TYPE,
IMPL )
Value:
namespace alib::strings { \
template<> struct T_Append<TYPE,alib::wchar> \
{ \
void operator()( TAString<alib::wchar>& target, const TYPE& src ){ IMPL} \
}; } \
characters::wchar wchar
Type alias in namespace alib.

Same as ALIB_STRINGS_APPENDABLE_TYPE_INLINE but for character type alib::wchar.

Parameters
TYPEThe type to specialize functor T_Append for.
IMPLThe implementation code for operator().

Definition at line 183 of file astring.hpp.

◆ ALIB_STRINGS_APPENDABLE_TYPE_N

#define ALIB_STRINGS_APPENDABLE_TYPE_N ( TYPE)
Value:
namespace alib::strings { \
template<> struct T_Append<TYPE, alib::nchar> \
{ \
ALIB_API void operator()( TAString<alib::nchar>& target, const TYPE src ); \
}; } \

Same as ALIB_STRINGS_APPENDABLE_TYPE but for character type alib::nchar.

Parameters
TYPEThe type to specialize functor T_Append for.

Definition at line 142 of file astring.hpp.

◆ ALIB_STRINGS_APPENDABLE_TYPE_W

#define ALIB_STRINGS_APPENDABLE_TYPE_W ( TYPE)
Value:
namespace alib::strings { \
template<> struct T_Append<TYPE, alib::wchar> \
{ \
ALIB_API void operator()( TAString<alib::wchar>& target, const TYPE src ); \
}; } \

Same as ALIB_STRINGS_APPENDABLE_TYPE but for character type alib::wchar.

Parameters
TYPEThe type to specialize functor T_Append for.

Definition at line 149 of file astring.hpp.

◆ ALIB_STRINGS_FROM_NARROW

#define ALIB_STRINGS_FROM_NARROW ( src,
dest,
bufSize )   decltype(src)& dest(src);

Creates a new local string variable of standard character type. The name of the variable is defined by parameter dest . If code selection symbol ALIB_CHARACTERS_WIDE is false, then dest becomes just a reference to src . The macro in this case is defined as:

  decltype(src)& dest= src;

Otherwise, dest is of type LocalString<character,bufSize> and src is passed to its constructor.

Parameters
srcThe source string.
destThe name of the destination variable.
bufSizeThe local buffer size used for the conversion.

Definition at line 345 of file strings/fwds.hpp.

◆ ALIB_STRINGS_FROM_NARROW_ARG

#define ALIB_STRINGS_FROM_NARROW_ARG ( src,
bufSize )   src;

Used when ALib strings of narrow character size should be passed as a string argument of standard size. If code selection symbol ALIB_CHARACTERS_WIDE is false, then the macro simply passes (is defined as) src .
Otherwise, the macro wraps src in an object of type LocalString<character,bufSize> .

Parameters
srcThe source string.
bufSizeThe local buffer size used for the conversion.

Definition at line 346 of file strings/fwds.hpp.

◆ ALIB_STRINGS_FROM_WIDE

#define ALIB_STRINGS_FROM_WIDE ( src,
dest,
bufSize )   alib::strings::TLocalString<nchar,bufSize> dest(src);

Creates a new local string variable of standard character type. The name of the variable is defined by parameter dest . If code selection symbol ALIB_CHARACTERS_WIDE is true, then dest becomes just a reference to src . The macro in this case is defined as:

  decltype(src)& dest= src;

Otherwise, dest is of type LocalString<character,bufSize> and src is passed to its constructor.

Parameters
srcThe source string.
destThe name of the destination variable.
bufSizeThe local buffer size used for the conversion.

Definition at line 347 of file strings/fwds.hpp.

◆ ALIB_STRINGS_FROM_WIDE_ARG

#define ALIB_STRINGS_FROM_WIDE_ARG   src,bufSize ) alib::strings::TLocalString<nchar,bufSize>(src);

Used when ALib strings of wide character size should be passed as a string argument of standard size. If code selection symbol ALIB_CHARACTERS_WIDE is true, then the macro simply passes (is defined as) src .
Otherwise, the macro wraps src in an object of type LocalString<character,bufSize> .

Parameters
srcThe source string.
bufSizeThe local buffer size used for the conversion.

Definition at line 348 of file strings/fwds.hpp.

◆ ALIB_STRINGS_SUPPRESS_STD_OSTREAM_OPERATOR

#define ALIB_STRINGS_SUPPRESS_STD_OSTREAM_OPERATOR ( TYPE)
Value:
template<> struct T_SuppressStdOstreamOperator<TYPE> : ::std::true_type {}; }

Helper macro for specializing struct T_SuppressStdOstreamOperator for a custom type TYPE . This macro has to be positioned outside of any namespace and the given type has to include its full namespace qualification.

Parameters
TYPEThe type to specialize functor T_Append for.

Definition at line 55 of file std_strings_iostream.hpp.

◆ ALIB_STRINGS_TO_NARROW

#define ALIB_STRINGS_TO_NARROW ( src,
dest,
bufSize )   decltype(src)& dest(src);

Creates a new local string variable of narrow character type. The name of the variable is defined by parameter dest . If code selection symbol ALIB_CHARACTERS_WIDE is false, then dest becomes just a reference to src . The macro in this case is defined as:

  decltype(src)& dest= src;

Otherwise, dest is of type LocalString<nchar,bufSize> and src is passed to its constructor.

Parameters
srcThe source string.
destThe name of the destination variable.
bufSizeThe local buffer size used for the conversion.

Definition at line 341 of file strings/fwds.hpp.

◆ ALIB_STRINGS_TO_NARROW_ARG

#define ALIB_STRINGS_TO_NARROW_ARG ( src,
bufSize )   src;

Used when ALib strings of standard character size should be passed as a string argument of narrow size. If code selection symbol ALIB_CHARACTERS_WIDE is false, then the macro simply passes (is defined as) src .
Otherwise, the macro wraps src in an object of type LocalString<nchar,bufSize> .

Parameters
srcThe source string.
bufSizeThe local buffer size used for the conversion.

Definition at line 342 of file strings/fwds.hpp.

◆ ALIB_STRINGS_TO_WIDE

#define ALIB_STRINGS_TO_WIDE ( src,
dest,
bufSize )   alib::strings::TLocalString<wchar,bufSize> dest(src);

Creates a new local string variable of wide character type. The name of the variable is defined by parameter dest . If code selection symbol ALIB_CHARACTERS_WIDE is true, then dest becomes just a reference to src . The macro in this case is defined as:

  decltype(src)& dest= src;

Otherwise, dest is of type LocalString<nchar,bufSize> and src is passed to its constructor.

Parameters
srcThe source string.
destThe name of the destination variable.
bufSizeThe local buffer size used for the conversion.

Definition at line 343 of file strings/fwds.hpp.

◆ ALIB_STRINGS_TO_WIDE_ARG

#define ALIB_STRINGS_TO_WIDE_ARG ( src,
bufSize )   alib::strings::TLocalString<wchar,bufSize>(src);

Used when ALib strings of standard character size should be passed as a string argument of wide size. If code selection symbol ALIB_CHARACTERS_WIDE is true, then the macro simply passes (is defined as) src .
Otherwise, the macro wraps src in an object of type LocalString<nchar,bufSize> .

Parameters
srcThe source string.
bufSizeThe local buffer size used for the conversion.

Definition at line 344 of file strings/fwds.hpp.

◆ ALIB_VERSION

#define ALIB_VERSION   2402

The ALib version number. The value of this macro is stored in namespace variable alib::Version.

See also
Programmer's manual chapter 4.7 Assuring Compilation Compatibility.

Definition at line 23 of file alib.hpp.

◆ ALIB_WARNING

#define ALIB_WARNING ( ...)    { alib::lang::DbgSimpleALibMsg( ALIB_CALLER_PRUNED, 1, __VA_ARGS__); }

Writes the given message objects as an warning.

Parameters
...The objects used to format the message string.

Definition at line 981 of file alib.hpp.

◆ ALIB_WARNINGS_ALLOW_BITWISE_SWITCH

#define ALIB_WARNINGS_ALLOW_BITWISE_SWITCH
Value:
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wswitch\"") \
_Pragma("clang diagnostic ignored \"-Wcovered-switch-default\"") \

Preprocessor macro to disable compiler warnings when a "bitwise type scoped enumeration" (see T_EnumIsBitwise ) or similar types with 'sparse' case coverage are used in a switch statement.

Definition at line 674 of file alib.hpp.

◆ ALIB_WARNINGS_ALLOW_MACRO_REDEFINITION

#define ALIB_WARNINGS_ALLOW_MACRO_REDEFINITION
Value:
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wmacro-redefined\"") \

Preprocessor macro to disable compiler warnings on redefining macros without prior un-defining.

Definition at line 652 of file alib.hpp.

◆ ALIB_WARNINGS_ALLOW_NULL_POINTER_PASSING

#define ALIB_WARNINGS_ALLOW_NULL_POINTER_PASSING    _Pragma("clang diagnostic push") \

Preprocessor macro to disable GCC warning "nonnull". Used for example with template meta programming below C++ 14 standard.

Definition at line 641 of file alib.hpp.

◆ ALIB_WARNINGS_ALLOW_SHIFT_COUNT_OVERFLOW

#define ALIB_WARNINGS_ALLOW_SHIFT_COUNT_OVERFLOW
Value:
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wshift-count-overflow\"") \

Preprocessor macro to disable compiler warnings concerning overflows during bit-shift operations.

Definition at line 679 of file alib.hpp.

◆ ALIB_WARNINGS_ALLOW_SPARSE_ENUM_SWITCH

#define ALIB_WARNINGS_ALLOW_SPARSE_ENUM_SWITCH
Value:
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wswitch\"") \
_Pragma("clang diagnostic ignored \"-Wswitch-enum\"") \

Preprocessor macro to disable compiler warnings when an enumeration element is switched while not all enumeration elements get caught.

Definition at line 669 of file alib.hpp.

◆ ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE

#define ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE
Value:
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wunsafe-buffer-usage\"") \

Preprocessor macro to disable compiler warnings about potentially unsafe buffer usages. (i.e with clang this ignores "-Wunsafe-buffer-usage" )

Definition at line 644 of file alib.hpp.

◆ ALIB_WARNINGS_ALLOW_UNSAFE_FUNCTION_OR_VARIABLE

#define ALIB_WARNINGS_ALLOW_UNSAFE_FUNCTION_OR_VARIABLE
Value:
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wunused-macros\"") \

Preprocessor macro to disable compiler warnings for use of 'unsafe' (depricated) libary functions. Currently used with MSVC 4996 only.

Definition at line 656 of file alib.hpp.

◆ ALIB_WARNINGS_IGNORE_DOCS

#define ALIB_WARNINGS_IGNORE_DOCS
Value:
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wdocumentation\"") \

Preprocessor macro to disable compiler warnings according to source documentation (as of today known to be thrown by clang only).

Definition at line 702 of file alib.hpp.

◆ ALIB_WARNINGS_IGNORE_FUNCTION_TEMPLATE

#define ALIB_WARNINGS_IGNORE_FUNCTION_TEMPLATE
Value:
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wunused-template\"") \

Preprocessor macro to disable compiler warnings concerning unused function templates.

Definition at line 691 of file alib.hpp.

◆ ALIB_WARNINGS_IGNORE_INTEGER_OVERFLOW

#define ALIB_WARNINGS_IGNORE_INTEGER_OVERFLOW
Value:
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Winteger-overflow\"") \

Preprocessor macro to disable compiler warnings about code that may cause an overflow of an integral value, e.g. with bit-shift operations.

Definition at line 710 of file alib.hpp.

◆ ALIB_WARNINGS_IGNORE_INTEGRAL_CONSTANT_OVERFLOW

#define ALIB_WARNINGS_IGNORE_INTEGRAL_CONSTANT_OVERFLOW    _Pragma("clang diagnostic push") \

Preprocessor macro to disable compiler warnings about code that may cause an overflow of an integral constant.

Definition at line 699 of file alib.hpp.

◆ ALIB_WARNINGS_IGNORE_NOTHING_RETURNED

#define ALIB_WARNINGS_IGNORE_NOTHING_RETURNED
Value:
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wreturn-type\"") \

Preprocessor macro to disable compiler warnings concerning non-void functions that may not return a value. Needed when compiler can not properly detect the inherent safeness of a function that always is returning a type.

Definition at line 695 of file alib.hpp.

◆ ALIB_WARNINGS_IGNORE_RESERVED_IDENTIFIER

#define ALIB_WARNINGS_IGNORE_RESERVED_IDENTIFIER
Value:
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wreserved-identifier\"") \

Preprocessor macro to disable compiler warnings concerning conflicting identifier names. Usually identifiers with double underscore ('_') are forbidden, but with some preprocessor macros, those are not easily avoidable.

Definition at line 706 of file alib.hpp.

◆ ALIB_WARNINGS_IGNORE_UNUSED_MACRO

#define ALIB_WARNINGS_IGNORE_UNUSED_MACRO
Value:
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wunused-macros\"") \

Preprocessor macro to disable compiler warnings concerning unused macro definitions.

Definition at line 687 of file alib.hpp.

◆ ALIB_WARNINGS_IGNORE_UNUSED_PARAMETER

#define ALIB_WARNINGS_IGNORE_UNUSED_PARAMETER
Value:
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wunused-parameter\"") \

Preprocessor macro to disable compiler warnings concerning unused parameters.

Definition at line 683 of file alib.hpp.

◆ ALIB_WARNINGS_MACRO_NOT_USED_OFF

#define ALIB_WARNINGS_MACRO_NOT_USED_OFF
Value:
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wunused-macros\"") \

Preprocessor macro to disable compiler warnings about unused preprocessor macros.

Definition at line 661 of file alib.hpp.

◆ ALIB_WARNINGS_OVERLOAD_VIRTUAL_OFF

#define ALIB_WARNINGS_OVERLOAD_VIRTUAL_OFF
Value:
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Woverloaded-virtual\"") \

Preprocessor macro to disable compiler warnings about virtual methods that become hidden by overloaded methods with a different signature.

Definition at line 648 of file alib.hpp.

◆ ALIB_WARNINGS_RESERVED_MACRO_NAME_OFF

#define ALIB_WARNINGS_RESERVED_MACRO_NAME_OFF
Value:
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wreserved-macro-identifier\"") \

Preprocessor macro to disable compiler warnings about reserved macro names. (i.e with clang this ignores "-Wreserved-macro-identifier" )

Definition at line 665 of file alib.hpp.

◆ ALIB_WARNINGS_RESTORE

#define ALIB_WARNINGS_RESTORE    _Pragma("clang diagnostic pop") \

Resets compiler warning settings to the state before one of the other macros of this section had been placed. Every such placement should have a corresponding placement of this macro.

Definition at line 715 of file alib.hpp.

◆ ALIB_WARNINGS_UNINITIALIZED_OFF

#define ALIB_WARNINGS_UNINITIALIZED_OFF
Value:
_Pragma("clang diagnostic push") \
_Pragma("clang diagnostic ignored \"-Wuninitialized\"") \
_Pragma("clang diagnostic ignored \"-Wconditional-uninitialized\"") \

Preprocessor macro to disable compiler warnings about uninitialized values.

Definition at line 636 of file alib.hpp.

◆ ATMP_CHAR_COMPLEMENT

#define ATMP_CHAR_COMPLEMENT ( TChar)

Gives the complementary character type to the given type. This is specific to ALib character definitions. Converts

See also
For details, see TMP struct TT_ComplementChar as well as chapter 2. Character Types of the Programmer's Manual of module ALib Characters .
Parameters
TCharThe character type to convert to its complementary character.

Definition at line 17 of file prepro_macros.dox.

◆ ATMP_EQ

#define ATMP_EQ ( T,
TEqual )   std::is_same <T, TEqual>::value

Simple shortcut to std::is_same<T1,T2>::value. While it is not so much shorter, due to syntax highlighting of macros of modern editors, it is still better readable.

Parameters
TThe lhs type to compare.
TEqualThe rhs type to compare.

Definition at line 32 of file tmp.hpp.

◆ ATMP_IF_T_F

#define ATMP_IF_T_F ( Cond,
T,
F )   typename std::conditional<Cond,T,F>::type

Ternary conditional operator which selects type T if condition Cond is true and type F otherwise.

Parameters
CondThe condition.
TThe type select if Cond is true.
FThe type select if Cond is false.

Definition at line 54 of file tmp.hpp.

◆ ATMP_IS_ARR

#define ATMP_IS_ARR ( T)    std::is_array <T>::value

Simple shortcut to typename std::is_array<T>::value. While it is not so much shorter, due to syntax highlighting of macros of modern editors, it is still better readable.

Parameters
TThe type to convert to plain.

Definition at line 28 of file tmp.hpp.

◆ ATMP_IS_CONST

#define ATMP_IS_CONST ( T)    std::is_const <T>::value

Simple shortcut to typename std::is_const<T>::value. While it is not so much shorter, due to syntax highlighting of macros of modern editors, it is still better readable.

Parameters
TThe type to convert to plain.

Definition at line 25 of file tmp.hpp.

◆ ATMP_IS_ENUM

#define ATMP_IS_ENUM ( T)    std::is_enum <T>::value

Simple shortcut to typename std::is_pointer<T>::value. While it is not so much shorter, due to syntax highlighting of macros of modern editors, it is still better readable.

Parameters
TThe type to convert to plain.

Definition at line 26 of file tmp.hpp.

◆ ATMP_IS_INT

#define ATMP_IS_INT ( T)    std::is_integral<T>::value

Simple shortcut to typename std::is_integral<T>::value. While it is not so much shorter, due to syntax highlighting of macros of modern editors, it is still better readable.

Parameters
TThe type to convert to plain.

Definition at line 29 of file tmp.hpp.

◆ ATMP_IS_PTR

#define ATMP_IS_PTR ( T)    std::is_pointer <T>::value

Simple shortcut to typename std::is_pointer<T>::value. While it is not so much shorter, due to syntax highlighting of macros of modern editors, it is still better readable.

Parameters
TThe type to convert to plain.

Definition at line 27 of file tmp.hpp.

◆ ATMP_IS_SINT

#define ATMP_IS_SINT ( T)    (std::is_integral<T>::value && std::is_signed <T>::value)

Simple shortcut to (typename std::is_integral<T>::value && typename std::is_signed<T>::value). While it is not so much shorter, due to syntax highlighting of macros of modern editors, it is still better readable.

Parameters
TThe type to convert to plain.

Definition at line 31 of file tmp.hpp.

◆ ATMP_IS_UINT

#define ATMP_IS_UINT ( T)    (std::is_integral<T>::value && std::is_unsigned<T>::value)

Simple shortcut to (typename std::is_integral<T>::value && typename std::is_unsigned<T>::value). While it is not so much shorter, due to syntax highlighting of macros of modern editors, it is still better readable.

Parameters
TThe type to convert to plain.

Definition at line 30 of file tmp.hpp.

◆ ATMP_ISOF

#define ATMP_ISOF ( T,
TBase )   std::is_base_of <TBase, T >::value

Tests if type T is either the same or a derived type of TBase . (This is an alias to std::is_base_of<TBase, T >::value.)

Parameters
TThe type to test for being a TBase .
TBaseThe base type.
Returns
true if T is a (derived) TBase , false otherwise.

Definition at line 33 of file tmp.hpp.

◆ ATMP_RC

#define ATMP_RC ( T)    typename std::remove_const <T>::type

Simple shortcut to type modifier typename std::remove_const<T>::type. While it is not so much shorter, due to syntax highlighting of macros of modern editors, it is still better readable.

Parameters
TThe type to remove const from.

Definition at line 36 of file tmp.hpp.

◆ ATMP_RCV

#define ATMP_RCV ( T)    typename std::remove_cv <T>::type

Simple shortcut to type modifier typename std::remove_cv<T>::type. While it is not so much shorter, due to syntax highlighting of macros of modern editors, it is still better readable.

Parameters
TThe type to remove const and valatile modifiers from.

Definition at line 40 of file tmp.hpp.

◆ ATMP_RCVP

#define ATMP_RCVP ( T)
Value:
typename std::remove_cv < \
typename std::remove_pointer < \
typename std::remove_reference<T>::type>::type>::type

Simple shortcut to nested type modifiers std::remove_cv, std::remove_pointer and std::remove_reference.

Parameters
TThe type to convert to plain.

Definition at line 43 of file tmp.hpp.

◆ ATMP_RCVR

#define ATMP_RCVR ( T)
Value:
typename std::remove_cv < \
typename std::remove_reference<T>::type>::type

Simple shortcut to nested type modifiers remove_cv( remove_reference( T ) ).
Note, this is less strong than ATMP_RCVP as it leaves the pointer in the type.

Parameters
TThe type to convert to plain, leaving pointer.

Definition at line 41 of file tmp.hpp.

◆ ATMP_RE

#define ATMP_RE ( T)    typename std::remove_extent <T>::type

Simple shortcut to type modifier typename std::remove_extent<T>::type.

Parameters
TThe type to convert to plain.

Definition at line 39 of file tmp.hpp.

◆ ATMP_RECVP

#define ATMP_RECVP ( T)
Value:
typename std::remove_extent < \
typename std::remove_cv < \
typename std::remove_pointer < \
typename std::remove_reference<T>::type>::type>::type>::type

Simple shortcut to nested type modifiers that removes the extent of a type as well as pointer and CV qualifiers.

Parameters
TThe type to convert to plain.

Definition at line 46 of file tmp.hpp.

◆ ATMP_RETURN_IF_1TP

#define ATMP_RETURN_IF_1TP ( TReturn,
TParam,
... )
Value:
template <TParam> \
ALIB_FORCE_INLINE \
ATMP_T_IF( TReturn, (__VA_ARGS__)) \

Implements the template specification code of a class member method which has one template parameter TParam and is selected using std::enable_if to specify the return type TResult . If the condition given with the variadic argument, which needs to be a boolean expression is not met, the function is not offered for the currently compiled invocation.

The macro is to be placed at the start of the method declaration, replacing the otherwise necessary statement template< >.
In addition to the template statement, the macro adds macro ALIB_FORCE_INLINE. Therefore, no additional use of keyword inline must not made after the macro and the method's return type (or constructor name).

Parameters
TReturnThe return type of the method to declare.
TParamType and name of the template parameter of the method, for example "typename T".
...The condition for selecting the method.

Definition at line 76 of file tmp.hpp.

◆ ATMP_RETURN_IF_2TP

#define ATMP_RETURN_IF_2TP ( TReturn,
TParam1,
TParam2,
... )
Value:
template <TParam1, TParam2> \
ALIB_FORCE_INLINE \
ATMP_T_IF( TReturn, (__VA_ARGS__)) \

Same as ATMP_RETURN_IF_1TP but for class member methods with two template parameters.

Parameters
TReturnThe return type of the method to declare.
TParam1Type and name of the first template parameter of the method.
TParam2Type and name of the second template parameter of the method.
...The condition for selecting the method.

Definition at line 81 of file tmp.hpp.

◆ ATMP_RP

#define ATMP_RP ( T)    typename std::remove_pointer <T>::type

Simple shortcut to type modifier typename std::remove_pointer<T>::type.

Parameters
TThe type to convert to plain.

Definition at line 38 of file tmp.hpp.

◆ ATMP_RR

#define ATMP_RR ( T)    typename std::remove_reference<T>::type

Simple shortcut to type modifier typename std::remove_reference<T>::type.

Parameters
TThe type to convert to plain.

Definition at line 37 of file tmp.hpp.

◆ ATMP_SELECT_IF_1TP

#define ATMP_SELECT_IF_1TP ( TParam,
... )
Value:
template <TParam, typename std::enable_if<__VA_ARGS__ ,int>::type = 0 > \
#define ALIB_FORCE_INLINE
Definition alib.hpp:549

Implements the template specification code of a class member method which has one template parameter TParam and is selected using std::enable_if for one further template parameter. If the condition given with the variadic argument, which needs to be a boolean expression is not met, the function is not offered for the currently compiled invocation.

The macro is to be placed at the start of the method declaration, replacing the otherwise necessary statement template< >.
In addition to the template statement, the macro adds macro ALIB_FORCE_INLINE. Therefore, no additional use of keyword inline must be made after the macro and the method's return type (or constructor name).

Parameters
TParamType and name of the template parameter of the method, for example "typename T".
...The condition for selecting the method.

Definition at line 57 of file tmp.hpp.

◆ ATMP_SELECT_IF_2TP

#define ATMP_SELECT_IF_2TP ( TParam1,
TParam2,
... )
Value:
template <TParam1, TParam2, typename std::enable_if<__VA_ARGS__ ,int>::type = 0 > \

Same as ATMP_SELECT_IF_1TP but for class member methods with two template parameters (adding a third, anonymous one).

Parameters
TParam1Type and name (separated by a space) of the first template parameter of the method.
TParam2Type and name (separated by a space) of the second template parameter of the method.
...The condition for selecting the method.

Definition at line 61 of file tmp.hpp.

◆ ATMP_SELECT_IF_3TP

#define ATMP_SELECT_IF_3TP ( TParam1,
TParam2,
TParam3,
... )
Value:
template <TParam1, TParam2, TParam3, typename std::enable_if<__VA_ARGS__ ,int>::type = 0 > \

Same as ATMP_SELECT_IF_1TP but for methods with three template parameters (adding a fourth, anonymous one).

Parameters
TParam1Type and name (separated by a space) of the first template parameter of the method.
TParam2Type and name (separated by a space) of the second template parameter of the method.
TParam3Type and name (separated by a space) of the third template parameter of the method.
...The condition for selecting the method.

Definition at line 65 of file tmp.hpp.

◆ ATMP_SELECT_IF_4TP

#define ATMP_SELECT_IF_4TP ( TParam1,
TParam2,
TParam3,
TParam4,
... )
Value:
template <TParam1, TParam2, \
TParam3, TParam4, typename std::enable_if<__VA_ARGS__ ,int>::type = 0 > \

Same as ATMP_SELECT_IF_1TP but for methods with four template parameters (adding a fifth, anonymous one).

Parameters
TParam1Type and name (separated by a space) of the first template parameter of the method.
TParam2Type and name (separated by a space) of the second template parameter of the method.
TParam3Type and name (separated by a space) of the third template parameter of the method.
TParam4Type and name (separated by a space) of the fourth template parameter of the method.
...The condition for selecting the method.

Definition at line 69 of file tmp.hpp.

◆ ATMP_T_IF

#define ATMP_T_IF ( T,
Cond )   typename std::enable_if<Cond,T>::type

Shortcut to typename std::enable_if<T, Cond>::type.

Parameters
TThe type to result in, if Cond is true.
CondThe condition that enables T.

Definition at line 53 of file tmp.hpp.

◆ ATMP_VOID_IF

#define ATMP_VOID_IF ( Cond)    typename std::enable_if<Cond >::type

Shortcut to typename std::enable_if<Cond>::type

Parameters
CondThe condition that enables void.

Definition at line 52 of file tmp.hpp.

◆ bitsof

#define bitsof ( type)    static_cast<int>(sizeof(type) * 8)

Like C++ keyword sizeof but returns the number of bits of the type of the given value. The return type is int instead of size_t, which satisfies ALib code conventions.

Note
To improve code readability, namely to a) indicate that this is an inlined, constant expression and b) to indicate that this is just using keyword sizeof, as an exception from the naming rules, this function is spelled in lower case.
See also
Function alib::lang::bitsofval(const T&)

Definition at line 52 of file bits.hpp.

◆ CALCULUS_CALLBACK

#define CALCULUS_CALLBACK ( func)    func, ALIB_NSTRINGIFY(func)

Writes given callback function name func along with a comma (',') and a "stringified" version of the C++ function name.

In release compilations, the macro resolves just to func .

This macro is to be used to define records of types Calculus::FunctionEntry , Calculus::OperatorTableEntry and to provide parameters to function Calculus::AddOperator .

Parameters
funcThe name of the callback function.

Definition at line 34 of file calculus.hpp.

◆ CALCULUS_DEFAULT_AUTOCAST

#define CALCULUS_DEFAULT_AUTOCAST   nullptr, nullptr

This macro is to be used to define records of type Calculus::AutoCastEntry .

With debug builds, it provides nullptr for table entries AutoCastEntry::Callback and AutoCastEntry::DbgCallbackName . In release compilations the latter is omitted.

Definition at line 35 of file calculus.hpp.

◆ CALCULUS_SIGNATURE

#define CALCULUS_SIGNATURE ( BoxPointerArray)    BoxPointerArray, std::extent<decltype(BoxPointerArray)>::value

This macro is to be used to define records of type Calculus::FunctionEntry .

The macro resolves to two values separated by a comma (','). The first is a plain copy of given BoxPointerArray , which has to be a C++ array of pointers to type Box. The second value written will be the array's extent.

Parameters
BoxPointerArraynullptr for identifiers, otherwise the list of argument sample boxes provided as a Box**.

Definition at line 41 of file calculus.hpp.

◆ LOG_ACQUIRE

#define LOG_ACQUIRE   { alib::lox::Lox& _log= LOG_LOX; _log.Acquire( LOG_CI );

Macro that is placed at the beginning of almost all debug logging macros. Provides scope information (provided that ALOX_DBG_LOG_CI is set) to the lox and places the debug lox instance access code using LOG_LOX.

Definition at line 38 of file macros.inl.

◆ Log_AddDebugLogger

#define Log_AddDebugLogger ( )    Log_Prune( LOG_ACQUIRE alib::Log::AddDebugLogger ( &_log ); LOG_RELEASE )

Invokes Log::AddDebugLogger to create, add and configure a default debug logger suitable for the platform and toolset.

Parameters
...The parameters to pass.

Definition at line 55 of file macros.inl.

◆ Log_Assert

#define Log_Assert ( ...)    Log_Prune( LOG_ACQUIRE _log.Assert ( __VA_ARGS__ ); LOG_RELEASE )

Invokes Lox::Assert on the debug singleton of class Lox defined in macro LOG_LOX.

Parameters
...The parameters to pass.

Definition at line 71 of file macros.inl.

◆ LOG_CI

#define LOG_CI   ALIB_CALLER

Dependent on ALOX_DBG_LOG_CI, this macro provides comma delimited source information (sourcefile, line number, function name) or corresponding null values.

Definition at line 26 of file macros.inl.

◆ Log_ClearSourcePathTrimRules

#define Log_ClearSourcePathTrimRules ( ...)    Log_Prune( LOG_ACQUIRE _log.ClearSourcePathTrimRules( __VA_ARGS__ ); LOG_RELEASE )

Invokes Lox::ClearSourcePathTrimRules on the debug singleton of class Lox defined in macro LOG_LOX.

Parameters
...The parameters to pass.

Definition at line 54 of file macros.inl.

◆ Log_Entry

#define Log_Entry ( ...)    Log_Prune( LOG_ACQUIRE _log.Entry ( __VA_ARGS__ ); LOG_RELEASE )

Invokes Lox::Entry on the debug singleton of class Lox defined in macro LOG_LOX.

Parameters
...The parameters to pass.

Definition at line 74 of file macros.inl.

◆ Log_Error

#define Log_Error ( ...)    Log_Prune( LOG_ACQUIRE _log.Error ( __VA_ARGS__ ); LOG_RELEASE )

Invokes Lox::Error on the debug singleton of class Lox defined in macro LOG_LOX.

Parameters
...The parameters to pass.

Definition at line 70 of file macros.inl.

◆ Log_Exception

#define Log_Exception ( ...)    Log_Prune( alib::lox::LogTools::Exception( LOG_LOX, __VA_ARGS__ ); )

Invokes LogTools::Exception providing the debug singleton of class Lox defined in macro LOG_LOX.

Parameters
...The parameters to pass.

Definition at line 79 of file macros.inl.

◆ Log_GetLogger

#define Log_GetLogger ( identifier,
name )
Value:
LOG_ACQUIRE identifier= _log.GetLogger( name ); LOG_RELEASE )
#define LOG_RELEASE
Definition macros.inl:39
#define LOG_ACQUIRE
Definition macros.inl:38
#define Log_Prune(...)
Definition macros.inl:48

Invokes Lox::GetLogger on the debug singleton of class Lox defined in macro LOG_LOX.

Parameters
identifierThe identifier name of the variable that receives the pointer to the logger.
nameThe name of the logger to retrieve.

Definition at line 57 of file macros.inl.

◆ Log_If

#define Log_If ( ...)    Log_Prune( LOG_ACQUIRE _log.If ( __VA_ARGS__ ); LOG_RELEASE )

Invokes Lox::If on the debug singleton of class Lox defined in macro LOG_LOX.

Parameters
...The parameters to pass.

Definition at line 72 of file macros.inl.

◆ Log_Info

#define Log_Info ( ...)    Log_Prune( LOG_ACQUIRE _log.Info ( __VA_ARGS__ ); LOG_RELEASE )

Invokes Lox::Info on the debug singleton of class Lox defined in macro LOG_LOX.

Parameters
...The parameters to pass.

Definition at line 68 of file macros.inl.

◆ Log_IsActive

#define Log_IsActive ( result,
... )   Log_Prune( LOG_ACQUIRE result= _log.IsActive( __VA_ARGS__ ); LOG_RELEASE )

Invokes Lox::IsActive on the object of type Lox defined in macro LOG_LOX. The result value is assigned to given variable result

Parameters
resultThe name of a variable of type int that the return value of IsActive() is assigned to.
...The parameters to pass.

Definition at line 78 of file macros.inl.

◆ Log_LogState

#define Log_LogState ( ...)    Log_Prune( LOG_ACQUIRE _log.State ( __VA_ARGS__ ); LOG_RELEASE )

Invokes Lox::State on the debug singleton of class Lox defined in macro LOG_LOX.

Parameters
...The parameters to pass.

Definition at line 66 of file macros.inl.

◆ LOG_LOX

#define LOG_LOX   (*alib::lox::Log::Get())

The Lox instance used by all debug logging macros. This can be overwritten (prior or after including alox.hpp) to allow different instances of class Lox for debug logging within different source entities. However, other ways to structure log output and to separate log information into different streams exists in ALox and overwriting this macro is not recommended for standard use cases.

Note: The definition must provide a reference (not a pointer) to the Lox object.

Definition at line 19 of file macros.inl.

◆ Log_MapThreadName

#define Log_MapThreadName ( ...)    Log_Prune( LOG_ACQUIRE _log.MapThreadName( __VA_ARGS__ ); LOG_RELEASE )

Invokes Lox::MapThreadName on the debug singleton of class Lox defined in macro LOG_LOX.

Parameters
...The parameters to pass.

Definition at line 65 of file macros.inl.

◆ Log_Once

#define Log_Once ( ...)    Log_Prune( LOG_ACQUIRE _log.Once ( __VA_ARGS__ ); LOG_RELEASE )

Invokes Lox::Once on the debug singleton of class Lox defined in macro LOG_LOX.

Parameters
...The parameters to pass.

Definition at line 73 of file macros.inl.

◆ Log_Prune

#define Log_Prune ( ...)    __VA_ARGS__

This very simple macro is used for pruning debug Log Statements. While it is used as a building block of all other macros for debug logging, for code entities using ALox , it provides an easy way to prune code lines that get inserted purely to support logging, e.g. to create ALox loggers or to prepare more complex log output. (The alternative way is to enclose such code within #ifdef ALOX_DBG_LOG / #endif preprocessor lines.

Depends on ALOX_DBG_LOG. If this is set, the macro just copies the code provided, else it does not copy it, hence removes the code.

Definition at line 48 of file macros.inl.

◆ LOG_RELEASE

#define LOG_RELEASE   _log.Release(); }

Macro that is placed at the end of almost all debug logging macros. Releases the lox which was acquired when passing scope information (in macro LOG_ACQUIRE.).

Definition at line 39 of file macros.inl.

◆ Log_RemoveDebugLogger

#define Log_RemoveDebugLogger ( )    Log_Prune( LOG_ACQUIRE alib::Log::RemoveDebugLogger( &_log ); LOG_RELEASE )

Invokes Log::RemoveDebugLogger to remove and delete a debug logger created by Log::AddDebugLogger.

Parameters
...The parameters to pass.

Definition at line 56 of file macros.inl.

◆ Log_RemoveLogger

#define Log_RemoveLogger ( logger)    Log_Prune( LOG_ACQUIRE _log.RemoveLogger ( logger ); LOG_RELEASE )

Invokes Lox::RemoveLogger on the debug singleton of class Lox defined in macro LOG_LOX.

Parameters
loggerEither the name of or a pointer to the logger to remove.

Definition at line 59 of file macros.inl.

◆ Log_RemoveThreadDomain

#define Log_RemoveThreadDomain ( ...)    Log_Prune( LOG_ACQUIRE _log.RemoveThreadDomain( __VA_ARGS__ ); LOG_RELEASE )

Invokes Lox::RemoveThreadDomain on the debug singleton of class Lox defined in macro LOG_LOX.

Parameters
...The parameters to pass.

Definition at line 61 of file macros.inl.

◆ Log_Retrieve

#define Log_Retrieve ( data,
... )   Log_Prune( Box data; LOG_ACQUIRE data= _log.Retrieve( __VA_ARGS__ ); LOG_RELEASE )

Invokes Lox::Retrieve on the debug singleton of class Lox defined in macro LOG_LOX.

Parameters
dataThe identifier name of the Box object to take the retrieved data.
...The parameters to pass.

Definition at line 77 of file macros.inl.

◆ Log_SetDomain

#define Log_SetDomain ( ...)    Log_Prune( LOG_ACQUIRE _log.SetDomain ( __VA_ARGS__ ); LOG_RELEASE )

Invokes Lox::SetDomain on the debug singleton of class Lox defined in macro LOG_LOX.

Parameters
...The parameters to pass.

Definition at line 60 of file macros.inl.

◆ Log_SetDomainSubstitutionRule

#define Log_SetDomainSubstitutionRule ( ...)    Log_Prune( LOG_ACQUIRE _log.SetDomainSubstitutionRule( __VA_ARGS__); LOG_RELEASE )

Invokes Lox::SetDomainSubstitutionRule on the debug singleton of class Lox defined in macro LOG_LOX.

Parameters
...The parameters to pass.

Definition at line 62 of file macros.inl.

◆ Log_SetPrefix

#define Log_SetPrefix ( ...)    Log_Prune( LOG_ACQUIRE _log.SetPrefix ( __VA_ARGS__ ); LOG_RELEASE )

Invokes Lox::SetPrefix on the debug singleton of class Lox defined in macro LOG_LOX.

Parameters
...The parameters to pass.

Definition at line 75 of file macros.inl.

◆ Log_SetSourcePathTrimRule

#define Log_SetSourcePathTrimRule ( ...)    Log_Prune( LOG_ACQUIRE _log.SetSourcePathTrimRule( __VA_ARGS__ ); LOG_RELEASE )

Invokes Lox::SetSourcePathTrimRule on the debug singleton of class Lox defined in macro LOG_LOX.

Parameters
...The parameters to pass.

Definition at line 53 of file macros.inl.

◆ Log_SetStartTime

#define Log_SetStartTime ( ...)    Log_Prune( LOG_ACQUIRE _log.SetStartTime ( __VA_ARGS__ ); LOG_RELEASE )

Invokes Lox::SetStartTime on the debug singleton of class Lox defined in macro LOG_LOX.

Parameters
...The parameters to pass.

Definition at line 64 of file macros.inl.

◆ Log_SetVerbosity

#define Log_SetVerbosity ( ...)    Log_Prune( LOG_ACQUIRE _log.SetVerbosity ( __VA_ARGS__ ); LOG_RELEASE )

Invokes one of the overloaded methods Lox::SetVerbosity on the debug singleton of class Lox defined in macro LOG_LOX.

Parameters
...The parameters to pass.

Definition at line 63 of file macros.inl.

◆ Log_Store

#define Log_Store ( ...)    Log_Prune( LOG_ACQUIRE _log.Store ( __VA_ARGS__ ); LOG_RELEASE )

Invokes Lox::Store on the debug singleton of class Lox defined in macro LOG_LOX.

Parameters
...The parameters to pass.

Definition at line 76 of file macros.inl.

◆ Log_Verbose

#define Log_Verbose ( ...)    Log_Prune( LOG_ACQUIRE _log.Verbose ( __VA_ARGS__ ); LOG_RELEASE )

Invokes Lox::Verbose on the debug singleton of class Lox defined in macro LOG_LOX.

Parameters
...The parameters to pass.

Definition at line 67 of file macros.inl.

◆ Log_Warning

#define Log_Warning ( ...)    Log_Prune( LOG_ACQUIRE _log.Warning ( __VA_ARGS__ ); LOG_RELEASE )

Invokes Lox::Warning on the debug singleton of class Lox defined in macro LOG_LOX.

Parameters
...The parameters to pass.

Definition at line 69 of file macros.inl.

◆ LOX_ACQUIRE

#define LOX_ACQUIRE   { alib::lox::Lox& _lox= LOX_LOX; _lox.Acquire( LOX_CI );

Macro that is placed at the beginning of almost all release logging macros. Provides scope information (provided that ALOX_REL_LOG_CI is set) to the lox and places the release lox instance access code using LOX_LOX.

Definition at line 40 of file macros.inl.

◆ Lox_Assert

#define Lox_Assert ( ...)    Lox_Prune( LOX_ACQUIRE _lox.Assert ( __VA_ARGS__); LOX_RELEASE )

Invokes Lox::Assert on the object of type Lox defined in macro LOX_LOX.

Parameters
...The parameters to pass.

Definition at line 107 of file macros.inl.

◆ LOX_CI

#define LOX_CI   ALIB_CALLER

Dependent on ALOX_REL_LOG_CI, this macro provides comma delimited source information (sourcefile, line number, function name) or corresponding null values.

Definition at line 32 of file macros.inl.

◆ Lox_ClearSourcePathTrimRules

#define Lox_ClearSourcePathTrimRules ( ...)    Lox_Prune( LOX_ACQUIRE _lox.ClearSourcePathTrimRules( __VA_ARGS__ ); LOX_RELEASE )

Invokes Lox::ClearSourcePathTrimRules on the object of type Lox defined in macro LOX_LOX.

Parameters
...The parameters to pass.

Definition at line 93 of file macros.inl.

◆ Lox_Entry

#define Lox_Entry ( ...)    Lox_Prune( LOX_ACQUIRE _lox.Entry ( __VA_ARGS__ ); LOX_RELEASE )

Invokes Lox::Entry on the object of type Lox defined in macro LOX_LOX.

Parameters
...The parameters to pass.

Definition at line 110 of file macros.inl.

◆ Lox_Error

#define Lox_Error ( ...)    Lox_Prune( LOX_ACQUIRE _lox.Error ( __VA_ARGS__ ); LOX_RELEASE )

Invokes Lox::Error on the object of type Lox defined in macro LOX_LOX.

Parameters
...The parameters to pass.

Definition at line 106 of file macros.inl.

◆ Lox_Exception

#define Lox_Exception ( ...)    Lox_Prune( alib::lox::LogTools::Exception( LOX_LOX, __VA_ARGS__ ); )

Invokes LogTools::Exception providing the object of type Lox defined in macro LOX_LOX.

Parameters
...The parameters to pass.

Definition at line 115 of file macros.inl.

◆ Lox_GetLogger

#define Lox_GetLogger ( identifier,
name )   Lox_Prune( alib::lox::detail::Logger* identifier; LOX_ACQUIRE identifier= _lox.GetLogger ( name ); LOX_RELEASE )

Invokes Lox::GetLogger on the object of type Lox defined in macro LOX_LOX.

Parameters
identifierThe identifier name of the variable that receives the pointer to the logger.
nameThe name of the logger to retrieve.

Definition at line 94 of file macros.inl.

◆ Lox_If

#define Lox_If ( ...)    Lox_Prune( LOX_ACQUIRE _lox.If ( __VA_ARGS__); LOX_RELEASE )

Invokes Lox::If on the object of type Lox defined in macro LOX_LOX.

Parameters
...The parameters to pass.

Definition at line 108 of file macros.inl.

◆ Lox_Info

#define Lox_Info ( ...)    Lox_Prune( LOX_ACQUIRE _lox.Info ( __VA_ARGS__ ); LOX_RELEASE )

Invokes Lox::Info on the object of type Lox defined in macro LOX_LOX.

Parameters
...The parameters to pass.

Definition at line 104 of file macros.inl.

◆ Lox_IsActive

#define Lox_IsActive ( result,
... )   Lox_Prune( LOX_ACQUIRE result= _lox.IsActive( __VA_ARGS__ ); LOX_RELEASE )

Invokes Lox::IsActive on the object of type Lox defined in macro LOX_LOX. The result value is assigned to given variable result

Parameters
resultThe name of a variable of type int that the return value of IsActive() is assigned to.
...The parameters to pass.

Definition at line 114 of file macros.inl.

◆ Lox_LogState

#define Lox_LogState ( ...)    Lox_Prune( LOX_ACQUIRE _lox.State ( __VA_ARGS__ ); LOX_RELEASE )

Invokes Lox::State on the object of type Lox defined in macro LOX_LOX.

Parameters
...The parameters to pass.

Definition at line 102 of file macros.inl.

◆ LOX_LOX

#define LOX_LOX

The Lox instance used by all release logging macros. This has to be set (prior or after including alox.hpp) to provide access to a, dedicated instance of class Lox created for release logging within a software.
It is of-course allowed to use different instances within different source entities. However, other ways to structure log output and separate log streams exists in ALox and should be evaluated prior to introducing different instances of class Lox.

Note: The definition must provide a reference (not a pointer) to the Lox object.

Definition at line 19 of file prepro_macros.dox.

◆ Lox_MapThreadName

#define Lox_MapThreadName ( ...)    Lox_Prune( LOX_ACQUIRE _lox.MapThreadName( __VA_ARGS__ ); LOX_RELEASE )

Invokes Lox::MapThreadName on the object of type Lox defined in macro LOX_LOX.

Parameters
...The parameters to pass.

Definition at line 101 of file macros.inl.

◆ Lox_Once

#define Lox_Once ( ...)    Lox_Prune( LOX_ACQUIRE _lox.Once ( __VA_ARGS__ ); LOX_RELEASE )

Invokes Lox::Once on the object of type Lox defined in macro LOX_LOX.

Parameters
...The parameters to pass.

Definition at line 109 of file macros.inl.

◆ Lox_Prune

#define Lox_Prune ( ...)    __VA_ARGS__

This very simple macro is used for pruning release Log Statements in the moment release logging gets disabled (what in standard release scenarios is not done).

While it is used as a building block of all other macros for release logging, for code entities using ALox , it provides an easy way to prune code lines that get inserted purely to support logging, e.g. to create ALox loggers or to prepare more complex log output. (The alternative way is to enclose such code within #ifdef ALOX_REL_LOG / #endif preprocessor lines.

Depends on ALOX_REL_LOG. If this is set, the macro just copies the code provided, else it does not copy it, hence removes the code.

Parameters
...The code to prune.

Definition at line 87 of file macros.inl.

◆ LOX_RELEASE

#define LOX_RELEASE   _lox.Release(); }

Macro that is placed at the end of almost all release logging macros.. Releases the lox which was acquired when passing scope information (in macro LOG_ACQUIRE.).

Definition at line 41 of file macros.inl.

◆ Lox_RemoveLogger

#define Lox_RemoveLogger ( logger)    Lox_Prune( LOX_ACQUIRE _lox.RemoveLogger ( logger ); LOX_RELEASE )

Invokes Lox::RemoveLogger on the object of type Lox defined in macro LOX_LOX.

Parameters
loggerEither the name of or a pointer to the logger to remove.

Definition at line 95 of file macros.inl.

◆ Lox_RemoveThreadDomain

#define Lox_RemoveThreadDomain ( ...)    Lox_Prune( LOX_ACQUIRE _lox.RemoveThreadDomain( __VA_ARGS__ ); LOX_RELEASE )

Invokes Lox::RemoveThreadDomain on the object of type Lox defined in macro LOX_LOX.

Parameters
...The parameters to pass.

Definition at line 97 of file macros.inl.

◆ Lox_Retrieve

#define Lox_Retrieve ( data,
... )   Lox_Prune( LOX_ACQUIRE LogData* data= _lox.Retrieve( __VA_ARGS__ ); LOX_RELEASE )

Invokes Lox::Retrieve on the object of type Lox defined in macro LOX_LOX.

Parameters
dataThe identifier name of the Box object to take the retrieved data.
...The parameters to pass.

Definition at line 112 of file macros.inl.

◆ Lox_SetDomain

#define Lox_SetDomain ( ...)    Lox_Prune( LOX_ACQUIRE _lox.SetDomain (__VA_ARGS__); LOX_RELEASE )

Invokes Lox::SetDomain on the object of type Lox defined in macro LOX_LOX.

Attention
If ALOX_REL_LOG_CI is not set, which is the default for release logging, and when used with language-related Scopes, this method will log an internal warning and will not be effective in respect to Scope::Path, Scope::Filename, and Scope::Method. See ALib Module ALox - Programmer's Manual for detailed information.

If Scope Domains based on source-related scopes should be supported in release logging, the ALib Distribution as well as the software entity have to be compiled with compiler symbol ALOX_REL_LOG_CI. Note that one effect of setting this symbol is, that information on source code paths and file names, as well as method names make their way into the release executable. This may not be wanted.

Parameters
...The parameters to pass.

Definition at line 96 of file macros.inl.

◆ Lox_SetDomainSubstitutionRule

#define Lox_SetDomainSubstitutionRule ( ...)    Lox_Prune( LOX_ACQUIRE _lox.SetDomainSubstitutionRule( __VA_ARGS__ ); LOX_RELEASE )

Invokes Lox::SetDomainSubstitutionRule on the object of type Lox defined in macro LOX_LOX.

Parameters
...The parameters to pass.

Definition at line 98 of file macros.inl.

◆ Lox_SetPrefix

#define Lox_SetPrefix ( ...)    Lox_Prune( LOX_ACQUIRE _lox.SetPrefix ( __VA_ARGS__ ); LOX_RELEASE )

Invokes Lox::SetPrefix on the object of type Lox defined in macro LOX_LOX.

Parameters
...The parameters to pass.

Definition at line 113 of file macros.inl.

◆ Lox_SetSourcePathTrimRule

#define Lox_SetSourcePathTrimRule ( ...)    Lox_Prune( LOX_ACQUIRE _lox.SetSourcePathTrimRule( __VA_ARGS__ ); LOX_RELEASE )

Invokes Lox::SetSourcePathTrimRule on the object of type Lox defined in macro LOX_LOX.

Parameters
...The parameters to pass.

Definition at line 92 of file macros.inl.

◆ Lox_SetStartTime

#define Lox_SetStartTime ( ...)    Lox_Prune( LOX_ACQUIRE _lox.SetStartTime ( __VA_ARGS__ ); LOX_RELEASE )

Invokes Lox::SetStartTime on the object of type Lox defined in macro LOX_LOX.

Parameters
...The parameters to pass.

Definition at line 100 of file macros.inl.

◆ Lox_SetVerbosity

#define Lox_SetVerbosity ( ...)    Lox_Prune( LOX_ACQUIRE _lox.SetVerbosity ( __VA_ARGS__ ); LOX_RELEASE )

Invokes one of the overloaded methods Lox::SetVerbosity on the object of type Lox defined in macro LOX_LOX.

Parameters
...The parameters to pass.

Definition at line 99 of file macros.inl.

◆ Lox_Store

#define Lox_Store ( ...)    Lox_Prune( LOX_ACQUIRE _lox.Store ( __VA_ARGS__ ); LOX_RELEASE )

Invokes Lox::Store on the object of type Lox defined in macro LOX_LOX.

Attention
If ALOX_REL_LOG_CI is not set, which is the default for release logging statements, Log Data can not be used in conjunction with language-related Scopes.
If Log Data should be supported in release logging, the ALib Distribution as well as the software entity have to be compiled with compiler symbol ALOX_REL_LOG_CI. Note that one effect of setting this symbol is, that information on source code paths and file names, as well as method names make their way into the release executable. This may not be wanted.
In general, methods Lox::Store and Lox::Retrieve should exclusively be used for debug logging. See user manual for more information.
Parameters
...The parameters to pass.

Definition at line 111 of file macros.inl.

◆ Lox_Verbose

#define Lox_Verbose ( ...)    Lox_Prune( LOX_ACQUIRE _lox.Verbose ( __VA_ARGS__ ); LOX_RELEASE )

Invokes Lox::Verbose on the object of type Lox defined in macro LOX_LOX.

Parameters
...The parameters to pass.

Definition at line 103 of file macros.inl.

◆ Lox_Warning

#define Lox_Warning ( ...)    Lox_Prune( LOX_ACQUIRE _lox.Warning ( __VA_ARGS__ ); LOX_RELEASE )

Invokes Lox::Warning on the object of type Lox defined in macro LOX_LOX.

Parameters
...The parameters to pass.

Definition at line 105 of file macros.inl.