ALib C++ Library
Library Version: 2312 R0
Documentation generated by doxygen
features.hpp
Go to the documentation of this file.
1 /** ************************************************************************************************
2  * \file
3  * This header file is part of the \aliblong. It does neither belong to a fileset, nor to a
4  * specific module of \alib, but is included in any \alibdist.
5  *
6  * \emoji :copyright: 2013-2023 A-Worx GmbH, Germany.
7  * Published under \ref mainpage_license "Boost Software License".
8  *
9  * \note
10  * To reduce complexity, this header is not shown in inclusion graphs of this documentation.
11  **************************************************************************************************/
12 #ifndef HPP_ALIB_FEATURES
13 #define HPP_ALIB_FEATURES 1
14 
15 #if !defined(HPP_ALIB_PLATFORMS) && !defined(ALIB_DOX)
16 # include "alib/lib/platforms.hpp"
17 #endif
18 
19 
20 // Avoid analyzer (valgrind) warnings
21 #if !defined(ALIB_AVOID_ANALYZER_WARNINGS )
22 # define ALIB_AVOID_ANALYZER_WARNINGS 1
23 #endif
24 
25 
26 // 3rd party libraries included in the build
27 #if !defined(ALIB_EXT_LIB_THREADS_AVAILABLE)
28 # define ALIB_EXT_LIB_THREADS_AVAILABLE 0
29 #endif
30 #if !defined(ALIB_FEAT_BOOST_REGEX)
31 # define ALIB_FEAT_BOOST_REGEX 0
32 #endif
33 
34 
35 // If module Threads is not available we have to define the locking macros. This allows
36 // to reduce the effort of testing for thread availability of those modules which are
37 // tolerant to work in thread-unsafe mode.
38 // On the same token, this allows a debug-check to assert that no two threads use the library.
39 #if ALIB_DEBUG && !ALIB_THREADS && ALIB_EXT_LIB_THREADS_AVAILABLE
40  namespace aworx { namespace lib
41  {
43  }}
44 #else
45  namespace aworx { namespace lib
46  {
47  inline void DbgCheckSingleThreaded() {} // optimized out
48  }}
49 #endif // !ALIB_THREADS
50 
51 #if !ALIB_THREADS
52 # if ALIB_DEBUG
53 # define ALIB_LOCK { aworx::lib::DbgCheckSingleThreaded(); }
54 # define ALIB_LOCK_WITH(VOID) { aworx::lib::DbgCheckSingleThreaded(); }
55 # else
56 # define ALIB_LOCK { }
57 # define ALIB_LOCK_WITH(VOID) { }
58 # endif
59 #endif // !ALIB_THREADS
60 
61 
62 #if ALIB_DEBUG && ALIB_FILESET_MODULES
63  namespace aworx { namespace lib {
64  /**
65  * This flag may be used to determine if \alib is \ref alib_manual_bootstrapping "bootstrapped"
66  * already. While in general it is preferred to test corresponding single modules for
67  * being bootstrapped using \alib{Module::IsBootstrapped}, this flag may be used to
68  * avoid the inclusion of header files of corresponding modules.
69  *
70  * The flag is set to \c true at the end of phase \alib{Module,BootstrapPhases::Final}
71  * of module \alib{ALibDistribution} and is cleared at the start of shutdown phase
72  * \alib{Module,ShutdownPhases::Destruct}.
73  *
74  * ### Availability ###
75  * This flag is available only with debug builds if fileset \ref ALIB_FILESET_MODULES is
76  * included in the \alibdist.
77  */
78  extern ALIB_API bool DbgIsBootstrapped;
79  }}
80 #endif
81 
82 
83 
84 
85 #endif // HPP_ALIB_FEATURES
aworx::lib::DbgCheckSingleThreaded
void DbgCheckSingleThreaded()
Definition: alib.cpp:62
aworx::lib::DbgIsBootstrapped
bool DbgIsBootstrapped
Definition: alib.cpp:17
platforms.hpp
aworx
Definition: alox/alox.hpp:40
ALIB_API
#define ALIB_API
Definition: compilers.hpp:150