ALib C++ Library
by
Library Version:
2402 R1
Documentation generated by
Loading...
Searching...
No Matches
home
dev
A-Worx
ALib
src
alib
config
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)
12
#include "
alib/enums/arithmetical.hpp
"
13
#endif
14
15
ALIB_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
29
namespace
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
**************************************************************************************************/
37
enum 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
**************************************************************************************************/
88
struct
ERPriorities
:
enums::ERSerializable
89
{
90
/** The precedence of an operator in respect to other binary operators. */
91
int
Priority
;
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}. */
100
ALIB_API
101
void
Parse
();
102
};
103
104
}
// namespace alib::[config]
105
106
/// Type alias in namespace \b alib.
107
using
Priorities
=
alib
::config::
Priorities
;
108
109
}
// namespace [alib]
110
111
// #################################################################################################
112
// Macros
113
// #################################################################################################
114
ALIB_BOXING_VTABLE_DECLARE
(
alib
::config::
Priorities
, vt_config_priorities )
115
ALIB_ENUMS_MAKE_ARITHMETICAL
(
alib
::config::
Priorities
)
116
ALIB_ENUMS_ASSIGN_RECORD
(
alib
::config::
Priorities
,
alib
::config::
ERPriorities
)
117
118
#endif
// HPP_ALIB_CONFIG_PRIORITIES
arithmetical.hpp
boxing.hpp
alib::config::Environment
Definition
config/plugins.hpp:453
ALIB_ASSERT_MODULE
#define ALIB_ASSERT_MODULE(modulename)
Definition
alib.hpp:190
ALIB_ENUMS_ASSIGN_RECORD
#define ALIB_ENUMS_ASSIGN_RECORD(TEnum, TRecord)
Definition
records.hpp:752
ALIB_API
#define ALIB_API
Definition
alib.hpp:538
ALIB_BOXING_VTABLE_DECLARE
#define ALIB_BOXING_VTABLE_DECLARE(TMapped, Identifier)
Definition
vtable.inl:477
ALIB_ENUMS_MAKE_ARITHMETICAL
#define ALIB_ENUMS_MAKE_ARITHMETICAL(TEnum)
Definition
arithmetical.hpp:90
alib::config::Priorities
Priorities
Definition
priorities.hpp:38
alib::config::Priorities::ProtectedValues
@ ProtectedValues
alib::config::Priorities::CLI
@ CLI
alib::config::Priorities::AutoDetected
@ AutoDetected
alib::config::Priorities::NONE
@ NONE
alib::config::Priorities::Standard
@ Standard
alib::config::Priorities::DefaultValues
@ DefaultValues
alib
Definition
alib.cpp:57
records.hpp
alib::config::ERPriorities
Definition
priorities.hpp:89
alib::config::ERPriorities::Priority
int Priority
Definition
priorities.hpp:91
alib::config::ERPriorities::ERPriorities
ERPriorities() noexcept=default
alib::config::ERPriorities::Parse
ALIB_API void Parse()
Definition
config.cpp:112
alib::enums::ERSerializable
Definition
records.hpp:689