BDE 4.14.0 Production release
Loading...
Searching...
No Matches
s_baltst_testselection.h
Go to the documentation of this file.
1/// @file s_baltst_testselection.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// s_baltst_testselection.h -*-C++-*-
8#ifndef INCLUDED_S_BALTST_TESTSELECTION
9#define INCLUDED_S_BALTST_TESTSELECTION
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup s_baltst_testselection s_baltst_testselection
15/// @brief Provide selection metadata types for test choices.
16/// @addtogroup Standalones
17/// @{
18/// @addtogroup s_baltst
19/// @{
20/// @addtogroup s_baltst_testselection
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#s_baltst_testselection-purpose"> Purpose</a>
25/// * <a href="#s_baltst_testselection-classes"> Classes </a>
26///
27/// # Purpose {#s_baltst_testselection-purpose}
28/// Provide selection metadata types for test choices.
29///
30/// # Classes {#s_baltst_testselection-classes}
31///
32/// - s_baltst::TestSelection: selection metadata for test choices
33/// - s_baltst::TestSelection1: an example selection
34/// - s_baltst::TestSelection2: an example selection
35/// - s_baltst::TestSelectionDefaults: defaults
36/// - s_baltst::TypedTestSelection: selection metadata with value type
37/// @}
38/** @} */
39/** @} */
40
41/** @addtogroup Standalones
42 * @{
43 */
44/** @addtogroup s_baltst
45 * @{
46 */
47/** @addtogroup s_baltst_testselection
48 * @{
49 */
50/
51#include <bdlat_selectioninfo.h>
52
53#include <bsl_cstring.h>
54#include <bsl_string.h>
55#include <bsl_string_view.h>
56
57
58namespace s_baltst {
59
60 // ============================
61 // struct TestSelectionDefaults
62 // ============================
63
64/// This utility `struct` provides a namespace for non-modifiable,
65/// constant-initialized default values for the non-type template parameters
66/// of a `TestSelection`.
68
69 // CLASS DATA
70 static const char k_DEFAULT_ANNOTATION[1];
71 static const char k_DEFAULT_NAME[1];
73};
74
75 // ===================
76 // class TestSelection
77 // ===================
78
79/// This class provides a namespace for a suite of non-modifiable,
80/// constant-initialized data that can be used to specify all attribute of a
81/// `bdlat_SelectionInfo` object.
82template <int ID,
84
85 const char *ANNOTATION = TestSelectionDefaults::k_DEFAULT_ANNOTATION,
86 int FORMATTING_MODE =
89
90 public:
91 // PUBLIC CLASS DATA
92 static const char *k_NAME;
93 static const char *k_ANNOTATION;
94 enum { k_ID = ID, k_FORMATTING_MODE = FORMATTING_MODE };
95
96 // CLASS METHODS
97 static int id();
98
99 static bsl::string_view name();
100
102
103 static int formattingMode();
104
106
107 // CREATORS
109};
110
111 // ========================
112 // class TypedTestSelection
113 // ========================
114
115/// This class provides two member type definitions, `Type` and `Selection`,
116/// which are aliases to the arguments supplied to the `TYPE` and
117/// `TEST_SELECTION` template parameters, respectively.
118///
119/// See @ref s_baltst_testselection
120template <class TYPE, class TEST_SELECTION>
122
123 public:
124 // TYPES
125 typedef TYPE Type;
126 typedef TEST_SELECTION Selection;
127};
128
129// ============================================================================
130// INLINE DEFINITIONS
131// ============================================================================
132
133 // -------------------
134 // class TestSelection
135 // -------------------
136
137// PUBLIC CLASS DATA
138template <int ID,
139 const char *NAME,
140 const char *ANNOTATION,
141 int FORMATTING_MODE>
143 NAME;
144
145template <int ID,
146 const char *NAME,
147 const char *ANNOTATION,
148 int FORMATTING_MODE>
149const char
151 ANNOTATION;
152
153// CLASS METHODS
154template <int ID,
155 const char *NAME,
156 const char *ANNOTATION,
157 int FORMATTING_MODE>
162
163template <int ID,
164 const char *NAME,
165 const char *ANNOTATION,
166 int FORMATTING_MODE>
171
172template <int ID,
173 const char *NAME,
174 const char *ANNOTATION,
175 int FORMATTING_MODE>
181
182template <int ID,
183 const char *NAME,
184 const char *ANNOTATION,
185 int FORMATTING_MODE>
190
191template <int ID,
192 const char *NAME,
193 const char *ANNOTATION,
194 int FORMATTING_MODE>
197{
198 bdlat_SelectionInfo result = {k_ID,
199 k_NAME,
200 static_cast<int>(bsl::strlen(k_NAME)),
201 k_ANNOTATION,
202 k_FORMATTING_MODE};
203
204 return result;
205}
206
207// CREATORS
208template <int ID,
209 const char *NAME,
210 const char *ANNOTATION,
211 int FORMATTING_MODE>
215
216} // close package namespace
217
218
219#endif // INCLUDED_S_BALTST_TESTSELECTION
220
221// ----------------------------------------------------------------------------
222// Copyright 2021 Bloomberg Finance L.P.
223//
224// Licensed under the Apache License, Version 2.0 (the "License");
225// you may not use this file except in compliance with the License.
226// You may obtain a copy of the License at
227//
228// http://www.apache.org/licenses/LICENSE-2.0
229//
230// Unless required by applicable law or agreed to in writing, software
231// distributed under the License is distributed on an "AS IS" BASIS,
232// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
233// See the License for the specific language governing permissions and
234// limitations under the License.
235// ----------------------------- END-OF-FILE ----------------------------------
236
237/** @} */
238/** @} */
239/** @} */
Definition bslstl_stringview.h:441
Definition s_baltst_testselection.h:88
static int id()
Definition s_baltst_testselection.h:158
static const char * k_ANNOTATION
Definition s_baltst_testselection.h:93
TestSelection()
Definition s_baltst_testselection.h:212
static bsl::string_view annotation()
Definition s_baltst_testselection.h:177
static int formattingMode()
Definition s_baltst_testselection.h:186
static bsl::string_view name()
Definition s_baltst_testselection.h:167
@ k_ID
Definition s_baltst_testselection.h:94
@ k_FORMATTING_MODE
Definition s_baltst_testselection.h:94
static bdlat_SelectionInfo selectionInfo()
Definition s_baltst_testselection.h:196
static const char * k_NAME
Definition s_baltst_testselection.h:92
Definition s_baltst_testselection.h:121
TYPE Type
Definition s_baltst_testselection.h:125
TEST_SELECTION Selection
Definition s_baltst_testselection.h:126
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition s_baltst_address.h:66
Definition bdlat_selectioninfo.h:136
Definition s_baltst_testselection.h:67
static const char k_DEFAULT_NAME[1]
Definition s_baltst_testselection.h:71
@ k_DEFAULT_FORMATTING_MODE
Definition s_baltst_testselection.h:72
static const char k_DEFAULT_ANNOTATION[1]
Definition s_baltst_testselection.h:70