BDE 4.14.0 Production release
Loading...
Searching...
No Matches
s_baltst_generatetestchoice.h
Go to the documentation of this file.
1/// @file s_baltst_generatetestchoice.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// s_baltst_generatetestchoice.h -*-C++-*-
8#ifndef INCLUDED_S_BALTST_GENERATETESTCHOICE
9#define INCLUDED_S_BALTST_GENERATETESTCHOICE
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup s_baltst_generatetestchoice s_baltst_generatetestchoice
15/// @brief Provide a component for generating test choice types.
16/// @addtogroup Standalones
17/// @{
18/// @addtogroup s_baltst
19/// @{
20/// @addtogroup s_baltst_generatetestchoice
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#s_baltst_generatetestchoice-purpose"> Purpose</a>
25/// * <a href="#s_baltst_generatetestchoice-classes"> Classes </a>
26///
27/// # Purpose {#s_baltst_generatetestchoice-purpose}
28/// Provide a component for generating test choice types.
29///
30/// # Classes {#s_baltst_generatetestchoice-classes}
31///
32/// - s_baltst::GenerateTestChoice: generate test choice
33/// - s_baltst::GenerateTestChoicePlaceHolder: generate test choice placeholder
34/// @}
35/** @} */
36/** @} */
37
38/** @addtogroup Standalones
39 * @{
40 */
41/** @addtogroup s_baltst
42 * @{
43 */
44/** @addtogroup s_baltst_generatetestchoice
45 * @{
46 */
47/
48#include <s_baltst_testchoice.h>
51
52#include <bslmf_assert.h>
53
54
55namespace s_baltst {
56
57 // ========================
58 // class GenerateTestChoice
59 // ========================
60
61/// This in-core value-semantic class provides a function object whose
62/// function call operator can be used to generate objects of
63/// specializations of `TestChoice`.
64///
65/// See @ref s_baltst_generatetestchoice
67
68 public:
69 // TYPES
71
72 // CREATORS
74
75 // ACCESSORS
76 template <class SELECTION_0, class TYPE_0>
78 const SELECTION_0& selection,
79 const TYPE_0& value) const;
80
81 template <class SELECTION_0, class SELECTION_1, class TYPE_0, class TYPE_1>
84 operator()(const SELECTION_0& selection0,
85 const SELECTION_1& selection1,
86 const TYPE_0& value,
87 const TestPlaceHolder<TYPE_1>& placeHolder) const;
88
89 template <class SELECTION_0, class SELECTION_1, class TYPE_0, class TYPE_1>
92 operator()(const SELECTION_0& selection0,
93 const SELECTION_1& selection1,
94 const TestPlaceHolder<TYPE_0>& placeHolder,
95 const TYPE_1& value) const;
96};
97
98 // ===================================
99 // class GenerateTestChoicePlaceHolder
100 // ===================================
101
102/// This in-core value-semantic class provides a function object whose
103/// function call operator can be used to generate objects of
104/// specializations of `TestChoice`.
105///
106/// See @ref s_baltst_generatetestchoice
108
109 public:
110 // TYPES
112
113 // CREATORS
115
116 // ACCESSORS
117 template <class SELECTION_0, class TYPE_0>
119 operator()(const SELECTION_0&, const TestPlaceHolder<TYPE_0>&) const;
120
121 template <class SELECTION_0, class SELECTION_1, class TYPE_0, class TYPE_1>
124 operator()(const SELECTION_0&,
125 const SELECTION_1&,
127 const TestPlaceHolder<TYPE_1>&) const;
128};
129
130
131// ============================================================================
132// INLINE DEFINITIONS
133// ============================================================================
134
135 // ------------------------
136 // class GenerateTestChoice
137 // ------------------------
138
139// CREATORS
140inline
144
145// ACCESSORS
146template <class SELECTION_0, class TYPE_0>
148GenerateTestChoice::operator()(const SELECTION_0& selection,
149 const TYPE_0& value) const
150{
151 return Util::generate(selection, value);
152}
153
154template <class SELECTION_0, class SELECTION_1, class TYPE_0, class TYPE_1>
158operator()(const SELECTION_0& selection0,
159 const SELECTION_1& selection1,
160 const TYPE_0& value,
161 const TestPlaceHolder<TYPE_1>& placeHolder) const
162{
163 return Util::generate(selection0, selection1, value, placeHolder);
164}
165
166template <class SELECTION_0, class SELECTION_1, class TYPE_0, class TYPE_1>
169GenerateTestChoice::operator()(const SELECTION_0& selection0,
170 const SELECTION_1& selection1,
171 const TestPlaceHolder<TYPE_0>& placeHolder,
172 const TYPE_1& value) const
173{
174 return Util::generate(selection0, selection1, placeHolder, value);
175}
176
177 // -----------------------------------
178 // class GenerateTestChoicePlaceHolder
179 // -----------------------------------
180
181// CREATORS
182inline
186
187// ACCESSORS
188template <class SELECTION_0, class TYPE_0>
191 const TestPlaceHolder<TYPE_0>&) const
192{
194 typedef TestChoice<Selection0> Choice;
195
197}
198
199template <class SELECTION_0, class SELECTION_1, class TYPE_0, class TYPE_1>
203 const SELECTION_1&,
205 const TestPlaceHolder<TYPE_1>&) const
206{
210
212}
213
214} // close package namespace
215
216
217#endif // INCLUDED_S_BALTST_GENERATETESTCHOICE
218
219// ----------------------------------------------------------------------------
220// Copyright 2021 Bloomberg Finance L.P.
221//
222// Licensed under the Apache License, Version 2.0 (the "License");
223// you may not use this file except in compliance with the License.
224// You may obtain a copy of the License at
225//
226// http://www.apache.org/licenses/LICENSE-2.0
227//
228// Unless required by applicable law or agreed to in writing, software
229// distributed under the License is distributed on an "AS IS" BASIS,
230// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
231// See the License for the specific language governing permissions and
232// limitations under the License.
233// ----------------------------- END-OF-FILE ----------------------------------
234
235/** @} */
236/** @} */
237/** @} */
Definition s_baltst_generatetestchoice.h:107
GenerateTestChoicePlaceHolder()
Definition s_baltst_generatetestchoice.h:183
TestPlaceHolder< TestChoice< TypedTestSelection< TYPE_0, SELECTION_0 > > > operator()(const SELECTION_0 &, const TestPlaceHolder< TYPE_0 > &) const
Definition s_baltst_generatetestchoice.h:190
TestChoiceUtil Util
Definition s_baltst_generatetestchoice.h:111
Definition s_baltst_generatetestchoice.h:66
GenerateTestChoice()
Definition s_baltst_generatetestchoice.h:141
TestChoiceUtil Util
Definition s_baltst_generatetestchoice.h:70
TestChoice< TypedTestSelection< TYPE_0, SELECTION_0 > > operator()(const SELECTION_0 &selection, const TYPE_0 &value) const
Definition s_baltst_generatetestchoice.h:148
Definition s_baltst_testchoice.h:130
Definition s_baltst_testplaceholder.h:63
Definition s_baltst_testselection.h:121
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition s_baltst_address.h:66
Definition s_baltst_testchoiceutil.h:58
static TestChoice< TypedTestSelection< TYPE_0, SELECTION_0 > > generate(const SELECTION_0 &, const TYPE_0 &value)
Definition s_baltst_testchoiceutil.h:92