BDE 4.39.x 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`.
67///
68/// See @ref s_baltst_testselection
70
71 // CLASS DATA
72 static const char k_DEFAULT_ANNOTATION[1];
73 static const char k_DEFAULT_NAME[1];
75};
76
77 // ===================
78 // class TestSelection
79 // ===================
80
81/// This class provides a namespace for a suite of non-modifiable,
82/// constant-initialized data that can be used to specify all attribute of a
83/// `bdlat_SelectionInfo` object.
84template <int ID,
86
87 const char *ANNOTATION = TestSelectionDefaults::k_DEFAULT_ANNOTATION,
88 int FORMATTING_MODE =
91
92 public:
93 // PUBLIC CLASS DATA
94 static const char *k_NAME;
95 static const char *k_ANNOTATION;
96 enum { k_ID = ID, k_FORMATTING_MODE = FORMATTING_MODE };
97
98 // CLASS METHODS
99 static int id();
100
101 static bsl::string_view name();
102
104
105 static int formattingMode();
106
108
109 // CREATORS
111};
112
113 // ========================
114 // class TypedTestSelection
115 // ========================
116
117/// This class provides two member type definitions, `Type` and `Selection`,
118/// which are aliases to the arguments supplied to the `TYPE` and
119/// `TEST_SELECTION` template parameters, respectively.
120///
121/// See @ref s_baltst_testselection
122template <class TYPE, class TEST_SELECTION>
124
125 public:
126 // TYPES
127 typedef TYPE Type;
128 typedef TEST_SELECTION Selection;
129};
130
131// ============================================================================
132// INLINE DEFINITIONS
133// ============================================================================
134
135 // -------------------
136 // class TestSelection
137 // -------------------
138
139// PUBLIC CLASS DATA
140template <int ID,
141 const char *NAME,
142 const char *ANNOTATION,
143 int FORMATTING_MODE>
145 NAME;
146
147template <int ID,
148 const char *NAME,
149 const char *ANNOTATION,
150 int FORMATTING_MODE>
151const char
153 ANNOTATION;
154
155// CLASS METHODS
156template <int ID,
157 const char *NAME,
158 const char *ANNOTATION,
159 int FORMATTING_MODE>
164
165template <int ID,
166 const char *NAME,
167 const char *ANNOTATION,
168 int FORMATTING_MODE>
173
174template <int ID,
175 const char *NAME,
176 const char *ANNOTATION,
177 int FORMATTING_MODE>
183
184template <int ID,
185 const char *NAME,
186 const char *ANNOTATION,
187 int FORMATTING_MODE>
192
193template <int ID,
194 const char *NAME,
195 const char *ANNOTATION,
196 int FORMATTING_MODE>
199{
200 bdlat_SelectionInfo result = {k_ID,
201 k_NAME,
202 static_cast<int>(bsl::strlen(k_NAME)),
203 k_ANNOTATION,
204 k_FORMATTING_MODE};
205
206 return result;
207}
208
209// CREATORS
210template <int ID,
211 const char *NAME,
212 const char *ANNOTATION,
213 int FORMATTING_MODE>
217
218} // close package namespace
219
220
221#endif // INCLUDED_S_BALTST_TESTSELECTION
222
223// ----------------------------------------------------------------------------
224// Copyright 2021 Bloomberg Finance L.P.
225//
226// Licensed under the Apache License, Version 2.0 (the "License");
227// you may not use this file except in compliance with the License.
228// You may obtain a copy of the License at
229//
230// http://www.apache.org/licenses/LICENSE-2.0
231//
232// Unless required by applicable law or agreed to in writing, software
233// distributed under the License is distributed on an "AS IS" BASIS,
234// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
235// See the License for the specific language governing permissions and
236// limitations under the License.
237// ----------------------------- END-OF-FILE ----------------------------------
238
239/** @} */
240/** @} */
241/** @} */
Definition bslstl_stringview.h:471
Definition s_baltst_testselection.h:90
static int id()
Definition s_baltst_testselection.h:160
static const char * k_ANNOTATION
Definition s_baltst_testselection.h:95
TestSelection()
Definition s_baltst_testselection.h:214
static bsl::string_view annotation()
Definition s_baltst_testselection.h:179
@ k_ID
Definition s_baltst_testselection.h:96
@ k_FORMATTING_MODE
Definition s_baltst_testselection.h:96
static int formattingMode()
Definition s_baltst_testselection.h:188
static bsl::string_view name()
Definition s_baltst_testselection.h:169
static bdlat_SelectionInfo selectionInfo()
Definition s_baltst_testselection.h:198
static const char * k_NAME
Definition s_baltst_testselection.h:94
Definition s_baltst_testselection.h:123
TYPE Type
Definition s_baltst_testselection.h:127
TEST_SELECTION Selection
Definition s_baltst_testselection.h:128
#define BSLS_IDENT(str)
BSLS_IDENT() - insert string into .comment binary segment (if supported)
Definition bsls_ident.h:238
Definition s_baltst_address.h:66
Definition bdlat_selectioninfo.h:138
Definition s_baltst_testselection.h:69
static const char k_DEFAULT_NAME[1]
Definition s_baltst_testselection.h:73
@ k_DEFAULT_FORMATTING_MODE
Definition s_baltst_testselection.h:74
static const char k_DEFAULT_ANNOTATION[1]
Definition s_baltst_testselection.h:72