ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
priorities.hpp
Go to the documentation of this file.
1/** ************************************************************************************************
2 * \file
3 * This header file is part of module \alib_config of the \aliblong.
4 *
5 * \emoji :copyright: 2013-2024 A-Worx GmbH, Germany.
6 * Published under \ref mainpage_license "Boost Software License".
7 **************************************************************************************************/
8#ifndef HPP_ALIB_CONFIG_PRIORITIES
9#define HPP_ALIB_CONFIG_PRIORITIES 1
10
11#if !defined (HPP_ALIB_ENUMS_ARITHMETICAL)
13#endif
14
15ALIB_ASSERT_MODULE(CONFIGURATION)
16
17#if !defined (HPP_ALIB_ENUMS_RECORDS)
18# include "alib/enums/records.hpp"
19#endif
20
21#if !defined (HPP_ALIB_BOXING_BOXING)
22# include "alib/boxing/boxing.hpp"
23#endif
24
25#if !defined (_GLIBCXX_NUMERIC_LIMITS) && !defined(_LIMITS_)
26# include <limits>
27#endif
28
29namespace alib { namespace config {
30
31
32/** ************************************************************************************************
33 * \alib{enums;T_EnumIsArithmetical;Arithmetical enumeration} used to prioritize
34 * of type \alib{config;ConfigurationPlugin} objects attached to instances of
35 * class \alib{config;Configuration}.
36 **************************************************************************************************/
37enum class Priorities
38{
39 /**
40 * Used to store protected values. By default, a plug-in of type \alib{config;InMemoryPlugin} is
41 * installed here. No other plug-in can overwrite configuration variables which are
42 * defined in a plug-in with this priority.<br>
43 * The underlying integral value is <c>std::numeric_limits<int>::max()</c>.
44 */
45 ProtectedValues = (std::numeric_limits<int>::max)(),
46
47 /**
48 * Used with plug-in \alib{config;CLIArgs}. The underlying integral value is \c 40000.
49 */
50 CLI = 40000,
51
52 /**
53 * Used with plug-in \alib{config;Environment}. The underlying integral value is \c 30,000.
54 */
55 Environment = 30000,
56
57 /**
58 * Used to attach the main application configuration plug-in. For example an plug-in of type
59 * \alib{config;IniFile}. The underlying integral value is \c 20,000.
60 */
61 Standard = 20000,
62
63 /**
64 * Used to store default values. By default, a plug-in of type \alib{config;InMemoryPlugin} is
65 * installed here.. The underlying integral value is \c 10,000.
66 */
67 DefaultValues = 10000,
68
69 /**
70 * Constant providing a priority which is even lower than default. This priority is not used by
71 * any standard plug-ins and currently not even anywhere in detail \alib. The rationale to
72 * provide it, is for third party libraries that may use this value in cases where values are
73 * estimated or detected instead of defaulted.<br>
74 * A user of the module may then overwrite such auto-detection by setting a default value in
75 * the configuration.<br>
76 * The underlying integral value is \c 500.
77 */
78 AutoDetected = 500,
79
80 /** Used to denote that no variable or plug-in was found. */
81 NONE = 0,
82
83};
84
85/** ************************************************************************************************
86 * \ref alib_enums_records "ALib Enum Record" associated with enumeration \alib{config;Priorities}.
87 **************************************************************************************************/
89{
90 /** The precedence of an operator in respect to other binary operators. */
92
93 /**
94 * Required default constructor leaving the record undefined
95 * (Requirement is documented with\alib{enums::EnumRecordPrototype}.)
96 */
97 ERPriorities() noexcept = default;
98
99 /** Implementation of \alib{enums;EnumRecordPrototype::Parse}. */
101 void Parse();
102};
103
104} // namespace alib::[config]
105
106/// Type alias in namespace \b alib.
107using Priorities= alib::config::Priorities;
108
109} // namespace [alib]
110
111// #################################################################################################
112// Macros
113// #################################################################################################
114ALIB_BOXING_VTABLE_DECLARE( alib::config::Priorities, vt_config_priorities )
117
118#endif // HPP_ALIB_CONFIG_PRIORITIES
#define ALIB_ASSERT_MODULE(modulename)
Definition alib.hpp:190
#define ALIB_ENUMS_ASSIGN_RECORD(TEnum, TRecord)
Definition records.hpp:752
#define ALIB_API
Definition alib.hpp:538
#define ALIB_BOXING_VTABLE_DECLARE(TMapped, Identifier)
Definition vtable.inl:477
#define ALIB_ENUMS_MAKE_ARITHMETICAL(TEnum)
Definition alib.cpp:57
ERPriorities() noexcept=default
ALIB_API void Parse()
Definition config.cpp:112