ALib C++ Library
Library Version: 2412 R0
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#pragma once
18#if !defined(DOXYGEN)
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_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_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 "Suppress", reads in addition "None".
131 Default, ///< Perform default initialization.
132 ///< Writes "Default", reads in addition "Initialize".
133 Nulled, ///< Perform initialization with a nulled value.
134 ///< Writes "Nulled", reads in addition "Zero".
135};
136
137//==================================================================================================
138/// Denotes a phase, e.g.,of a transaction.
139//==================================================================================================
140enum class Phase
141{
142 Begin = (1 << 0), ///< The start of a transaction.
143 End = (1 << 1), ///< The end of a transaction.
144};
145
146//==================================================================================================
147/// Denotes whether a e.g a setting should be propagated.
148//==================================================================================================
149enum class Propagation : bool
150{
151 Omit, ///< Do not propagate changes.
152 ToDescendants ///< Propagate changes to descendants/children/subcomponents.
153};
154
155//==================================================================================================
156/// Denotes the reach of something.
157//==================================================================================================
158enum class Reach : bool
159{
160 Global, ///< Denotes global reach.
161 Local ///< Denotes local reach.
162};
163
164//==================================================================================================
165/// Denotes whether recursion is performed/allowed or not.
166//==================================================================================================
167enum class Recursive : bool
168{
169 No, ///< Denotes non-recursive.
170 Yes ///< Denotes recursion.
171};
172
173//==================================================================================================
174/// Denotes whether the responsibility for something is kept or passed. This is useful, e.g., in
175/// situations where objects are shared to determine if the responsibility for the deletion
176/// of object is transferred over to the receiver or kept by the sender of the object.
177//==================================================================================================
178enum class Responsibility : bool
179{
180 KeepWithSender, ///< Keeps responsibility, e.g., when passing an object.
181 Transfer, ///< Transfers responsibility to the receiving party.
182};
183
184//==================================================================================================
185/// Denotes whether something should be performed in a safe or unsafe fashion.
186//==================================================================================================
187enum class Safeness : bool
188{
189 Safe, ///< Do it or treat it with safety.
190 Unsafe, ///< Omit checks or perform unsafe operations.
191};
192
193//==================================================================================================
194/// Denotes if something is left or right.
195//==================================================================================================
196enum class Side : bool
197{
198 Left, ///< Denotes the left side of something.
199 Right ///< Denotes the right side of something.
200};
201
202//==================================================================================================
203/// Denotes sort order.
204//==================================================================================================
205enum class SortOrder : bool
206{
207 Ascending, ///< Chooses ascending sort oder.
208 Descending, ///< Chooses descending sort oder.
209};
210
211//==================================================================================================
212/// Denotes if the source data should be moved or copied.
213//==================================================================================================
214enum class SourceData : bool
215{
216 Copy, ///< Chooses not to clear existing data.
217 Move, ///< Chooses to clear existing data.
218};
219
220//==================================================================================================
221/// Denotes if sth. is switched on or off.
222//==================================================================================================
223enum class Switch : bool
224{
225 Off, ///< Switch it off, switched off, etc.
226 On ///< Switch it on, switched on, etc.
227};
228
229//==================================================================================================
230/// Denotes whether a time value represents local time or UTC.
231//==================================================================================================
232enum class Timezone : bool
233{
234 Local, ///< Denotes local time.
235 UTC, ///< Denotes UTC (coordinated universal time).
236};
237
238//==================================================================================================
239/// Denotes if asynchronous tasks become synchronized.
240//==================================================================================================
241enum class Timing
242{
243 Async, ///< The end of a transaction.
244 ///< Writes "Async", reads in addition "asynchronous", "no", "off", "false", "0" "-".
245 Sync, ///< The start of a transaction.
246 ///< Writes "Sync", reads in addition "synchronous", "synchronized", "synced" "yes",
247 ///< "on", "true", "1".
248};
249
250//==================================================================================================
251/// Denotes if a value is interpreted as an absolute or relative number.
252//==================================================================================================
254{
255 Absolute, ///< Referring to an absolute value.
256 Relative, ///< Referring to a relative value.
257};
258
259//==================================================================================================
260/// Denotes whether a string is trimmed or not
261//==================================================================================================
262enum class Whitespaces : bool
263{
264 Trim, ///< Trim whitespaces away.
265 Keep ///< Keep whitespaces in string.
266};
267
268
269} // namespace [alib::lang]
270
271
272
273
274#endif // HPP_ALIB_LANG_COMMONENUMS_DEFS
275
Recursive
Denotes whether recursion is performed/allowed or not.
Inclusion
Denotes how members of a set something should be taken into account.
@ Exclude
Chooses exclusion.
@ Include
Chooses inclusion.
ValueReference
Denotes if a value is interpreted as an absolute or relative number.
@ Relative
Referring to a relative value.
@ Absolute
Referring to an absolute value.
Whitespaces
Denotes whether a string is trimmed or not.
@ Trim
Trim whitespaces away.
CreateDefaults
Denotes whether default entities should be created or not.
@ Yes
Create default values.
Caching
Denotes if a cache mechanism is enabled or disabled.
@ Enabled
Caching is enabled.
@ Auto
Auto/default mode.
@ Disabled
Caching is disabled.
Side
Denotes if something is left or right.
Propagation
Denotes whether a e.g a setting should be propagated.
@ Omit
Do not propagate changes.
@ ToDescendants
Propagate changes to descendants/children/subcomponents.
@ True
True value.
@ False
False value.
Switch
Denotes if sth. is switched on or off.
@ On
Switch it on, switched on, etc.
@ Off
Switch it off, switched off, etc.
Initialization
Used for example with constructors that allow to suppress initialization of members.
Safeness
Denotes whether something should be performed in a safe or unsafe fashion.
@ Safe
Do it or treat it with safety.
@ Unsafe
Omit checks or perform unsafe operations.
SortOrder
Denotes sort order.
@ Ascending
Chooses ascending sort oder.
@ Descending
Chooses descending sort oder.
Reach
Denotes the reach of something.
@ Global
Denotes global reach.
@ Local
Denotes local reach.
SourceData
Denotes if the source data should be moved or copied.
@ Copy
Chooses not to clear existing data.
@ Move
Chooses to clear existing data.
Timezone
Denotes whether a time value represents local time or UTC.
@ UTC
Denotes UTC (coordinated universal time).
@ Keep
Chooses not no clear existing data.
@ Clear
Chooses to clear existing data.
Case
Denotes upper and lower case character treatment.
@ KeepWithSender
Keeps responsibility, e.g., when passing an object.
@ Transfer
Transfers responsibility to the receiving party.
Alignment
Denotes Alignments.
@ Center
Chooses centered alignment.
@ Right
Chooses right alignment.
@ Left
Chooses left alignment.
Timing
Denotes if asynchronous tasks become synchronized.
CreateIfNotExists
Denotes whether something should be created if it does not exist.
Phase
Denotes a phase, e.g.,of a transaction.
@ Begin
The start of a transaction.
@ End
The end of a transaction.
ContainerOp
Denotes standard container operations.
@ Remove
Denotes removals.
@ GetCreate
Denotes to create data if not found.
@ Create
Denotes to create data.
@ Insert
Denotes insertions.
@ Get
Denotes to search data.