ALib C++ Library
Library Version: 2402 R1
Documentation generated by doxygen
Loading...
Searching...
No Matches
commonenumdefs.hpp
Go to the documentation of this file.
1/** ************************************************************************************************
2 * \file
3 * This header file is part of the \aliblong. It does not belong to an \alibmod and is
4 * included in any \alibdist.
5 *
6 * \note
7 * Generally, if \alib_enums is included in the \alibdist, header file
8 * \alibheader{lang/commonenums.hpp} should be included instead of this header,
9 * which, in addition to including this header, also defines
10 * \ref alib_enums_records "ALib Enum Records" for the common enums.
11 *
12 * \emoji :copyright: 2013-2024 A-Worx GmbH, Germany.
13 * Published under \ref mainpage_license "Boost Software License".
14 **************************************************************************************************/
15#ifndef HPP_ALIB_LANG_COMMONENUMS_DEFS
16#define HPP_ALIB_LANG_COMMONENUMS_DEFS 1
17
18#if !defined(HPP_ALIB) && !defined(ALIB_DOX)
19# include "alib/alib.hpp"
20#endif
21
22namespace alib::lang {
23
24// CodeMarker_CommonEnums
25
26/** ************************************************************************************************
27 * Denotes Alignments.
28 **************************************************************************************************/
29enum class Alignment
30{
31 Left, ///< Chooses left alignment.
32 Right, ///< Chooses right alignment.
33 Center ///< Chooses centered alignment.
34};
35
36/** ************************************************************************************************
37 * Enumeration representing a boolean value. While the use of this enumeration type seems senseless
38 * at the first sight (as the C++ has keywords \c bool, \c false and \c true), the reason for its
39 * existence is to have write and parse methods in place using the concept of
40 * \ref alib_enums_records "ALib Enum Records".
41 *
42 * The default name translation table is equipped with various 'overloaded' element entries like
43 * "yes", "no", "on", "off", "1" or "0". Furthermore, if other languages should be supported,
44 * this can even be extended at run-time.
45 **************************************************************************************************/
46enum class Bool : bool
47{
48 False, ///< False value
49 True ///< True value
50};
51
52/** ************************************************************************************************
53 * Denotes if a cache mechanism is enabled or disabled.
54 **************************************************************************************************/
55enum class Caching
56{
57 Disabled, ///< Caching is disabled.
58 Enabled, ///< Caching is enabled.
59 Auto, ///< Auto/default mode.
60};
61
62/** ************************************************************************************************
63 * Denotes upper and lower case character treatment.
64 **************************************************************************************************/
65DOX_MARKER( [DOX_ALIB_ENUMS_MAKE_PARSABLE_1] )
66enum class Case : bool
67{
68 Sensitive, ///< Chooses an operation mode which differs between lower and upper case letters
69 ///< (usually the default).
70 Ignore ///< Chooses an operation mode which does not differ between between lower and
71 ///< upper case letters.
72};
73DOX_MARKER( [DOX_ALIB_ENUMS_MAKE_PARSABLE_1] )
74
75/** ************************************************************************************************
76 * Denotes standard container operations.
77 **************************************************************************************************/
78enum class ContainerOp
79{
80 Insert, ///< Denotes insertions.
81 Remove, ///< Denotes removals.
82 Get, ///< Denotes to search data.
83 GetCreate, ///< Denotes to create data if not found.
84 Create ///< Denotes to create data.
85};
86
87/** ************************************************************************************************
88 * Denotes whether default entities should be created or not.
89 **************************************************************************************************/
90enum class CreateDefaults : bool
91{
92 No, ///< Do not create.
93 Yes ///< Create default values.
94};
95
96/** ************************************************************************************************
97 * Denotes whether something should be created if it does not exist.
98 **************************************************************************************************/
99enum class CreateIfNotExists : bool
100{
101 No, ///< Do not create.
102 Yes ///< Create if something does not exist.
103};
104
105/** ************************************************************************************************
106 * Denotes if current, existing data should be cleared or if new data should be
107 * appended or otherwise added.
108 **************************************************************************************************/
109enum class CurrentData : bool
110{
111 Keep, ///< Chooses not no clear existing data.
112 Clear, ///< Chooses to clear existing data.
113};
114
115/** ************************************************************************************************
116 * Denotes how members of a set something should be taken into account.
117 **************************************************************************************************/
118enum class Inclusion : bool
119{
120 Include, ///< Chooses inclusion.
121 Exclude, ///< Chooses exclusion.
122};
123
124/** ************************************************************************************************
125 * Used for example with constructors that allow to suppress initialization of members.
126 **************************************************************************************************/
128{
129 Suppress, ///< Suppress initialization.
130 ///< Writes "DontInitialize", reads in addition "suppress".
131 Perform, ///< Perform initialization.
132 ///< Writes "Initialize", reads in addition "perform".
133};
134
135/** ************************************************************************************************
136 * Denotes a phase, e.g. of a transaction.
137 **************************************************************************************************/
138enum class Phase
139{
140 Begin = (1 << 0), ///< The start of a transaction.
141 End = (1 << 1), ///< The end of a transaction.
142};
143
144/** ************************************************************************************************
145 * Denotes whether a e.g a setting should be propagated.
146 **************************************************************************************************/
147enum class Propagation : bool
148{
149 Omit, ///< Do not propagate changes.
150 ToDescendants ///< Propagate changes to descendants/children/sub-components.
151};
152
153/** ************************************************************************************************
154 * Denotes the reach of something.
155 **************************************************************************************************/
156enum class Reach : bool
157{
158 Global, ///< Denotes global reach.
159 Local ///< Denotes local reach.
160};
161
162/** ************************************************************************************************
163 * Denotes whether recursion is performed/allowed or not.
164 **************************************************************************************************/
165enum class Recursive : bool
166{
167 No, ///< Denotes non-recursive.
168 Yes ///< Denotes recursion.
169};
170
171/** ************************************************************************************************
172 * Denotes whether the responsibility for something is kept or passed. This is useful, e.g. in
173 * situations where objects are shared to determine if the responsibility for the deletion
174 * of object is transferred over to the receiver or kept by the sender of the object.
175 **************************************************************************************************/
176enum class Responsibility : bool
177{
178 KeepWithSender, ///< Keeps responsibility, e.g. when passing an object.
179 Transfer, ///< Transfers responsibility to the receiving party.
180};
181
182/** ************************************************************************************************
183 * Denotes whether something should be performed in a safe or unsafe fashion.
184 **************************************************************************************************/
185enum class Safeness : bool
186{
187 Safe, ///< Do it or treat it with safety.
188 Unsafe, ///< Omit checks or perform unsafe operations.
189};
190
191/** ************************************************************************************************
192 * Denotes if something is left or right.
193 **************************************************************************************************/
194enum class Side : bool
195{
196 Left, ///< Denotes the left side of something.
197 Right ///< Denotes the right side of something.
198};
199
200/** ************************************************************************************************
201 * Denotes sort order.
202 **************************************************************************************************/
203enum class SortOrder : bool
204{
205 Ascending, ///< Chooses ascending sort oder.
206 Descending, ///< Chooses descending sort oder.
207};
208
209/** ************************************************************************************************
210 * Denotes if the source data should be moved or copied.
211 **************************************************************************************************/
212enum class SourceData : bool
213{
214 Copy, ///< Chooses not to clear existing data.
215 Move, ///< Chooses to clear existing data.
216};
217
218/** ************************************************************************************************
219 * Denotes if sth. is switched on or off.
220 **************************************************************************************************/
221enum class Switch : bool
222{
223 Off, ///< Switch it off, switched off, etc.
224 On ///< Switch it on, switched on, etc.
225};
226
227/** ************************************************************************************************
228 * Denotes whether a time value represents local time or UTC.
229 **************************************************************************************************/
230enum class Timezone : bool
231{
232 Local, ///< Denotes local time.
233 UTC, ///< Denotes UTC (coordinated universal time).
234};
235
236/** ************************************************************************************************
237 * Denotes if asynchronous tasks become synchronized.
238 **************************************************************************************************/
239enum class Timing
240{
241 Async, ///< The end of a transaction.
242 ///< Writes "Async", reads in addition "asynchronous", "no", "off", "false", "0" "-".
243 Sync, ///< The start of a transaction.
244 ///< Writes "Sync", reads in addition "synchronous", "synchronized", "synced" "yes",
245 ///< "on", "true", "1".
246};
247
248/** ************************************************************************************************
249 * Denotes if a value is interpreted as an absolute or relative number.
250 **************************************************************************************************/
252{
253 Absolute, ///< Referring to an absolute value.
254 Relative, ///< Referring to a relative value.
255};
256
257/** ************************************************************************************************
258 * Denotes whether a string is trimmed or not
259 **************************************************************************************************/
260enum class Whitespaces : bool
261{
262 Trim, ///< Trim whitespaces away.
263 Keep ///< Keep whitespaces in string.
264};
265
266
267} // namespace [alib::lang]
268
269
270
271
272#endif // HPP_ALIB_LANG_COMMONENUMS_DEFS
@ Exclude
Chooses exclusion.
@ Include
Chooses inclusion.
@ Relative
Referring to a relative value.
@ Absolute
Referring to an absolute value.
@ Trim
Trim whitespaces away.
@ Yes
Create default values.
@ Enabled
Caching is enabled.
@ Auto
Auto/default mode.
@ Disabled
Caching is disabled.
@ Omit
Do not propagate changes.
@ ToDescendants
Propagate changes to descendants/children/sub-components.
@ True
True value.
@ False
False value.
@ On
Switch it on, switched on, etc.
@ Off
Switch it off, switched off, etc.
@ Safe
Do it or treat it with safety.
@ Unsafe
Omit checks or perform unsafe operations.
@ Ascending
Chooses ascending sort oder.
@ Descending
Chooses descending sort oder.
@ Global
Denotes global reach.
@ Local
Denotes local reach.
@ Copy
Chooses not to clear existing data.
@ Move
Chooses to clear existing data.
@ UTC
Denotes UTC (coordinated universal time).
@ Keep
Chooses not no clear existing data.
@ Clear
Chooses to clear existing data.
@ KeepWithSender
Keeps responsibility, e.g. when passing an object.
@ Transfer
Transfers responsibility to the receiving party.
@ Center
Chooses centered alignment.
@ Right
Chooses right alignment.
@ Left
Chooses left alignment.
@ Begin
The start of a transaction.
@ End
The end of a transaction.
@ Remove
Denotes removals.
@ GetCreate
Denotes to create data if not found.
@ Create
Denotes to create data.
@ Insert
Denotes insertions.
@ Get
Denotes to search data.