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 BaseCamp
Module Boxing
Module Characters
Module Config
Module Enums
Module Expressions
Module Strings
Module Threads
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 2412 |
#define | ALIB_REVISION 0 |
#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) |
#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_FUNC __FUNCTION__ |
#define | ALIB_CALLER {__FILE__,__LINE__,ALIB_CALLER_FUNC,::std::this_thread::get_id(),&typeid(*this)} |
#define | ALIB_CALLER_PRUNED ALIB_CALLER |
#define | ALIB_COMMA_CALLER_PRUNED , ALIB_CALLER |
#define | ALIB_CALLER_PRUNED_COMMA ALIB_CALLER , |
#define | ALIB_CALLER_NULLED ALIB_CALLER |
#define | ALIB_COMMA_CALLER_NULLED , ALIB_CALLER |
#define | ALIB_CALLER_NULLED_COMMA ALIB_CALLER , |
#define | ALIB_DBG_TAKE_CI const CallerInfo& ci |
#define | bitsof(type) |
#define | ALIB_STACK_ALLOCATED_TYPE(T) |
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. If class report is included in the selected ALib distribution, two things happen:
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(...) |
#define | ALIB_WARNING(...) |
#define | ALIB_MESSAGE(...) |
#define | ALIB_ASSERT(cond) |
#define | ALIB_ASSERT_ERROR(cond, ...) |
#define | ALIB_ASSERT_WARNING(cond, ...) |
#define | ALIB_ASSERT_MESSAGE(cond, ...) |
#define | ALIB_ASSERT_RESULT_EQUALS( func, value) |
#define | ALIB_ASSERT_RESULT_NOT_EQUALS( func, value) |
#define | ALIB_ASSERT_RESULT_GREATER_THAN(func, value) |
#define | ALIB_ASSERT_RESULT_LESS_THAN( func, value) |
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) |
#define | ATMP_IS_CONST(T) |
#define | ATMP_IS_PTR(T) |
#define | ATMP_IS_ARR(T) |
#define | ATMP_IS_INT(T) |
#define | ATMP_IS_UINT(T) |
#define | ATMP_IS_SINT(T) |
#define | ATMP_EQ( T, TEqual) |
#define | ATMP_ISOF( T, TBase) |
#define | ATMP_RC( T) |
#define | ATMP_RR( T) |
#define | ATMP_RP( T) |
#define | ATMP_RE( T) |
#define | ATMP_RCV( T) |
#define | ATMP_RCVR( T) |
#define | ATMP_RCVP( T) |
#define | ATMP_RECVP( T) |
#define | ATMP_VOID_IF(Cond) |
#define | ATMP_BOOL_IF(Cond) |
#define | ATMP_T_IF(T, Cond) |
#define | ATMP_IF_T_F( Cond, T, F) |
#define | ATMP_RESULT_TYPE(T, Method, ...) |
#define | ATMP_HAS_METHOD(T, Method, ...) |
#define | ATMP_IF(Cond) |
#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) |
#define | ALIB_OWN_RECURSIVE(ownable) |
#define | ALIB_OWN_SHARED( ownable) |
#define | ALIB_DBG_PREVENT_RECURSIVE_METHOD_CALLS |
#define | ALIB_DBG_PREVENT_RECURSIVE_METHOD_CALLS_MEMBER_DECL bool dbgRecursionDetectionFlag = false; |
Code Selection | |
The macros listed here include or prune code, dependent on different preprocessor symbols. They are mainly given to avoid | |
#define | ALIB_DBG(...) |
#define | ALIB_REL_DBG(releaseCode, ...) |
#define | ALIB_REL(...) |
#define | ALIB_CPP_23(...) |
#define | ALIB_CPP_BEFORE_23(...) |
#define | IF_ALIB_ALOX(...) |
#define | IFNOT_ALIB_ALOX(...) |
#define | IF_ALIB_BOXING(...) |
#define | IFNOT_ALIB_BOXING(...) |
#define | IF_ALIB_BITBUFFER(...) |
#define | IFNOT_ALIB_BITBUFFER(...) |
#define | IF_ALIB_CONFIGURATION(...) |
#define | IFNOT_ALIB_CONFIGURATION(...) |
#define | IF_ALIB_CONTAINERS(...) |
#define | IFNOT_ALIB_CONTAINERS(...) |
#define | IF_ALIB_CLI(...) |
#define | IFNOT_ALIB_CLI(...) |
#define | IF_ALIB_CAMP(...) |
#define | IFNOT_ALIB_CAMP(...) |
#define | IF_ALIB_ENUMS(...) |
#define | IFNOT_ALIB_ENUMS(...) |
#define | IF_ALIB_EXPRESSIONS(...) |
#define | IFNOT_ALIB_EXPRESSIONS(...) |
#define | IF_ALIB_FILES(...) |
#define | IFNOT_ALIB_FILES(...) |
#define | IF_ALIB_THREADMODEL(...) |
#define | IFNOT_ALIB_THREADMODEL(...) |
#define | IF_ALIB_THREADS(...) |
#define | IFNOT_ALIB_THREADS(...) |
#define | IF_ALIB_STRINGS(...) |
#define | IFNOT_ALIB_STRINGS(...) |
#define | IF_ALIB_MONOMEM(...) |
#define | IFNOT_ALIB_MONOMEM(...) |
#define | IF_ALIB_CHARACTERS(...) |
#define | IFNOT_ALIB_CHARACTERS(...) |
#define | IF_ALIB_TIME(...) |
#define | IFNOT_ALIB_TIME(...) |
#define | IF_ALIB_SINGLETONS(...) |
#define | IFNOT_ALIB_SINGLETONS(...) |
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.
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.
| |
#define | Log_Prune(...) |
#define | Log_SetSourcePathTrimRule(...) |
#define | Log_ClearSourcePathTrimRules(...) |
#define | Log_AddDebugLogger() |
#define | Log_RemoveDebugLogger() |
#define | Log_GetLogger(identifier, name) |
#define | Log_RemoveLogger(logger) |
#define | Log_SetDomain(...) |
#define | Log_RemoveThreadDomain(...) |
#define | Log_SetDomainSubstitutionRule(...) |
#define | Log_SetVerbosity(...) |
#define | Log_SetStartTime(...) |
#define | Log_MapThreadName(...) |
#define | Log_LogState(...) |
#define | Log_Verbose(...) |
#define | Log_Info(...) |
#define | Log_Warning(...) |
#define | Log_Error(...) |
#define | Log_Assert(...) |
#define | Log_If(...) |
#define | Log_Once(...) |
#define | Log_Entry(...) |
#define | Log_SetPrefix(...) |
#define | Log_Store(...) |
#define | Log_Retrieve(data, ...) |
#define | Log_IsActive(result, ...) |
#define | Log_Exception(...) |
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 Before 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_.
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(...) |
#define | Lox_SetSourcePathTrimRule(...) |
#define | Lox_ClearSourcePathTrimRules(...) |
#define | Lox_GetLogger(identifier, name) |
#define | Lox_RemoveLogger(logger) |
#define | Lox_SetDomain(...) |
#define | Lox_RemoveThreadDomain(...) |
#define | Lox_SetDomainSubstitutionRule(...) |
#define | Lox_SetVerbosity(...) |
#define | Lox_SetStartTime(...) |
#define | Lox_MapThreadName(...) |
#define | Lox_LogState(...) |
#define | Lox_Verbose(...) |
#define | Lox_Info(...) |
#define | Lox_Warning(...) |
#define | Lox_Error(...) |
#define | Lox_Assert(...) |
#define | Lox_If(...) |
#define | Lox_Once(...) |
#define | Lox_Entry(...) |
#define | Lox_Store(...) |
#define | Lox_Retrieve(data, ...) |
#define | Lox_SetPrefix(...) |
#define | Lox_IsActive(result, ...) |
#define | Lox_Exception(...) |
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 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_CHAR_TYPE_ID_N 1 |
#define | ALIB_CHAR_TYPE_ID_W 2 |
#define | ALIB_CHAR_TYPE_ID_X 3 |
#define | ALIB_CHAR_TYPE_ID_CHARACTER |
#define | ALIB_CHAR_TYPE_ID_COMPLEMENT |
#define | ALIB_CHAR_TYPE_ID_STRANGE |
#define | ALIB_CHARACTER_ARRAY( TString, TChar, Access, Construction) |
#define | ALIB_CHARACTER_ARRAY_MUTABLE( TString, TChar, Construction) |
#define | ALIB_CHARACTER_ZT_ARRAY( TString, TChar, Access, Construction) |
#define | ALIB_CHARACTER_ZT_ARRAY_MUTABLE(TString, TChar, Construction) |
#define | ALIB_CHARACTER_ARRAY_IMPL_BUFFER( TString, TChar, ...) |
#define | ALIB_CHARACTER_ZT_ARRAY_IMPL_BUFFER( TString, TChar, ...) |
#define | ALIB_CHARACTER_ARRAY_IMPL_BUFFER_MUTABLE( TString, TChar, ...) |
#define | ALIB_CHARACTER_ZT_ARRAY_IMPL_BUFFER_MUTABLE(TString, TChar, ...) |
#define | ALIB_CHARACTER_ARRAY_IMPL_LENGTH( TString, TChar, ...) |
#define | ALIB_CHARACTER_ZT_ARRAY_IMPL_LENGTH( TString, TChar, ...) |
#define | ALIB_CHARACTER_ARRAY_IMPL_LENGTH_MUTABLE( TString, TChar, ...) |
#define | ALIB_CHARACTER_ZT_ARRAY_IMPL_LENGTH_MUTABLE(TString, TChar, ...) |
#define | ALIB_CHARACTER_ARRAY_IMPL_CONSTRUCT( TString, TChar, ...) |
#define | ALIB_CHARACTER_ZT_ARRAY_IMPL_CONSTRUCT( TString, TChar, ...) |
ALib Module Config | |
The macros in this section are introduced by ALib Camp ALib Configuration. | |
#define | ALIB_CONFIG_VARIABLE_DEFINE_TYPE(Namespace, CPPName, CfgTypeString) |
#define | ALIB_CONFIG_VARIABLE_DEFINE_TYPE_WITH_POOL_CONSTRUCTOR(Namespace, CPPName, CfgTypeString) |
#define | ALIB_CONFIG_VARIABLE_REGISTER_TYPE(CPPName) |
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.
| |
#define | ALIB_ENUMS_UNDERLYING_TYPE(TEnum) |
#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) |
#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) |
#define | CALCULUS_DEFAULT_AUTOCAST nullptr, nullptr |
#define | CALCULUS_SIGNATURE(BoxPointerArray) |
ALib Module Threads | |
While macros in this section logically belong to module ALib Threads, they are available (but empty) also when this module is not included in the ALib Distribution. An explanation to this is given with chapter 1.2 Threading-Agnostic Software of this module's Programmer's Manual. Their definition depends on the setting of ALIB_DEBUG_CRITICAL_SECTIONS, which defaults to If the symbol is not set, all the symbols in this section are empty. | |
#define | ALIB_LOCK ALIB_OWN(*this) |
#define | ALIB_LOCK_WITH(lock) |
#define | ALIB_LOCK_RECURSIVE ALIB_OWN_RECURSIVE(*this) |
#define | ALIB_LOCK_RECURSIVE_WITH(lock) |
#define | ALIB_LOCK_SHARED ALIB_OWN_SHARED(*this) |
#define | ALIB_LOCK_SHARED_WITH(lock) |
#define | ALIB_DCS ALIB_OWN(*this) |
#define | ALIB_DCS_WITH(CS) |
#define | ALIB_DCS_SHARED ALIB_OWN_SHARED(*this) |
#define | ALIB_DCS_SHARED_WITH(CS) |
#define | ALIB_DCS_ACQUIRE Acquire(ALIB_CALLER); |
#define | ALIB_DCS_ACQUIRE_WITH(CS) |
#define | ALIB_DCS_ACQUIRE_SHARED AcquireShared(ALIB_CALLER); |
#define | ALIB_DCS_ACQUIRE_SHARED_WITH(CS) |
#define | ALIB_DCS_RELEASE Release(ALIB_CALLER); |
#define | ALIB_DCS_RELEASE_WITH(CS) |
#define | ALIB_DCS_RELEASE_SHARED ReleaseShared(ALIB_CALLER); |
#define | ALIB_DCS_RELEASE_SHARED_WITH(CS) |
ALib Module BaseCamp | |
The macros in this section are introduced by inner namespace alib::lang::resources of camp ALib BaseCamp. | |
#define | ALIB_RESOURCED(T, ResPool, ResCategory, ResName) |
#define | ALIB_RESOURCED_IN_MODULE(T, Camp, ResName) |
#define | A_PATH(literal) |
#define | ALIB_PATH_TO_NARROW( src, dest, bufSize) |
#define | ALIB_PATH_TO_NARROW_ARG( src, bufSize) |
#define | ALIB_PATH_TO_STRING( src, dest, bufSize) |
#define | ALIB_PATH_TO_STRING_ARG( src, bufSize) |
#define | ALIB_STRING_TO_PATH( src, dest, bufSize) |
#define | ALIB_STRING_TO_PATH_ARG( src, bufSize) |
#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.
STR | The character or string literal to eventually prefix with 'u' , 'U' or 'L' . |
Definition at line 13 of file prepro_macros.md.
#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 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 exception concerns such literals which are assigned to narrow string type NString, or those where explicit string types WString or XString are used.
STR | The character or string literal to be eventually prefix with 'L' , 'u' or 'U' . |
Definition at line 11 of file prepro_macros.md.
#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.
STR | The character or string literal that is returned as is. |
Definition at line 14 of file prepro_macros.md.
#define A_PATH | ( | literal | ) |
Macro used to define Path-string literals in a platform-independent way. Similar to macro A_CHAR, but dependent on the character type defined by the C++ standard library with type std::filesystem::path::value_type
.
This is usually single-byte characters, and only on Windows OS, prefix 'L'
is added.
literal | The string literal to be eventually prefix with 'L' . |
#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.
STR | The character or string literal to prefix with 'u' , 'U' or 'L' . |
Definition at line 12 of file prepro_macros.md.
#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.
STR | The character or string literal to prefix with 'u' , 'U' or 'L' . |
Definition at line 15 of file prepro_macros.md.
#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.
STR | The character or string literal to prefix with 'u' , 'U' or 'L' . |
Definition at line 16 of file prepro_macros.md.
#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.
#define ALIB_ASSERT | ( | cond | ) |
If given condition is false
, error message "Assertion Failed" is written.
cond | The condition assert. |
#define ALIB_ASSERT_ERROR | ( | cond, | |
... ) |
If given condition is false
, given message objects are written as an error.
cond | The condition assert. |
... | The objects used to format the message string. |
#define ALIB_ASSERT_GLOBAL_NAMESPACE |
If this macro is placed outside the global namespace, a static_assert
is raised at compile time.
#define ALIB_ASSERT_MESSAGE | ( | cond, | |
... ) |
If given condition is false
, given message objects are written as a message.
cond | The condition assert. |
... | The objects used to format the message string. |
#define ALIB_ASSERT_MODULE | ( | modulename | ) |
Asserts if a given module is included in the ALib Distribution.
modulename | The name of the module to assert as available. |
#define ALIB_ASSERT_RESULT_EQUALS | ( | func, | |
value ) |
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.
func | The function to invoke. |
value | The value to test for. |
#define ALIB_ASSERT_RESULT_GREATER_THAN | ( | func, | |
value ) |
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.
func | The function to invoke. |
value | The value to test for. |
#define ALIB_ASSERT_RESULT_LESS_THAN | ( | func, | |
value ) |
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.
func | The function to invoke. |
value | The value to test for. |
#define ALIB_ASSERT_RESULT_NOT_EQUALS | ( | func, | |
value ) |
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.
func | The function to invoke. |
value | The value to test for. |
#define ALIB_ASSERT_WARNING | ( | cond, | |
... ) |
If given condition is false
, given message objects are written as a warning.
cond | The condition assert. |
... | The objects used to format the message string. |
#define ALIB_BASE_DIR |
#define ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE | ( | TAppendable | ) |
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.
ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE( my_namespace::MyType* )
TAppendable | The appendable type. |
Definition at line 478 of file functions.inl.
#define ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE_N | ( | TAppendable | ) |
Same as macro ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE but implements interface FAppend<nchar> instead of FAppend<character>.
TAppendable | The appendable type. |
Definition at line 482 of file functions.inl.
#define ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE_W | ( | TAppendable | ) |
Same as macro ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE but implements interface FAppend<wchar> instead of FAppend<character>.
TAppendable | The appendable type. |
Definition at line 486 of file functions.inl.
#define ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE_X | ( | TAppendable | ) |
Same as macro ALIB_BOXING_BOOTSTRAP_REGISTER_FAPPEND_FOR_APPENDABLE_TYPE but implements interface FAppend<xchar> instead of FAppend<character>.
TAppendable | The appendable type. |
Definition at line 490 of file functions.inl.
#define ALIB_BOXING_BOOTSTRAP_VTABLE_DBG_REGISTER | ( | Identifier | ) |
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 the software. In debug-compilations, this macro is empty.
Identifier | The identifier name of the vtable singleton. |
Definition at line 489 of file vtable.inl.
#define ALIB_BOXING_CUSTOMIZE | ( | TSource, | |
TTarget, | |||
... ) |
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<TTarget>. 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
Two further macros exist:
Details for the use of those are given in manual chapter 12.3 Optimizations With "constexpr"-Boxing.
TSource | The C++ 'source' type to specialize struct T_Boxer for. |
TTarget | The target type to map TSource to. |
... | Definition of static inline methods T_Boxer::Write and T_Boxer::Read. |
Definition at line 510 of file typetraits.inl.
#define ALIB_BOXING_CUSTOMIZE_ARRAY_TYPE | ( | TSource, | |
TElement, | |||
... ) |
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<TTarget>. The implementations of methods T_Boxer::Write and T_Boxer::Read are to be provided with the variadic macro arguments.
TSource | The C++ 'source' type to specialize struct T_Boxer for. |
TElement | The element type of the array to map TSource to. |
... | Definition of static inline methods T_Boxer::Write and T_Boxer::Read. |
Definition at line 518 of file typetraits.inl.
#define ALIB_BOXING_CUSTOMIZE_ARRAY_TYPE_NON_UNBOXABLE | ( | TSource, | |
TElement, | |||
... ) |
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<TTarget>.
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.
TSource | The C++ 'source' type to specialize struct T_Boxer for. |
TElement | The element type of the array to map TSource to. |
... | Definition of static inline method T_Boxer::Write. |
Definition at line 560 of file typetraits.inl.
#define ALIB_BOXING_CUSTOMIZE_DENY_BOXING | ( | TSource | ) |
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<TNotBoxable> 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.
TSource | The type that should be denied to be used with ALib Boxing. |
Definition at line 569 of file typetraits.inl.
#define ALIB_BOXING_CUSTOMIZE_NOT_UNBOXABLE | ( | TSource, | |
TTarget ) |
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:
void
. No implementation is given (as not needed).TSource | The C++ 'source' type to specialize struct T_Boxer for. |
TTarget | The target type to map TSource to. |
Definition at line 543 of file typetraits.inl.
#define ALIB_BOXING_CUSTOMIZE_NOT_UNBOXABLE_CONSTEXPR | ( | TSource, | |
TTarget ) |
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.
TSource | The C++ 'source' type to specialize struct T_Boxer for. |
TTarget | The target type to map TSource to. |
Definition at line 551 of file typetraits.inl.
#define ALIB_BOXING_CUSTOMIZE_TYPE_MAPPING | ( | TSource, | |
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:
TSource | The C++ 'source' type to specialize struct T_Boxer for. |
TTarget | The target type to map TSource to. |
Definition at line 526 of file typetraits.inl.
#define ALIB_BOXING_CUSTOMIZE_TYPE_MAPPING_CONSTEXPR | ( | TSource, | |
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.
TSource | The C++ 'source' type to specialize struct T_Boxer for. |
TTarget | The target type to map TSource to. |
Definition at line 534 of file typetraits.inl.
#define ALIB_BOXING_DEFINE_FEQUALS_FOR_COMPARABLE_TYPE | ( | TComparable | ) |
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.
TComparable | The comparable type name. |
Definition at line 164 of file functions.inl.
#define ALIB_BOXING_DEFINE_FISLESS_FOR_COMPARABLE_TYPE | ( | 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.
TComparable | The comparable type name. |
Definition at line 278 of file functions.inl.
#define ALIB_BOXING_VTABLE_DECLARE | ( | TMapped, | |
Identifier ) |
Declares an extern
object of type VTable named TMapped in namespace alib::boxing::detail.
Furthermore specializes template struct detail::T_VTableFactory for type TMappedTo<TMapped> 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 accesses boxes of type TMapped.
TMapped | The mapped type to declare a vtable singleton for. |
Identifier | The identifier name of the vtable singleton. |
Definition at line 460 of file vtable.inl.
#define ALIB_BOXING_VTABLE_DECLARE_ARRAYTYPE | ( | TMapped, | |
Identifier ) |
Same as ALIB_BOXING_VTABLE_DECLARE, but used with mapped array types. Specializes detail::T_VTableFactory for type TMappedToArrayOf<TMapped>, instead of TMappedTo,
TMapped | The mapped type to declare a vtable singleton for. |
Identifier | The identifier name of the vtable singleton. |
Definition at line 466 of file vtable.inl.
#define ALIB_BOXING_VTABLE_DEFINE | ( | TMapped, | |
Identifier ) |
Defines the external object declared with ALIB_BOXING_VTABLE_DECLARE.
This macro has to be placed in a compilation unit.
TMapped | The mapped type to define a vtable singleton for. |
Identifier | The identifier name of the vtable singleton. |
Definition at line 473 of file vtable.inl.
#define ALIB_BOXING_VTABLE_DEFINE_ARRAYTYPE | ( | TMapped, | |
Identifier ) |
Defines the external object declared with ALIB_BOXING_VTABLE_DECLARE_ARRAYTYPE.
This macro has to be placed in a compilation unit.
TMapped | The mapped type to define a vtable singleton for. |
Identifier | The identifier name of the vtable singleton. |
Definition at line 483 of file vtable.inl.
#define ALIB_CALLER {__FILE__,__LINE__,ALIB_CALLER_FUNC,::std::this_thread::get_id(),&typeid(*this)} |
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)
#define ALIB_CALLER_FUNC __FUNCTION__ |
Used by macro ALIB_CALLER to retrieve the compiler-specific preprocessor variable of the current function name. With MSVC evaluates to __FUNCTION__, with other compilers to __func__.
#define ALIB_CALLER_NULLED ALIB_CALLER |
In debug-builds this macro is the same as ALIB_CALLER. Otherwise evaluates to {nullptr,0,nullptr,::std::thread::id(), 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.
#define ALIB_CALLER_NULLED_COMMA ALIB_CALLER , |
Same as ALIB_CALLER_NULLED, but adds a ','
This is needed if the caller information is followed by (non-debug) arguments in a call. The latter is usually avoided but necessary when default values for the next argument should be given.
#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.
#define ALIB_CALLER_PRUNED_COMMA ALIB_CALLER , |
Same as ALIB_CALLER_PRUNED, but adds a ','
This is needed if the caller information is followed by (non-debug) arguments in a call. The latter is usually avoided but necessary when default values for the next argument should be given.
#define ALIB_CHAR_TYPE_ID_CHARACTER |
Defined as ALIB_CHAR_TYPE_ID_N or ALIB_CHAR_TYPE_ID_W
, depending symbol ALIB_CHARACTERS_WIDE.
Definition at line 156 of file chartraits.hpp.
#define ALIB_CHAR_TYPE_ID_COMPLEMENT |
Defined as ALIB_CHAR_TYPE_ID_N or ALIB_CHAR_TYPE_ID_W
, depending symbol ALIB_CHARACTERS_WIDE.
Definition at line 157 of file chartraits.hpp.
#define ALIB_CHAR_TYPE_ID_N 1 |
Defined as 1
. Used in situations where code is to be selected by the preprocessor. The rationale here is, that the preprocessor can only choose code depending on integral values and not on string contents.
Definition at line 184 of file chartraits.hpp.
#define ALIB_CHAR_TYPE_ID_STRANGE |
#define ALIB_CHAR_TYPE_ID_W 2 |
Defined as 2
. Used in situations where code is to be selected by the preprocessor. The rationale here is, that the preprocessor can only choose code depending on integral values and not on string contents.
Definition at line 185 of file chartraits.hpp.
#define ALIB_CHAR_TYPE_ID_X 3 |
Defined as 3
. Used in situations where code is to be selected by the preprocessor. The rationale here is, that the preprocessor can only choose code depending on integral values and not on string contents.
Definition at line 186 of file chartraits.hpp.
#define ALIB_CHARACTER_ARRAY | ( | TString, | |
TChar, | |||
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.
TString | The type to provide array type traits for. |
TChar | The character type of character arrays that TString represents or might be created of. |
Access | One 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. |
Construction | One of the values NONE, Implicit or ExplicitOnly. |
Definition at line 454 of file chartraits.hpp.
#define ALIB_CHARACTER_ARRAY_IMPL_BUFFER | ( | TString, | |
TChar, | |||
... ) |
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.
TString | The type to provide the specialized static method for. |
TChar | The 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 468 of file chartraits.hpp.
#define ALIB_CHARACTER_ARRAY_IMPL_BUFFER_MUTABLE | ( | TString, | |
TChar, | |||
... ) |
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.
TString | The type to provide the specialized static method for. |
TChar | The 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 474 of file chartraits.hpp.
#define ALIB_CHARACTER_ARRAY_IMPL_CONSTRUCT | ( | TString, | |
TChar, | |||
... ) |
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.
TString | The type to provide the specialized static method for. |
TChar | The 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 480 of file chartraits.hpp.
#define ALIB_CHARACTER_ARRAY_IMPL_LENGTH | ( | TString, | |
TChar, | |||
... ) |
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.
TString | The type to provide the specialized static method for. |
TChar | The 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 471 of file chartraits.hpp.
#define ALIB_CHARACTER_ARRAY_IMPL_LENGTH_MUTABLE | ( | TString, | |
TChar, | |||
... ) |
Alternative macro version of ALIB_CHARACTER_ARRAY_IMPL_LENGTH, which declares method argument src as a mutual reference of type TString.
TString | The type to provide the specialized static method for. |
TChar | The 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 477 of file chartraits.hpp.
#define ALIB_CHARACTER_ARRAY_MUTABLE | ( | TString, | |
TChar, | |||
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.
TString | The type to provide array type traits for. |
TChar | The character type of character arrays that TString represents or might be created of. |
Construction | One of the values NONE, Implicit or ExplicitOnly. |
Definition at line 457 of file chartraits.hpp.
#define ALIB_CHARACTER_ZT_ARRAY | ( | TString, | |
TChar, | |||
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.
TString | The type to provide array type traits for. |
TChar | The character type of character arrays that TString represents or might be created of. |
Access | One 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. |
Construction | One of the values NONE, Implicit or ExplicitOnly. |
Definition at line 460 of file chartraits.hpp.
#define ALIB_CHARACTER_ZT_ARRAY_IMPL_BUFFER | ( | TString, | |
TChar, | |||
... ) |
Same as ALIB_CHARACTER_ARRAY_IMPL_BUFFER, but for zero-terminated character arrays.
(Implements method T_ZTCharArray::Buffer instead of T_CharArray::Buffer.)
TString | The type to provide the specialized static method for. |
TChar | The 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 483 of file chartraits.hpp.
#define ALIB_CHARACTER_ZT_ARRAY_IMPL_BUFFER_MUTABLE | ( | TString, | |
TChar, | |||
... ) |
Same as ALIB_CHARACTER_ARRAY_IMPL_BUFFER_MUTABLE, but for zero-terminated character arrays.
(Implements method T_ZTCharArray::Buffer instead of T_CharArray::Buffer.)
TString | The type to provide the specialized static method for. |
TChar | The 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 489 of file chartraits.hpp.
#define ALIB_CHARACTER_ZT_ARRAY_IMPL_CONSTRUCT | ( | TString, | |
TChar, | |||
... ) |
Same as ALIB_CHARACTER_ARRAY_IMPL_CONSTRUCT, but for zero-terminated character arrays.
(Implements method T_ZTCharArray::Construct instead of T_CharArray::Construct.)
TString | The type to provide the specialized static method for. |
TChar | The 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 495 of file chartraits.hpp.
#define ALIB_CHARACTER_ZT_ARRAY_IMPL_LENGTH | ( | TString, | |
TChar, | |||
... ) |
Same as ALIB_CHARACTER_ARRAY_IMPL_LENGTH, but for zero-terminated character arrays.
(Implements method T_ZTCharArray::Length instead of T_CharArray::Length.)
TString | The type to provide the specialized static method for. |
TChar | The 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 486 of file chartraits.hpp.
#define ALIB_CHARACTER_ZT_ARRAY_IMPL_LENGTH_MUTABLE | ( | TString, | |
TChar, | |||
... ) |
Same as ALIB_CHARACTER_ARRAY_IMPL_LENGTH_MUTABLE, but for zero-terminated character arrays.
(Implements method T_ZTCharArray::Length instead of T_CharArray::Length.)
TString | The type to provide the specialized static method for. |
TChar | The 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 492 of file chartraits.hpp.
#define ALIB_CHARACTER_ZT_ARRAY_MUTABLE | ( | TString, | |
TChar, | |||
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.
TString | The type to provide array type traits for. |
TChar | The character type of character arrays that TString represents or might be created of. |
Construction | One of the values NONE, Implicit or ExplicitOnly. |
Definition at line 463 of file chartraits.hpp.
#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> )
#define ALIB_COMMA_CALLER_NULLED , ALIB_CALLER |
Same as ALIB_CALLER_NULLED, but prepends a ','
This is needed if the caller information is not the only, but the last argument in a call.
#define ALIB_COMMA_CALLER_PRUNED , ALIB_CALLER |
Same as ALIB_CALLER_PRUNED, but prepends a ','
This is needed if the caller information is not the only, but the last argument in a call.
#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.
#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::COMPILATION_FLAGS.
Definition at line 8 of file prepro_macros.md.
#define ALIB_CONCAT | ( | a, | |
b ) |
#define ALIB_CONFIG_VARIABLE_DEFINE_TYPE | ( | Namespace, | |
CPPName, | |||
CfgTypeString ) |
Defines a struct named alib::config::detail::VMeta_<<CPPName>>
, which is derived from struct VMeta and which declares all abstract virtual methods and implements most of them already. The methods are:
Method | Status |
---|---|
typeName | defined |
dbgTypeID | defined (in debug-compilations only) |
construct | defined |
destruct | defined |
size | defined |
imPort | declared only |
exPort | declared only |
This is the first step on the way to create an ALib configuration variable of custom storage type.
Namespace | The namespace of the type to enable as an ALib variable. |
CPPName | The name of the type to enable as an ALib variable. |
CfgTypeString | The type string used to declare variables of this type. |
#define ALIB_CONFIG_VARIABLE_DEFINE_TYPE_WITH_POOL_CONSTRUCTOR | ( | Namespace, | |
CPPName, | |||
CfgTypeString ) |
Same as ALIB_CONFIG_VARIABLE_DEFINE_TYPE with the only difference that virtual override VMeta::construct passes the pool allocator of the configuration instance to the constructor of the custom type.
Namespace | The namespace of the type to enable as an ALib variable. |
CPPName | The name of the type to enable as an ALib variable. |
CfgTypeString | The type string used to declare variables of this type. |
#define ALIB_CONFIG_VARIABLE_REGISTER_TYPE | ( | CPPName | ) |
Registers a custom implementation of abstract class VMeta, which has been previously defined with macro ALIB_CONFIG_VARIABLE_DEFINE_TYPE with the configuration object received by a call to GetConfig()
. This macro is to be placed in Camp::bootstrap in the section of phase PrepareConfig. The macro invokes method Configuration::RegisterType, which has to be called 'manually' if for some reason the placement of registration can't be done as proposed.
CPPName | The name of the type to enable as an ALib variable (excluding the namespace). |
#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 the lower standard, the code given is pruned.
... | The source to select. |
#define ALIB_CPP_BEFORE_23 | ( | ... | ) |
This simple macro may be used for placing code that is only applicable to the C++ language standard 20
or below. With the higher standard, the code given is pruned.
... | The source to select. |
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).
#define ALIB_DBG | ( | ... | ) |
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.
... | Source code to prune in release-builds. |
#define ALIB_DBG_PREVENT_RECURSIVE_METHOD_CALLS |
This macro may be placed at the beginning of a types' method to detect and assert recursive invocations - which by definition must happen.
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 ensure that none of the methods calls any of the others.
A prerequisite of using this 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 alib/lang/owner.hpp.
#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.
#define ALIB_DBG_TAKE_CI const CallerInfo& ci |
Used with method declarations to define parameter ci of type CallerInfo.
#define ALIB_DCS ALIB_OWN(*this) |
Alias of macro ALIB_OWN, providing *this
as the owner. Commonly used with types derived from classes DbgCriticalSections.
Definition at line 44 of file dbgcriticalsections.hpp.
#define ALIB_DCS_ACQUIRE Acquire(ALIB_CALLER); |
Calls DbgCriticalSections::Acquire (on this
).
Definition at line 48 of file dbgcriticalsections.hpp.
#define ALIB_DCS_ACQUIRE_SHARED AcquireShared(ALIB_CALLER); |
Calls DbgCriticalSections::AcquireShared (on this
).
Definition at line 52 of file dbgcriticalsections.hpp.
#define ALIB_DCS_ACQUIRE_SHARED_WITH | ( | CS | ) |
Calls DbgCriticalSections::AcquireShared on the instance given with CS.
CS | The DbgCriticalSections instance to use. |
Definition at line 54 of file dbgcriticalsections.hpp.
#define ALIB_DCS_ACQUIRE_WITH | ( | CS | ) |
Calls DbgCriticalSections::Acquire on the instance given with CS.
CS | The DbgCriticalSections instance to use. |
Definition at line 50 of file dbgcriticalsections.hpp.
#define ALIB_DCS_RELEASE Release(ALIB_CALLER); |
Calls DbgCriticalSections::Release (on this
).
Definition at line 49 of file dbgcriticalsections.hpp.
#define ALIB_DCS_RELEASE_SHARED ReleaseShared(ALIB_CALLER); |
Calls DbgCriticalSections::ReleaseShared (on this
).
Definition at line 53 of file dbgcriticalsections.hpp.
#define ALIB_DCS_RELEASE_SHARED_WITH | ( | CS | ) |
Calls DbgCriticalSections::ReleaseShared on the instance given with CS.
CS | The DbgCriticalSections instance to use. |
Definition at line 55 of file dbgcriticalsections.hpp.
#define ALIB_DCS_RELEASE_WITH | ( | CS | ) |
Calls DbgCriticalSections::Release on the instance given with CS.
CS | The DbgCriticalSections instance to use. |
Definition at line 51 of file dbgcriticalsections.hpp.
#define ALIB_DCS_SHARED ALIB_OWN_SHARED(*this) |
Alternative to macro ALIB_DCS which uses macro ALIB_OWN_SHARED instead of ALIB_OWN and thus creates an anonymous instance of OwnerShared instead of Owner.
Definition at line 45 of file dbgcriticalsections.hpp.
#define ALIB_DCS_SHARED_WITH | ( | CS | ) |
Alternative to macro ALIB_DCS_WITH which uses macro ALIB_OWN_SHARED instead of ALIB_OWN and thus creates an anonymous instance of OwnerShared instead of Owner.
CS | The DbgCriticalSections to acquire and release. |
Definition at line 47 of file dbgcriticalsections.hpp.
#define ALIB_DCS_WITH | ( | CS | ) |
Alternative to macro ALIB_DCS which allows specifying the ownable. (Macro ALIB_DCS fixes this to *this
).
CS | The DbgCriticalSections to acquire and release. |
Definition at line 46 of file dbgcriticalsections.hpp.
#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.
#define ALIB_ENUMS_ASSIGN_RECORD | ( | TEnum, | |
TRecord ) |
Macro used to specialize type-traits struct T_EnumRecords<TEnum> to associate C++ enumeration type TEnum with ALib Enum Records of type TRecord.
TEnum | The enumeration type to define data records for. |
TRecord | The type of the data record to assign. |
Definition at line 712 of file records.hpp.
#define ALIB_ENUMS_MAKE_ARITHMETICAL | ( | TEnum | ) |
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.
TEnum | Type of a scoped or non-scoped enumeration that is to be declared an arithmetical type. |
Definition at line 88 of file arithmetical.hpp.
#define ALIB_ENUMS_MAKE_BITWISE | ( | TEnum | ) |
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.
TEnum | Type of a scoped or non-scoped enumeration that is to be declared a bitwise type. |
Definition at line 109 of file bitwise.hpp.
#define ALIB_ENUMS_MAKE_ITERABLE | ( | TEnum, | |
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.
TEnum | Type of a scoped or non-scoped enumeration that is to be declared an iterable enum type. |
StopElement | The enum element after the last "valid" element in the enumeration. Will be used as expression for constexpr T_EnumIsIterable::End. |
Definition at line 100 of file iterable.hpp.
#define ALIB_ENUMS_MAKE_ITERABLE_BEGIN_END | ( | TEnum, | |
StartElement, | |||
StopElement ) |
Specializes type-traits struct T_EnumIsIterable to implement methods:
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.
TEnum | Type of a scoped or non-scoped enumeration that is to be declared an iterable enum type. |
StartElement | The first element of the enumeration. Will be used as expression for constexpr T_EnumIsIterable::End. |
StopElement | The enum element after the last "valid" element in the enumeration. Will be used as expression for constexpr T_EnumIsIterable::End. |
Definition at line 92 of file iterable.hpp.
#define ALIB_ENUMS_UNDERLYING_TYPE | ( | TEnum | ) |
Simple shortcut to typename std::underlying_type<TEnum>::type
.
Definition at line 19 of file underlyingintegral.hpp.
#define ALIB_ERROR | ( | ... | ) |
Writes the given message objects as an error.
... | The objects used to format the message string. |
#define ALIB_FALLTHROUGH [[clang::fallthrough]]; |
#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.
#define ALIB_IDENTIFIER | ( | prefix | ) |
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.
prefix | A prefix token to use. |
#define ALIB_LOCK ALIB_OWN(*this) |
Alias of macro ALIB_OWN, providing *this
as the owner. Commonly used with types derived from classes Lock or RecursiveLock.
#define ALIB_LOCK_RECURSIVE ALIB_OWN_RECURSIVE(*this) |
Alternative to macro ALIB_LOCK which uses macro ALIB_OWN_RECURSIVE instead of ALIB_OWN and thus creates an anonymous instance of OwnerRecursive instead of Owner.
#define ALIB_LOCK_RECURSIVE_WITH | ( | lock | ) |
Alternative to macro ALIB_LOCK_WITH which uses macro ALIB_OWN_RECURSIVE instead of ALIB_OWN and thus creates an anonymous instance of OwnerRecursive instead of Owner.
lock | The mutex to acquire and release. |
#define ALIB_LOCK_SHARED ALIB_OWN_SHARED(*this) |
Alternative to macro ALIB_LOCK which uses macro ALIB_OWN_SHARED instead of ALIB_OWN and thus creates an anonymous instance of OwnerShared instead of Owner.
#define ALIB_LOCK_SHARED_WITH | ( | lock | ) |
Alternative to macro ALIB_LOCK_WITH which uses macro ALIB_OWN_SHARED instead of ALIB_OWN and thus creates an anonymous instance of OwnerShared instead of Owner.
lock | The mutex to acquire and release. |
#define ALIB_LOCK_WITH | ( | lock | ) |
#define ALIB_MESSAGE | ( | ... | ) |
Writes the given message.
... | The objects used to format the message string. |
#define ALIB_NO_RETURN [[ noreturn ]] |
#define ALIB_NSTRINGIFY | ( | a | ) |
#define ALIB_OWN | ( | ownable | ) |
This preprocessor macro defines an anonymous instance of type 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.
Sibling macros
which instantiate an object of type OwnerRecursive, respectively OwnerShared, instead of class Owner.
ownable | The Ownable to acquire and release. |
#define ALIB_OWN_RECURSIVE | ( | ownable | ) |
Same as ALIB_OWN, but creates a local anonymous instance of class OwnerRecursive.
#define ALIB_OWN_SHARED | ( | ownable | ) |
Same as ALIB_OWN, but creates a local anonymous instance of class OwnerShared.
#define ALIB_PATH_TO_NARROW | ( | src, | |
dest, | |||
bufSize ) |
Similar to ALIB_STRINGS_TO_NARROW. If PathCharType does not equal characters::nchar, a local narrow string is created and the given path is converted. Otherwise, just a reference to the given path is created, which will ultimately be optimized out by the compiler.
src | The name of the source instance. |
dest | The name of the destination instance (or reference to the source). |
bufSize | The (initial) size of the local string, which is used as the conversion buffer. |
#define ALIB_PATH_TO_NARROW_ARG | ( | src, | |
bufSize ) |
Similar to ALIB_STRINGS_TO_NARROW and ALIB_STRINGS_TO_NARROW_ARG. Used to pass ALib path-strings as an argument when a narrow-string is expected.
src | The name of the source instance. |
bufSize | The (initial) size of the local string, which is used as the conversion buffer. |
#define ALIB_PATH_TO_STRING | ( | src, | |
dest, | |||
bufSize ) |
Similar to ALIB_STRINGS_TO_NARROW. If PathCharType does not equal characters::character, a local string is created and the given path is converted. Otherwise, just a reference to the given path is created, which will ultimately be optimized out by the compiler.
src | The name of the source instance. |
dest | The name of the destination instance (or reference to the source). |
bufSize | The (initial) size of the local string, which is used as the conversion buffer. |
#define ALIB_PATH_TO_STRING_ARG | ( | src, | |
bufSize ) |
Similar to ALIB_PATH_TO_STRING and ALIB_STRINGS_TO_NARROW_ARG. Used to pass ALib path-strings as an argument when an ALib string is expected.
src | The name of the source instance. |
bufSize | The (initial) size of the local string, which is used as the conversion buffer. |
#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.
#define ALIB_REL_DBG | ( | releaseCode, | |
... ) |
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.
#define ALIB_RESOURCED | ( | T, | |
ResPool, | |||
ResCategory, | |||
ResName ) |
Macro used to specialize type-traits struct T_Resourced for given type T.
T | The type to specialize TMP struct T_Resourced for. |
ResPool | Expression providing a pointer to the ResourcePool object. |
ResCategory | Expression providing the resource category. |
ResName | Expression providing the resource name. |
Definition at line 595 of file resources.hpp.
#define ALIB_RESOURCED_IN_MODULE | ( | T, | |
Camp, | |||
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.
true
.T | The type to specialize TMP struct T_Resourced for. |
Camp | Pointer to the Camp that provides the ResourcePool object. |
ResName | Expression providing the resource name. |
Definition at line 605 of file resources.hpp.
#define ALIB_REVISION 0 |
The ALib revision number. The value of this macro is stored in namespace variable alib::REVISION.
#define ALIB_SIZEOF_WCHAR_T 4 |
#define ALIB_STACK_ALLOCATED_TYPE | ( | T | ) |
To be placed at the beginning of a type which is to be allocated exclusively on the stack. For this, its new-operators
as well as copy and move operators are declared private.
T | The name of the type that this macro is placed in. |
#define ALIB_STATIC_ASSERT | ( | CondVariable, | |
Cond, | |||
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 the assertion uses only this variable as its expression.
The variable name is given with parameter CondVariable and
CondVariable | This should be a "speaking name" that tells the user right away what happened. |
Cond | The condition that is asserted and hid away from the compiler's message text. |
Message | The message that details what is said with CondVariable. |
#define ALIB_STATIC_DENY | ( | CondVariable, | |
Cond, | |||
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".
CondVariable | This should be a "speaking name" that tells the user right away what happened. |
Cond | The condition that is asserted to be false , and that is hid away from the compiler's message text. |
Message | The message that details what is said with CondVariable. |
#define ALIB_STRING_DBG_CHK | ( | instance | ) |
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 18 of file strings/fwds.hpp.
#define ALIB_STRING_RESETTER | ( | astring | ) |
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.
astring | The AString to reset to its original length when the C++ block scope where this macro is placed, is left. |
Definition at line 2135 of file tastring.inl.
#define ALIB_STRING_TO_PATH | ( | src, | |
dest, | |||
bufSize ) |
Similar to ALIB_STRINGS_TO_NARROW. If PathCharType does not equal characters::character, a local path-string is created and the given string is converted. Otherwise, just a reference to the given string is created, which will ultimately be optimized out by the compiler.
src | The name of the source instance. |
dest | The name of the destination instance (or reference to the source). |
bufSize | The (initial) size of the local string, which is used as the conversion buffer. |
#define ALIB_STRING_TO_PATH_ARG | ( | src, | |
bufSize ) |
Similar to ALIB_STRINGS_TO_NARROW and ALIB_STRINGS_TO_NARROW_ARG. Used to pass ALib strings as an argument when a path-string is expected.
src | The name of the source instance. |
bufSize | The (initial) size of the local string, which is used as the conversion buffer. |
#define ALIB_STRINGIFY | ( | a | ) |
#define ALIB_STRINGS_APPENDABLE_TYPE | ( | TYPE | ) |
Helper macro for specializing functor T_Append for type TYPE. This macro has to be positioned outside 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.
TYPE | The type to specialize functor T_Append for. |
Definition at line 140 of file tastring.inl.
#define ALIB_STRINGS_APPENDABLE_TYPE_DEF | ( | TYPE, | |
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.
TYPE | The type to specialize functor T_Append for. |
IMPL | The implementation code for operator(). |
Definition at line 161 of file tastring.inl.
#define ALIB_STRINGS_APPENDABLE_TYPE_DEF_N | ( | TYPE, | |
IMPL ) |
Same as ALIB_STRINGS_APPENDABLE_TYPE_DEF but for character type alib::nchar.
TYPE | The type to specialize functor T_Append for. |
IMPL | The implementation code for operator(). |
Definition at line 165 of file tastring.inl.
#define ALIB_STRINGS_APPENDABLE_TYPE_DEF_W | ( | TYPE, | |
IMPL ) |
Same as ALIB_STRINGS_APPENDABLE_TYPE_DEF but for character type alib::wchar.
TYPE | The type to specialize functor T_Append for. |
IMPL | The implementation code for operator(). |
Definition at line 169 of file tastring.inl.
#define ALIB_STRINGS_APPENDABLE_TYPE_INLINE | ( | TYPE, | |
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.
TYPE | The type to specialize functor T_Append for. |
IMPL | The implementation code for operator(). |
Definition at line 174 of file tastring.inl.
#define ALIB_STRINGS_APPENDABLE_TYPE_INLINE_N | ( | TYPE, | |
IMPL ) |
Same as ALIB_STRINGS_APPENDABLE_TYPE_INLINE but for character type alib::nchar.
TYPE | The type to specialize functor T_Append for. |
IMPL | The implementation code for operator(). |
Definition at line 181 of file tastring.inl.
#define ALIB_STRINGS_APPENDABLE_TYPE_INLINE_W | ( | TYPE, | |
IMPL ) |
Same as ALIB_STRINGS_APPENDABLE_TYPE_INLINE but for character type alib::wchar.
TYPE | The type to specialize functor T_Append for. |
IMPL | The implementation code for operator(). |
Definition at line 188 of file tastring.inl.
#define ALIB_STRINGS_APPENDABLE_TYPE_N | ( | TYPE | ) |
Same as ALIB_STRINGS_APPENDABLE_TYPE but for character type alib::nchar.
TYPE | The type to specialize functor T_Append for. |
Definition at line 147 of file tastring.inl.
#define ALIB_STRINGS_APPENDABLE_TYPE_W | ( | TYPE | ) |
Same as ALIB_STRINGS_APPENDABLE_TYPE but for character type alib::wchar.
TYPE | The type to specialize functor T_Append for. |
Definition at line 154 of file tastring.inl.
#define ALIB_STRINGS_FROM_NARROW | ( | src, | |
dest, | |||
bufSize ) |
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.
src | The source string. |
dest | The name of the destination variable. |
bufSize | The local buffer size used for the conversion. |
Definition at line 352 of file strings/fwds.hpp.
#define ALIB_STRINGS_FROM_NARROW_ARG | ( | src, | |
bufSize ) |
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>.
src | The source string. |
bufSize | The local buffer size used for the conversion. |
Definition at line 353 of file strings/fwds.hpp.
#define ALIB_STRINGS_FROM_WIDE | ( | src, | |
dest, | |||
bufSize ) |
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.
src | The source string. |
dest | The name of the destination variable. |
bufSize | The local buffer size used for the conversion. |
Definition at line 354 of file strings/fwds.hpp.
#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>.
src | The source string. |
bufSize | The local buffer size used for the conversion. |
Definition at line 355 of file strings/fwds.hpp.
#define ALIB_STRINGS_SUPPRESS_STD_OSTREAM_OPERATOR | ( | 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.
TYPE | The type to specialize functor T_Append for. |
Definition at line 48 of file std_strings_iostream.hpp.
#define ALIB_STRINGS_TO_NARROW | ( | src, | |
dest, | |||
bufSize ) |
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.
src | The source string. |
dest | The name of the destination variable. |
bufSize | The local buffer size used for the conversion. |
Definition at line 348 of file strings/fwds.hpp.
#define ALIB_STRINGS_TO_NARROW_ARG | ( | src, | |
bufSize ) |
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> which converts the string to the right character type.
src | The source string. |
bufSize | The local buffer size used for the conversion. |
Definition at line 349 of file strings/fwds.hpp.
#define ALIB_STRINGS_TO_WIDE | ( | src, | |
dest, | |||
bufSize ) |
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.
src | The source string. |
dest | The name of the destination variable. |
bufSize | The local buffer size used for the conversion. |
Definition at line 350 of file strings/fwds.hpp.
#define ALIB_STRINGS_TO_WIDE_ARG | ( | src, | |
bufSize ) |
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>.
src | The source string. |
bufSize | The local buffer size used for the conversion. |
Definition at line 351 of file strings/fwds.hpp.
#define ALIB_VERSION 2412 |
The ALib version number. The value of this macro is stored in namespace variable alib::VERSION.
#define ALIB_WARNING | ( | ... | ) |
Writes the given message objects as an warning.
... | The objects used to format the message string. |
#define ALIB_WARNINGS_ALLOW_BITWISE_SWITCH |
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.
#define ALIB_WARNINGS_ALLOW_MACRO_REDEFINITION |
#define ALIB_WARNINGS_ALLOW_NULL_POINTER_PASSING _Pragma("clang diagnostic push") \ |
#define ALIB_WARNINGS_ALLOW_SHIFT_COUNT_OVERFLOW |
#define ALIB_WARNINGS_ALLOW_SPARSE_ENUM_SWITCH |
Preprocessor macro to disable compiler warnings when an enumeration element is switched while not all enumeration elements get caught.
#define ALIB_WARNINGS_ALLOW_UNSAFE_BUFFER_USAGE |
#define ALIB_WARNINGS_ALLOW_UNSAFE_FUNCTION_OR_VARIABLE |
#define ALIB_WARNINGS_IGNORE_DOCS |
#define ALIB_WARNINGS_IGNORE_FUNCTION_TEMPLATE |
#define ALIB_WARNINGS_IGNORE_INTEGER_OVERFLOW |
#define ALIB_WARNINGS_IGNORE_INTEGRAL_CONSTANT_OVERFLOW _Pragma("clang diagnostic push") \ |
#define ALIB_WARNINGS_IGNORE_NOTHING_RETURNED |
Preprocessor macro to disable compiler warnings concerning non-void functions that may not return a value. Needed when compiler cannot properly detect the inherent safeness (correctness) of a function that always is returning a type.
#define ALIB_WARNINGS_IGNORE_RESERVED_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.
#define ALIB_WARNINGS_IGNORE_SIGN_CONVERSION |
#define ALIB_WARNINGS_IGNORE_UNUSED_FUNCTION |
Preprocessor macro to disable compiler warnings concerning unused (member-) functions. (This macro is only used with unit testing and documentation sample code.)
#define ALIB_WARNINGS_IGNORE_UNUSED_LAMBDA_CAPTURE |
Preprocessor macro to disable compiler warnings concerning unused (member-) functions. (Needed, because it can happen that gcc needs a this
captured, while clang complains it was unnecessary.)
#define ALIB_WARNINGS_IGNORE_UNUSED_MACRO |
#define ALIB_WARNINGS_IGNORE_UNUSED_PARAMETER |
#define ALIB_WARNINGS_IGNORE_UNUSED_VARIABLE |
#define ALIB_WARNINGS_MACRO_NOT_USED_OFF |
#define ALIB_WARNINGS_OVERLOAD_VIRTUAL_OFF |
#define ALIB_WARNINGS_RESERVED_MACRO_NAME_OFF |
#define ALIB_WARNINGS_RESTORE _Pragma("clang diagnostic pop") \ |
#define ALIB_WARNINGS_UNINITIALIZED_OFF |
#define ATMP_BOOL_IF | ( | Cond | ) |
#define ATMP_CHAR_COMPLEMENT | ( | TChar | ) |
Gives the complementary character type to the given type. This is specific to ALib character definitions. Converts
TChar | The character type to convert to its complementary character. |
Definition at line 17 of file prepro_macros.md.
#define ATMP_EQ | ( | T, | |
TEqual ) |
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.
T | The lhs type to compare. |
TEqual | The rhs type to compare. |
#define ATMP_HAS_METHOD | ( | T, | |
Method, | |||
... ) |
Returns true
if the given type T has a method called Method with the given signature. If not, does not return false
, but causes SFINAE.
T | The type to test a method for. |
Method | The name of the method. |
... | Variadic list of args of the method. |
#define ATMP_IF | ( | Cond | ) |
Defined as typename = typename std::enable_if<Cond,void >::type
and hence can be used as the last element in the list of template parameters of methods to enable or disable such method.
Cond | The condition to be met if the method should be enabled. |
#define ATMP_IF_T_F | ( | Cond, | |
T, | |||
F ) |
#define ATMP_IS_ARR | ( | T | ) |
#define ATMP_IS_CONST | ( | T | ) |
#define ATMP_IS_ENUM | ( | T | ) |
#define ATMP_IS_INT | ( | T | ) |
#define ATMP_IS_PTR | ( | T | ) |
#define ATMP_IS_SINT | ( | T | ) |
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.
T | The type to convert to plain. |
#define ATMP_IS_UINT | ( | T | ) |
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.
T | The type to convert to plain. |
#define ATMP_ISOF | ( | T, | |
TBase ) |
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
.)
T | The type to test for being a TBase. |
TBase | The base type. |
true
if T is a (derived) TBase, false
otherwise. #define ATMP_RC | ( | T | ) |
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.
T | The type to remove const from. |
#define ATMP_RCV | ( | T | ) |
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.
T | The type to remove const and valatile modifiers from. |
#define ATMP_RCVP | ( | T | ) |
Simple shortcut to nested type modifiers std::remove_cv
, std::remove_pointer
and std::remove_reference
.
T | The type to convert to plain. |
#define ATMP_RCVR | ( | T | ) |
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.
T | The type to convert to plain, leaving pointer. |
#define ATMP_RE | ( | T | ) |
#define ATMP_RECVP | ( | T | ) |
Simple shortcut to nested type modifiers that removes the extent of a type as well as pointer and CV qualifiers.
T | The type to convert to plain. |
#define ATMP_RESULT_TYPE | ( | T, | |
Method, | |||
... ) |
#define ATMP_RETURN_IF_1TP | ( | TReturn, | |
TParam, | |||
... ) |
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).
TReturn | The return type of the method to declare. |
TParam | Type and name of the template parameter of the method, for example "typename T". |
... | The condition for selecting the method. |
#define ATMP_RETURN_IF_2TP | ( | TReturn, | |
TParam1, | |||
TParam2, | |||
... ) |
Same as ATMP_RETURN_IF_1TP but for class member methods with two template parameters.
TReturn | The return type of the method to declare. |
TParam1 | Type and name of the first template parameter of the method. |
TParam2 | Type and name of the second template parameter of the method. |
... | The condition for selecting the method. |
#define ATMP_RP | ( | T | ) |
#define ATMP_RR | ( | T | ) |
#define ATMP_SELECT_IF_1TP | ( | TParam, | |
... ) |
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).
TParam | Type and name of the template parameter of the method, for example "typename T". |
... | The condition for selecting the method. |
#define ATMP_SELECT_IF_2TP | ( | TParam1, | |
TParam2, | |||
... ) |
Same as ATMP_SELECT_IF_1TP but for class member methods with two template parameters (adding a third, anonymous one).
TParam1 | Type and name (separated by a space) of the first template parameter of the method. |
TParam2 | Type and name (separated by a space) of the second template parameter of the method. |
... | The condition for selecting the method. |
#define ATMP_SELECT_IF_3TP | ( | TParam1, | |
TParam2, | |||
TParam3, | |||
... ) |
Same as ATMP_SELECT_IF_1TP but for methods with three template parameters (adding a fourth, anonymous one).
TParam1 | Type and name (separated by a space) of the first template parameter of the method. |
TParam2 | Type and name (separated by a space) of the second template parameter of the method. |
TParam3 | Type and name (separated by a space) of the third template parameter of the method. |
... | The condition for selecting the method. |
#define ATMP_SELECT_IF_4TP | ( | TParam1, | |
TParam2, | |||
TParam3, | |||
TParam4, | |||
... ) |
Same as ATMP_SELECT_IF_1TP but for methods with four template parameters (adding a fifth, anonymous one).
TParam1 | Type and name (separated by a space) of the first template parameter of the method. |
TParam2 | Type and name (separated by a space) of the second template parameter of the method. |
TParam3 | Type and name (separated by a space) of the third template parameter of the method. |
TParam4 | Type and name (separated by a space) of the fourth template parameter of the method. |
... | The condition for selecting the method. |
#define ATMP_T_IF | ( | T, | |
Cond ) |
#define ATMP_VOID_IF | ( | Cond | ) |
#define bitsof | ( | type | ) |
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.
sizeof
, as an exception from the naming rules, this function is spelled in lower case.#define CALCULUS_CALLBACK | ( | 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.
func | The name of the callback function. |
Definition at line 29 of file calculus.hpp.
#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 30 of file calculus.hpp.
#define CALCULUS_SIGNATURE | ( | BoxPointerArray | ) |
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.
BoxPointerArray | nullptr for identifiers, otherwise the list of argument sample boxes provided as a Box**. |
Definition at line 36 of file calculus.hpp.
#define IF_ALIB_ALOX | ( | ... | ) |
Prunes given code ... if ALox is not included in the ALib Distribution.
... | The source to select. |
#define IF_ALIB_BITBUFFER | ( | ... | ) |
Prunes given code ... if ALib BitBuffer is not included in the ALib Distribution.
... | The source to select. |
#define IF_ALIB_BOXING | ( | ... | ) |
Prunes given code ... if ALib Boxing is not included in the ALib Distribution.
... | The source to select. |
#define IF_ALIB_CAMP | ( | ... | ) |
Prunes given code ... if ALib BaseCamp is not included in the ALib Distribution.
... | The source to select. |
#define IF_ALIB_CHARACTERS | ( | ... | ) |
Prunes given code ... if ALib Characters is not included in the ALib Distribution.
... | The source to select. |
#define IF_ALIB_CLI | ( | ... | ) |
Prunes given code ... if ALib CLI is not included in the ALib Distribution.
... | The source to select. |
#define IF_ALIB_CONFIGURATION | ( | ... | ) |
Prunes given code ... if ALib Configuration is not included in the ALib Distribution.
... | The source to select. |
#define IF_ALIB_CONTAINERS | ( | ... | ) |
Prunes given code ... if ALib Containers is not included in the ALib Distribution.
... | The source to select. |
#define IF_ALIB_ENUMS | ( | ... | ) |
Prunes given code ... if ALib Enums is not included in the ALib Distribution.
... | The source to select. |
#define IF_ALIB_EXPRESSIONS | ( | ... | ) |
Prunes given code ... if ALib Expressions is not included in the ALib Distribution.
... | The source to select. |
#define IF_ALIB_FILES | ( | ... | ) |
Prunes given code ... if ALib Files is not included in the ALib Distribution.
... | The source to select. |
#define IF_ALIB_MONOMEM | ( | ... | ) |
Prunes given code ... if ALib Monomem is not included in the ALib Distribution.
... | The source to select. |
#define IF_ALIB_SINGLETONS | ( | ... | ) |
Prunes given code ... if ALib Singletons is not included in the ALib Distribution.
... | The source to select. |
#define IF_ALIB_STRINGS | ( | ... | ) |
Prunes given code ... if ALib Strings is not included in the ALib Distribution.
... | The source to select. |
#define IF_ALIB_THREADMODEL | ( | ... | ) |
Prunes given code ... if ALib ThreadModel is not included in the ALib Distribution.
... | The source to select. |
#define IF_ALIB_THREADS | ( | ... | ) |
Prunes given code ... if ALib Threads is not included in the ALib Distribution.
... | The source to select. |
#define IF_ALIB_TIME | ( | ... | ) |
Prunes given code ... if ALib Time is not included in the ALib Distribution.
... | The source to select. |
#define IFNOT_ALIB_ALOX | ( | ... | ) |
Prunes given code ... if ALox is not included in the ALib Distribution.
... | The source to select. |
#define IFNOT_ALIB_BITBUFFER | ( | ... | ) |
Prunes given code ... if ALib BitBuffer is not included in the ALib Distribution.
... | The source to select. |
#define IFNOT_ALIB_BOXING | ( | ... | ) |
Prunes given code ... if ALib Boxing is not included in the ALib Distribution.
... | The source to select. |
#define IFNOT_ALIB_CAMP | ( | ... | ) |
Prunes given code ... if ALib BaseCamp is not included in the ALib Distribution.
... | The source to select. |
#define IFNOT_ALIB_CHARACTERS | ( | ... | ) |
Prunes given code ... if ALib Characters is not included in the ALib Distribution.
... | The source to select. |
#define IFNOT_ALIB_CLI | ( | ... | ) |
Prunes given code ... if ALib CLI is not included in the ALib Distribution.
... | The source to select. |
#define IFNOT_ALIB_CONFIGURATION | ( | ... | ) |
Prunes given code ... if ALib Configuration is not included in the ALib Distribution.
... | The source to select. |
#define IFNOT_ALIB_CONTAINERS | ( | ... | ) |
Prunes given code ... if ALib Containers is not included in the ALib Distribution.
... | The source to select. |
#define IFNOT_ALIB_ENUMS | ( | ... | ) |
Prunes given code ... if ALib Enums is not included in the ALib Distribution.
... | The source to select. |
#define IFNOT_ALIB_EXPRESSIONS | ( | ... | ) |
Prunes given code ... if ALib Expressions is not included in the ALib Distribution.
... | The source to select. |
#define IFNOT_ALIB_FILES | ( | ... | ) |
Prunes given code ... if ALib Files is not included in the ALib Distribution.
... | The source to select. |
#define IFNOT_ALIB_MONOMEM | ( | ... | ) |
Prunes given code ... if ALib Monomem is not included in the ALib Distribution.
... | The source to select. |
#define IFNOT_ALIB_SINGLETONS | ( | ... | ) |
Prunes given code ... if ALib Singletons is not included in the ALib Distribution.
... | The source to select. |
#define IFNOT_ALIB_STRINGS | ( | ... | ) |
Prunes given code ... if ALib Strings is not included in the ALib Distribution.
... | The source to select. |
#define IFNOT_ALIB_THREADMODEL | ( | ... | ) |
Prunes given code ... if ALib ThreadModel is not included in the ALib Distribution.
... | The source to select. |
#define IFNOT_ALIB_THREADS | ( | ... | ) |
Prunes given code ... if ALib Threads is not included in the ALib Distribution.
... | The source to select. |
#define IFNOT_ALIB_TIME | ( | ... | ) |
Prunes given code ... if ALib Time is not included in the ALib Distribution.
... | The source to select. |
#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 45 of file macros.inl.
#define Log_AddDebugLogger | ( | ) |
Invokes Log::AddDebugLogger to create, add and configure a default debug logger suitable for the platform and toolset.
... | The parameters to pass. |
Definition at line 62 of file macros.inl.
#define Log_Assert | ( | ... | ) |
Invokes Lox::Assert on the debug singleton of class Lox defined in macro LOG_LOX.
... | The parameters to pass. |
Definition at line 78 of file macros.inl.
#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.
#define Log_ClearSourcePathTrimRules | ( | ... | ) |
Invokes Lox::ClearSourcePathTrimRules on the debug singleton of class Lox defined in macro LOG_LOX.
... | The parameters to pass. |
Definition at line 61 of file macros.inl.
#define Log_Entry | ( | ... | ) |
Invokes Lox::Entry on the debug singleton of class Lox defined in macro LOG_LOX.
... | The parameters to pass. |
Definition at line 81 of file macros.inl.
#define Log_Error | ( | ... | ) |
Invokes Lox::Error on the debug singleton of class Lox defined in macro LOG_LOX.
... | The parameters to pass. |
Definition at line 77 of file macros.inl.
#define Log_Exception | ( | ... | ) |
Invokes LogTools::Exception providing the debug singleton of class Lox defined in macro LOG_LOX.
... | The parameters to pass. |
Definition at line 86 of file macros.inl.
#define Log_GetLogger | ( | identifier, | |
name ) |
Invokes Lox::GetLogger on the debug singleton of class Lox defined in macro LOG_LOX.
identifier | The identifier name of the variable that receives the pointer to the logger. |
name | The name of the logger to retrieve. |
Definition at line 64 of file macros.inl.
#define Log_If | ( | ... | ) |
Invokes Lox::If on the debug singleton of class Lox defined in macro LOG_LOX.
... | The parameters to pass. |
Definition at line 79 of file macros.inl.
#define Log_Info | ( | ... | ) |
Invokes Lox::Info on the debug singleton of class Lox defined in macro LOG_LOX.
... | The parameters to pass. |
Definition at line 75 of file macros.inl.
#define Log_IsActive | ( | result, | |
... ) |
Invokes Lox::IsActive on the object of type Lox defined in macro LOG_LOX. The result value is assigned to given variable result
result | The name of a variable of type int that the return value of IsActive() is assigned to. |
... | The parameters to pass. |
Definition at line 85 of file macros.inl.
#define Log_LogState | ( | ... | ) |
Invokes Lox::State on the debug singleton of class Lox defined in macro LOG_LOX.
... | The parameters to pass. |
Definition at line 73 of file macros.inl.
#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.
#define Log_MapThreadName | ( | ... | ) |
Invokes Lox::MapThreadName on the debug singleton of class Lox defined in macro LOG_LOX.
... | The parameters to pass. |
Definition at line 72 of file macros.inl.
#define Log_Once | ( | ... | ) |
Invokes Lox::Once on the debug singleton of class Lox defined in macro LOG_LOX.
... | The parameters to pass. |
Definition at line 80 of file macros.inl.
#define Log_Prune | ( | ... | ) |
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 55 of file macros.inl.
#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 46 of file macros.inl.
#define Log_RemoveDebugLogger | ( | ) |
Invokes Log::RemoveDebugLogger to remove and delete a debug logger created by Log::AddDebugLogger.
... | The parameters to pass. |
Definition at line 63 of file macros.inl.
#define Log_RemoveLogger | ( | logger | ) |
Invokes Lox::RemoveLogger on the debug singleton of class Lox defined in macro LOG_LOX.
logger | Either the name of or a pointer to the logger to remove. |
Definition at line 66 of file macros.inl.
#define Log_RemoveThreadDomain | ( | ... | ) |
Invokes Lox::RemoveThreadDomain on the debug singleton of class Lox defined in macro LOG_LOX.
... | The parameters to pass. |
Definition at line 68 of file macros.inl.
#define Log_Retrieve | ( | data, | |
... ) |
Invokes Lox::Retrieve on the debug singleton of class Lox defined in macro LOG_LOX.
data | The identifier name of the Box object to take the retrieved data. |
... | The parameters to pass. |
Definition at line 84 of file macros.inl.
#define Log_SetDomain | ( | ... | ) |
Invokes Lox::SetDomain on the debug singleton of class Lox defined in macro LOG_LOX.
... | The parameters to pass. |
Definition at line 67 of file macros.inl.
#define Log_SetDomainSubstitutionRule | ( | ... | ) |
Invokes Lox::SetDomainSubstitutionRule on the debug singleton of class Lox defined in macro LOG_LOX.
... | The parameters to pass. |
Definition at line 69 of file macros.inl.
#define Log_SetPrefix | ( | ... | ) |
Invokes Lox::SetPrefix on the debug singleton of class Lox defined in macro LOG_LOX.
... | The parameters to pass. |
Definition at line 82 of file macros.inl.
#define Log_SetSourcePathTrimRule | ( | ... | ) |
Invokes Lox::SetSourcePathTrimRule on the debug singleton of class Lox defined in macro LOG_LOX.
... | The parameters to pass. |
Definition at line 60 of file macros.inl.
#define Log_SetStartTime | ( | ... | ) |
Invokes Lox::SetStartTime on the debug singleton of class Lox defined in macro LOG_LOX.
... | The parameters to pass. |
Definition at line 71 of file macros.inl.
#define Log_SetVerbosity | ( | ... | ) |
Invokes one of the overloaded methods Lox::SetVerbosity on the debug singleton of class Lox defined in macro LOG_LOX.
... | The parameters to pass. |
Definition at line 70 of file macros.inl.
#define Log_Store | ( | ... | ) |
Invokes Lox::Store on the debug singleton of class Lox defined in macro LOG_LOX.
... | The parameters to pass. |
Definition at line 83 of file macros.inl.
#define Log_Verbose | ( | ... | ) |
Invokes Lox::Verbose on the debug singleton of class Lox defined in macro LOG_LOX.
... | The parameters to pass. |
Definition at line 74 of file macros.inl.
#define Log_Warning | ( | ... | ) |
Invokes Lox::Warning on the debug singleton of class Lox defined in macro LOG_LOX.
... | The parameters to pass. |
Definition at line 76 of file macros.inl.
#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 47 of file macros.inl.
#define Lox_Assert | ( | ... | ) |
Invokes Lox::Assert on the object of type Lox defined in macro LOX_LOX.
... | The parameters to pass. |
Definition at line 114 of file macros.inl.
#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 36 of file macros.inl.
#define Lox_ClearSourcePathTrimRules | ( | ... | ) |
Invokes Lox::ClearSourcePathTrimRules on the object of type Lox defined in macro LOX_LOX.
... | The parameters to pass. |
Definition at line 100 of file macros.inl.
#define Lox_Entry | ( | ... | ) |
Invokes Lox::Entry on the object of type Lox defined in macro LOX_LOX.
... | The parameters to pass. |
Definition at line 117 of file macros.inl.
#define Lox_Error | ( | ... | ) |
Invokes Lox::Error on the object of type Lox defined in macro LOX_LOX.
... | The parameters to pass. |
Definition at line 113 of file macros.inl.
#define Lox_Exception | ( | ... | ) |
Invokes LogTools::Exception providing the object of type Lox defined in macro LOX_LOX.
... | The parameters to pass. |
Definition at line 122 of file macros.inl.
#define Lox_GetLogger | ( | identifier, | |
name ) |
Invokes Lox::GetLogger on the object of type Lox defined in macro LOX_LOX.
identifier | The identifier name of the variable that receives the pointer to the logger. |
name | The name of the logger to retrieve. |
Definition at line 101 of file macros.inl.
#define Lox_If | ( | ... | ) |
Invokes Lox::If on the object of type Lox defined in macro LOX_LOX.
... | The parameters to pass. |
Definition at line 115 of file macros.inl.
#define Lox_Info | ( | ... | ) |
Invokes Lox::Info on the object of type Lox defined in macro LOX_LOX.
... | The parameters to pass. |
Definition at line 111 of file macros.inl.
#define Lox_IsActive | ( | result, | |
... ) |
Invokes Lox::IsActive on the object of type Lox defined in macro LOX_LOX. The result value is assigned to given variable result
result | The name of a variable of type int that the return value of IsActive() is assigned to. |
... | The parameters to pass. |
Definition at line 121 of file macros.inl.
#define Lox_LogState | ( | ... | ) |
Invokes Lox::State on the object of type Lox defined in macro LOX_LOX.
... | The parameters to pass. |
Definition at line 109 of file macros.inl.
#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 before 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.md.
#define Lox_MapThreadName | ( | ... | ) |
Invokes Lox::MapThreadName on the object of type Lox defined in macro LOX_LOX.
... | The parameters to pass. |
Definition at line 108 of file macros.inl.
#define Lox_Once | ( | ... | ) |
Invokes Lox::Once on the object of type Lox defined in macro LOX_LOX.
... | The parameters to pass. |
Definition at line 116 of file macros.inl.
#define Lox_Prune | ( | ... | ) |
This very simple macro is used for pruning release Log Statements at 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.
... | The code to prune. |
Definition at line 94 of file macros.inl.
#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 48 of file macros.inl.
#define Lox_RemoveLogger | ( | logger | ) |
Invokes Lox::RemoveLogger on the object of type Lox defined in macro LOX_LOX.
logger | Either the name of or a pointer to the logger to remove. |
Definition at line 102 of file macros.inl.
#define Lox_RemoveThreadDomain | ( | ... | ) |
Invokes Lox::RemoveThreadDomain on the object of type Lox defined in macro LOX_LOX.
... | The parameters to pass. |
Definition at line 104 of file macros.inl.
#define Lox_Retrieve | ( | data, | |
... ) |
Invokes Lox::Retrieve on the object of type Lox defined in macro LOX_LOX.
data | The identifier name of the Box object to take the retrieved data. |
... | The parameters to pass. |
Definition at line 119 of file macros.inl.
#define Lox_SetDomain | ( | ... | ) |
Invokes Lox::SetDomain on the object of type Lox defined in macro LOX_LOX.
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.
... | The parameters to pass. |
Definition at line 103 of file macros.inl.
#define Lox_SetDomainSubstitutionRule | ( | ... | ) |
Invokes Lox::SetDomainSubstitutionRule on the object of type Lox defined in macro LOX_LOX.
... | The parameters to pass. |
Definition at line 105 of file macros.inl.
#define Lox_SetPrefix | ( | ... | ) |
Invokes Lox::SetPrefix on the object of type Lox defined in macro LOX_LOX.
... | The parameters to pass. |
Definition at line 120 of file macros.inl.
#define Lox_SetSourcePathTrimRule | ( | ... | ) |
Invokes Lox::SetSourcePathTrimRule on the object of type Lox defined in macro LOX_LOX.
... | The parameters to pass. |
Definition at line 99 of file macros.inl.
#define Lox_SetStartTime | ( | ... | ) |
Invokes Lox::SetStartTime on the object of type Lox defined in macro LOX_LOX.
... | The parameters to pass. |
Definition at line 107 of file macros.inl.
#define Lox_SetVerbosity | ( | ... | ) |
Invokes one of the overloaded methods Lox::SetVerbosity on the object of type Lox defined in macro LOX_LOX.
... | The parameters to pass. |
Definition at line 106 of file macros.inl.
#define Lox_Store | ( | ... | ) |
Invokes Lox::Store on the object of type Lox defined in macro LOX_LOX.
... | The parameters to pass. |
Definition at line 118 of file macros.inl.
#define Lox_Verbose | ( | ... | ) |
Invokes Lox::Verbose on the object of type Lox defined in macro LOX_LOX.
... | The parameters to pass. |
Definition at line 110 of file macros.inl.
#define Lox_Warning | ( | ... | ) |
Invokes Lox::Warning on the object of type Lox defined in macro LOX_LOX.
... | The parameters to pass. |
Definition at line 112 of file macros.inl.