BDE 4.14.0 Production release
Loading...
Searching...
No Matches
s_baltst_testchoice.h
Go to the documentation of this file.
1/// @file s_baltst_testchoice.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// s_baltst_testchoice.h -*-C++-*-
8#ifndef INCLUDED_S_BALTST_TESTCHOICE
9#define INCLUDED_S_BALTST_TESTCHOICE
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup s_baltst_testchoice s_baltst_testchoice
15/// @brief Provide a test implementation of a `bdlat` "choice" type.
16/// @addtogroup Standalones
17/// @{
18/// @addtogroup s_baltst
19/// @{
20/// @addtogroup s_baltst_testchoice
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#s_baltst_testchoice-purpose"> Purpose</a>
25/// * <a href="#s_baltst_testchoice-classes"> Classes </a>
26///
27/// # Purpose {#s_baltst_testchoice-purpose}
28/// Provide a test implementation of a `bdlat` "choice" type.
29///
30/// # Classes {#s_baltst_testchoice-classes}
31///
32/// - s_baltst::TestChoice: test implementation of a `bdlat` "choice" type
33/// @}
34/** @} */
35/** @} */
36
37/** @addtogroup Standalones
38 * @{
39 */
40/** @addtogroup s_baltst
41 * @{
42 */
43/** @addtogroup s_baltst_testchoice
44 * @{
45 */
46/
47#include <bdlb_variant.h>
48
50
51#include <bslma_allocator.h>
52#include <bslma_default.h>
53
55#include <bslmf_issame.h>
56
57#include <bsls_assert.h>
58
60
63
64
65namespace s_baltst {
66
67 // ==========================
68 // struct TestChoice_ImplUtil
69 // ==========================
70
72
73 // CLASS METHODS
74 template <class ACCESSOR>
75 static int access(ACCESSOR& accessor,
76 const TestNilValue selection,
77 const bdlat_SelectionInfo& selectionInfo);
78 template <class ACCESSOR, class SELECTION>
79 static int access(ACCESSOR& accessor,
80 const SELECTION& selection,
81 const bdlat_SelectionInfo& selectionInfo);
82
83 template <class MANIPULATOR>
84 static int manipulate(MANIPULATOR& manipulator,
85 TestNilValue *selection,
86 const bdlat_SelectionInfo& selectionInfo);
87 template <class MANIPULATOR, class SELECTION>
88 static int manipulate(MANIPULATOR& manipulator,
89 SELECTION *selection,
90 const bdlat_SelectionInfo& selectionInfo);
91};
92
93
94 // ================
95 // class TestChoice
96 // ================
97
98/// This in-core value-semantic class provides a basic implementation of the
99/// concept defined by the `Choice` `bdlat` type category. The template
100/// parameters `TYPED_SELECTION_0`, `TYPED_SELECTION_1`, and
101/// `TYPED_SELECTION_2` must all satisfy the following requirements:
102/// * The type must have two member type definitions, `Type`, and
103/// `Selection`.
104/// * `Type` must meet the requirements of an in-core value-semantic type.
105/// * `Type` must meet the requirements of exactly one of the `bdlat` value
106/// categories.
107/// * `Selection` must be a specialization of the `TestSelection` type.
108/// Further, each `TestSelection` member type definition of a template
109/// argument must return values for `TestSelection::id()` and
110/// `TestSelection::name()` that are different from all others within this
111/// `TestChoice` specialization.
112///
113/// Additionally, The `Type` of any template argument may be `TestNilValue`
114/// if all `Type` member type definitions of subsequent template arguments
115/// are also `TestNilValue`.
116///
117/// The `Type` and `Selection` member type definitions of the template
118/// arguments define the type and `bdlat_SelectionInfo` of the selections of
119/// the `bdlat` `Choice` implementation provided by this class. A template
120/// argument having a `TestNilValue` `Type` indicates that the corresponding
121/// selection does not exist.
122///
123/// See @ref s_baltst_testchoice
124template <class TYPED_SELECTION_0 =
126 class TYPED_SELECTION_1 =
128 class TYPED_SELECTION_2 =
131
132 public:
133 // TYPES
134 typedef typename TYPED_SELECTION_0::Selection Selection0;
135 typedef typename TYPED_SELECTION_0::Type Selection0Type;
136 typedef typename TYPED_SELECTION_1::Selection Selection1;
137 typedef typename TYPED_SELECTION_1::Type Selection1Type;
138 typedef typename TYPED_SELECTION_2::Selection Selection2;
139 typedef typename TYPED_SELECTION_2::Type Selection2Type;
140
141 private:
142 // PRIVATE TYPES
145 Value;
146
147 // PRIVATE CLASS DATA
148 enum {
152 };
153
154 // DATA
155 bslalg::ConstructorProxy<Value> d_value; // underlying value
156 bslma::Allocator *d_allocator_p; // memory supply (held, not owned)
157
158 public:
159 // CLASS METHODS
160 static bool areEqual(const TestChoice& lhs, const TestChoice& rhs);
161
162 // CREATORS
163 TestChoice();
164
165 explicit TestChoice(bslma::Allocator *basicAllocator);
166
167 template <class VALUE>
168 explicit TestChoice(const VALUE& value,
169 bslma::Allocator *basicAllocator = 0);
170
171 TestChoice(const TestChoice& original,
172 bslma::Allocator *basicAllocator = 0);
173
174 // MANIPULATORS
175 TestChoice& operator=(const TestChoice& original);
176
177 int makeSelection(int selectionId);
178
179 int makeSelection(const char *selectionName, int selectionNameLength);
180
181 template <class MANIPULATOR>
182 int manipulateSelection(MANIPULATOR& manipulator);
183
184 void reset();
185
186 // ACCESSORS
187 template <class ACCESSOR>
188 int accessSelection(ACCESSOR& accessor) const;
189
190 bool hasSelection(int selectionId) const;
191
192 bool hasSelection(const char *selectionName,
193 int selectionNameLength) const;
194
195 const char *className() const;
196
197 int selectionId() const;
198
199 const Selection0Type& theSelection0() const;
200
201 const Selection1Type& theSelection1() const;
202
203 const Selection2Type& theSelection2() const;
204};
205
206// FREE OPERATORS
207template <class V0, class V1, class V2>
208bsl::ostream& operator<<(bsl::ostream& stream,
209 const TestChoice<V0, V1, V2>& choice);
210
211template <class C0, class C1, class C2>
212inline
213bool operator==(const TestChoice<C0, C1, C2>& lhs,
214 const TestChoice<C0, C1, C2>& rhs);
215
216template <class C0, class C1, class C2>
217inline
218bool operator!=(const TestChoice<C0, C1, C2>& lhs,
219 const TestChoice<C0, C1, C2>& rhs);
220
221// TRAITS
222
223/// Return a null-terminated string containing the exported name of the type
224/// for the specified `object`.
225template <class C0, class C1, class C2>
226const char *bdlat_TypeName_className(const TestChoice<C0, C1, C2>& object);
227
228/// Set the value of the specified `object` to the default for the selection
229/// indicated by the specified `selectionId`. Return 0 on success, and a
230/// non-zero value otherwise.
231template <class C0, class C1, class C2>
232int bdlat_choiceMakeSelection(TestChoice<C0, C1, C2> *object, int selectionId);
233
234
235/// Set the value of the specified `object` to be the default for the
236/// selection indicated by the specified `selectionName` of the specified
237/// `selectionNameLength`. Return 0 on success, and a non-zero value
238/// otherwise.
239template <class C0, class C1, class C2>
240int bdlat_choiceMakeSelection(TestChoice<C0, C1, C2> *object,
241 const char *selectionName,
242 int selectionNameLength);
243
244/// Invoke the specified `manipulator` on the address of the (modifiable)
245/// selection of the specified `object`, supplying `manipulator` with the
246/// corresponding selection information structure. Return -1 if the
247/// selection is undefined, and the value returned from the invocation of
248/// `manipulator` otherwise.
249template <class C0, class C1, class C2, class MANIPULATOR>
250int bdlat_choiceManipulateSelection(TestChoice<C0, C1, C2> *object,
251 MANIPULATOR& manipulator);
252
253/// Invoke the specified `accessor` on the (non-modifiable) selection of the
254/// specified `object`, supplying `accessor` with the corresponding
255/// selection information structure. Return -1 if the selection is
256/// undefined, and the value returned from the invocation of `accessor`
257/// otherwise.
258template <class C0, class C1, class C2, class ACCESSOR>
259int bdlat_choiceAccessSelection(const TestChoice<C0, C1, C2>& object,
260 ACCESSOR& accessor);
261
262template <class C0, class C1, class C2>
264 const TestChoice<C0, C1, C2>& object,
265 const char *selectionName,
266 int selectionNameLength);
267
268template <class C0, class C1, class C2>
269bool bdlat_choiceHasSelection(const TestChoice<C0, C1, C2>& object,
270 int selectionId);
271
272/// Return the id of the current selection if the selection is defined, and
273/// `k_UNDEFINED_SELECTION_ID` otherwise.
274template <class C0, class C1, class C2>
275int bdlat_choiceSelectionId(const TestChoice<C0, C1, C2>& object);
276
277template <class C0, class C1, class C2>
278int bdlat_valueTypeAssign(TestChoice<C0, C1, C2> *lhs,
279 const TestChoice<C0, C1, C2>& rhs);
280
281template <class C0, class C1, class C2>
282void bdlat_valueTypeReset(TestChoice<C0, C1, C2> *object);
283
284} // close package namespace
285
286namespace bdlat_ChoiceFunctions {
287
288template <class C0, class C1, class C2>
289struct IsChoice<s_baltst::TestChoice<C0, C1, C2> > : public bsl::true_type {
290};
291
292} // close namespace bdlat_ChoiceFunctions
293
294namespace s_baltst {
295
296// ============================================================================
297// INLINE DEFINITIONS
298// ============================================================================
299
300 // --------------------------
301 // struct TestChoice_ImplUtil
302 // --------------------------
303
304// CLASS METHODS
305template <class ACCESSOR>
307 const TestNilValue,
308 const bdlat_SelectionInfo&)
309{
310 return 0;
311}
312
313template <class ACCESSOR, class SELECTION>
314int TestChoice_ImplUtil::access(ACCESSOR& accessor,
315 const SELECTION& selection,
316 const bdlat_SelectionInfo& selectionInfo)
317{
318 return accessor(selection, selectionInfo);
319}
320
321template <class MANIPULATOR>
323 TestNilValue *,
324 const bdlat_SelectionInfo&)
325{
326 return 0;
327}
328
329template <class MANIPULATOR, class SELECTION>
330int TestChoice_ImplUtil::manipulate(MANIPULATOR& manipulator,
331 SELECTION *selection,
332 const bdlat_SelectionInfo& selectionInfo)
333{
334 return manipulator(selection, selectionInfo);
335}
336
337 // ----------------
338 // class TestChoice
339 // ----------------
340
341// CLASS METHODS
342template <class TYPED_SELECTION_0,
343 class TYPED_SELECTION_1,
344 class TYPED_SELECTION_2>
346 areEqual(const TestChoice& lhs, const TestChoice& rhs)
347{
348 return lhs.d_value.object() == rhs.d_value.object();
349}
350
351// CREATORS
352template <class TYPED_SELECTION_0,
353 class TYPED_SELECTION_1,
354 class TYPED_SELECTION_2>
357: d_value(Selection0Type(), bslma::Default::allocator())
358, d_allocator_p(bslma::Default::allocator())
359{
360}
361
362template <class TYPED_SELECTION_0,
363 class TYPED_SELECTION_1,
364 class TYPED_SELECTION_2>
366 TestChoice(bslma::Allocator *basicAllocator)
367: d_value(Selection0Type(), basicAllocator)
368, d_allocator_p(bslma::Default::allocator(basicAllocator))
369{
370}
371
372template <class TYPED_SELECTION_0,
373 class TYPED_SELECTION_1,
374 class TYPED_SELECTION_2>
375template <class VALUE>
377 TestChoice(const VALUE& value, bslma::Allocator *basicAllocator)
378: d_value(value, bslma::Default::allocator(basicAllocator))
379, d_allocator_p(basicAllocator)
380{
384}
385
386template <class TYPED_SELECTION_0,
387 class TYPED_SELECTION_1,
388 class TYPED_SELECTION_2>
390 TestChoice(const TestChoice& original, bslma::Allocator *basicAllocator)
391: d_value(original.d_value.object(), basicAllocator)
392, d_allocator_p(bslma::Default::allocator(basicAllocator))
393{
394}
395
396// MANIPULATORS
397template <class TYPED_SELECTION_0,
398 class TYPED_SELECTION_1,
399 class TYPED_SELECTION_2>
402operator=(const TestChoice& original)
403{
404 d_value.object() = original.d_value.object();
405 return *this;
406}
407
408/// Set the value of this object to the default for the selection indicated
409/// by the specified `selectionId`. Return 0 on success, and a non-zero
410/// value otherwise.
411template <class TYPED_SELECTION_0,
412 class TYPED_SELECTION_1,
413 class TYPED_SELECTION_2>
415 makeSelection(int selectionId)
416{
417 switch (selectionId) {
418 case 0: {
419 if (!k_HAS_CHOICE_0) {
420 return -1;
421 } // RETURN
422
423 d_value.object().template createInPlace<Selection0Type>();
424 return 0; // RETURN
425 } break;
426 case 1: {
427 if (!k_HAS_CHOICE_1) {
428 return -1; // RETURN
429 }
430
431 d_value.object().template createInPlace<Selection1Type>();
432 return 0; // RETURN
433 } break;
434 case 2: {
435 if (!k_HAS_CHOICE_2) {
436 return -1;
437 } // RETURN
438
439 d_value.object().template createInPlace<Selection2Type>();
440 return 0; // RETURN
441 } break;
442 }
443
444 return -1;
445}
446
447/// Set the value of this object to the default for the selection indicated
448/// by the specified `selectionName` of the specified `selectionNameLength`.
449/// Return 0 on success, and a non-zero value otherwise.
450template <class TYPED_SELECTION_0,
451 class TYPED_SELECTION_1,
452 class TYPED_SELECTION_2>
454 makeSelection(const char *selectionName, int selectionNameLength)
455{
456 const bsl::string_view selection(selectionName, selectionNameLength);
457
458 if (k_HAS_CHOICE_0 && Selection0::name() == selection) {
459 d_value.object().template createInPlace<Selection0Type>();
460 return 0; // RETURN
461 }
462
463 if (k_HAS_CHOICE_1 && Selection1::name() == selection) {
464 d_value.object().template createInPlace<Selection1Type>();
465 return 0; // RETURN
466 }
467
468 if (k_HAS_CHOICE_2 && Selection2::name() == selection) {
469 d_value.object().template createInPlace<Selection2Type>();
470 return 0; // RETURN
471 }
472
473 return -1;
474}
475
476/// Invoke the specified `manipulator` on the address of the (modifiable)
477/// selection of this object, supplying `manipulator` with the corresponding
478/// selection information structure. Return -1 if the selection is
479/// undefined, and the value returned from the invocation of `manipulator`
480/// otherwise.
481template <class TYPED_SELECTION_0,
482 class TYPED_SELECTION_1,
483 class TYPED_SELECTION_2>
484template <class MANIPULATOR>
486 manipulateSelection(MANIPULATOR& manipulator)
487{
488 switch (d_value.object().typeIndex()) {
489 case 0: {
490 return -1; // RETURN
491 } break;
492 case 1: {
493 BSLS_ASSERT(k_HAS_CHOICE_0);
494 BSLS_ASSERT(d_value.object().template is<Selection0Type>());
495 return ImplUtil::manipulate(
496 manipulator,
497 &d_value.object().template the<Selection0Type>(),
498 Selection0::selectionInfo()); // RETURN
499 } break;
500 case 2: {
501 BSLS_ASSERT(k_HAS_CHOICE_1);
502 BSLS_ASSERT(d_value.object().template is<Selection1Type>());
503 return ImplUtil::manipulate(
504 manipulator,
505 &d_value.object().template the<Selection1Type>(),
506 Selection1::selectionInfo()); // RETURN
507 } break;
508 case 3: {
509 BSLS_ASSERT(k_HAS_CHOICE_2);
510 BSLS_ASSERT(d_value.object().template is<Selection2Type>());
511 return ImplUtil::manipulate(
512 manipulator,
513 &d_value.object().template the<Selection2Type>(),
514 Selection2::selectionInfo()); // RETURN
515 } break;
516 }
517
518 return -1;
519}
520
521template <class TYPED_SELECTION_0,
522 class TYPED_SELECTION_1,
523 class TYPED_SELECTION_2>
525 reset()
526{
527 d_value.object().template createInPlace<Selection0Type>();
528}
529
530// ACCESSORS
531
532/// Invoke the specified `accessor` on the (non-modifiable) selection of the
533/// this object, supplying `accessor` with the corresponding selection
534/// information structure. Return -1 if the selection is undefined, and the
535/// value returned from the invocation of `accessor` otherwise.
536template <class TYPED_SELECTION_0,
537 class TYPED_SELECTION_1,
538 class TYPED_SELECTION_2>
539template <class ACCESSOR>
541 accessSelection(ACCESSOR& accessor) const
542{
543 switch (d_value.object().typeIndex()) {
544 case 0: {
545 return -1; // RETURN
546 } break;
547 case 1: {
548 BSLS_ASSERT(k_HAS_CHOICE_0);
549 BSLS_ASSERT(d_value.object().template is<Selection0Type>());
550 return ImplUtil::access(
551 accessor,
552 d_value.object().template the<Selection0Type>(),
553 Selection0::selectionInfo()); // RETURN
554 } break;
555 case 2: {
556 BSLS_ASSERT(k_HAS_CHOICE_1);
557 BSLS_ASSERT(d_value.object().template is<Selection1Type>());
558 return ImplUtil::access(
559 accessor,
560 d_value.object().template the<Selection1Type>(),
561 Selection1::selectionInfo()); // RETURN
562 } break;
563 case 3: {
564 BSLS_ASSERT(k_HAS_CHOICE_2);
565 BSLS_ASSERT(d_value.object().template is<Selection2Type>());
566 return ImplUtil::access(
567 accessor,
568 d_value.object().template the<Selection2Type>(),
569 Selection2::selectionInfo()); // RETURN
570 } break;
571 }
572
573 return -1;
574}
575
576template <class TYPED_SELECTION_0,
577 class TYPED_SELECTION_1,
578 class TYPED_SELECTION_2>
580 hasSelection(int selectionId) const
581{
582 if (k_HAS_CHOICE_0 && Selection0::id() == selectionId) {
583 return true; // RETURN
584 }
585
586 if (k_HAS_CHOICE_1 && Selection1::id() == selectionId) {
587 return true; // RETURN
588 }
589
590 if (k_HAS_CHOICE_2 && Selection2::id() == selectionId) {
591 return true; // RETURN
592 }
593
594 return false;
595}
596
597template <class TYPED_SELECTION_0,
598 class TYPED_SELECTION_1,
599 class TYPED_SELECTION_2>
601 hasSelection(const char *selectionName, int selectionNameLength) const
602{
603 const bsl::string_view selection(selectionName, selectionNameLength);
604
605 if (k_HAS_CHOICE_0 && Selection0::name() == selection) {
606 return true; // RETURN
607 }
608
609 if (k_HAS_CHOICE_1 && Selection1::name() == selection) {
610 return true; // RETURN
611 }
612
613 if (k_HAS_CHOICE_2 && Selection2::name() == selection) {
614 return true; // RETURN
615 }
616
617 return false;
618}
619
620/// Return a null-terminated string containing the exported name for this
621/// type.
622template <class TYPED_SELECTION_0,
623 class TYPED_SELECTION_1,
624 class TYPED_SELECTION_2>
625const char *TestChoice<TYPED_SELECTION_0,
626 TYPED_SELECTION_1,
627 TYPED_SELECTION_2>::className() const
628{
629 return "MyChoice";
630}
631
632template <class TYPED_SELECTION_0,
633 class TYPED_SELECTION_1,
634 class TYPED_SELECTION_2>
636 selectionId() const
637{
638 return d_value.object().typeIndex() - 1;
639}
640
641template <class TYPED_SELECTION_0,
642 class TYPED_SELECTION_1,
643 class TYPED_SELECTION_2>
644const typename TYPED_SELECTION_0::Type&
646 theSelection0() const
647{
648 BSLS_ASSERT(d_value.object().typeIndex() == 1);
649 return d_value.object().template the<Selection0Type>();
650}
651
652template <class TYPED_SELECTION_0,
653 class TYPED_SELECTION_1,
654 class TYPED_SELECTION_2>
655const typename TYPED_SELECTION_1::Type&
657 theSelection1() const
658{
659 BSLS_ASSERT(d_value.object().typeIndex() == 2);
660 return d_value.object().template the<Selection1Type>();
661}
662
663template <class TYPED_SELECTION_0,
664 class TYPED_SELECTION_1,
665 class TYPED_SELECTION_2>
666const typename TYPED_SELECTION_2::Type&
668 theSelection2() const
669{
670 BSLS_ASSERT(d_value.object().typeIndex() == 3);
671 return d_value.object().template the<Selection2Type>();
672}
673
674// FREE OPERATORS
675template <class V0, class V1, class V2>
676bsl::ostream& operator<<(bsl::ostream& stream,
677 const TestChoice<V0, V1, V2>& choice)
678{
679 typedef TestChoice<V0, V1, V2> Choice;
680
681 stream << "[" << choice.className() << " ";
682 switch (choice.selectionId()) {
683 case 0: {
684 stream << Choice::Selection0::name() << " = "
685 << choice.theSelection0();
686 } break;
687 case 1: {
688 stream << Choice::Selection1::name() << " = "
689 << choice.theSelection1();
690 } break;
691 case 2: {
692 stream << Choice::Selection2::name() << " = "
693 << choice.theSelection2();
694 } break;
695 }
696
697 return stream << "]";
698}
699
700template <class C0, class C1, class C2>
701inline
702bool operator==(const TestChoice<C0, C1, C2>& lhs,
703 const TestChoice<C0, C1, C2>& rhs)
704{
705 return TestChoice<C0, C1, C2>::areEqual(lhs, rhs);
706}
707
708template <class C0, class C1, class C2>
709inline
710bool operator!=(const TestChoice<C0, C1, C2>& lhs,
711 const TestChoice<C0, C1, C2>& rhs)
712{
713 return !TestChoice<C0, C1, C2>::areEqual(lhs, rhs);
714}
715
716// TRAITS
717template <class C0, class C1, class C2>
719{
720 return object.className();
721}
722
723template <class C0, class C1, class C2>
725{
726 return object->makeSelection(selectionId);
727}
728
729template <class C0, class C1, class C2>
731 const char *selectionName,
732 int selectionNameLength)
733{
734 return object->makeSelection(selectionName, selectionNameLength);
735}
736
737template <class C0, class C1, class C2, class MANIPULATOR>
739 MANIPULATOR& manipulator)
740{
741 return object->manipulateSelection(manipulator);
742}
743
744template <class C0, class C1, class C2, class ACCESSOR>
746 ACCESSOR& accessor)
747{
748 return object.accessSelection(accessor);
749}
750
751template <class C0, class C1, class C2>
753 const TestChoice<C0, C1, C2>& object,
754 const char *selectionName,
755 int selectionNameLength)
756{
757 return object.hasSelection(selectionName, selectionNameLength);
758}
759
760template <class C0, class C1, class C2>
762 int selectionId)
763{
764 return object.hasSelection(selectionId);
765}
766
767template <class C0, class C1, class C2>
769{
770 return object.selectionId();
771}
772
773template <class C0, class C1, class C2>
775 const TestChoice<C0, C1, C2>& rhs)
776{
777 *lhs = rhs;
778 return 0;
779}
780
781template <class C0, class C1, class C2>
783{
784 object->reset();
785}
786
787
788
789} // close package namespace
790
791
792#endif // INCLUDED_S_BALTST_TESTCHOICE
793
794// ----------------------------------------------------------------------------
795// Copyright 2021 Bloomberg Finance L.P.
796//
797// Licensed under the Apache License, Version 2.0 (the "License");
798// you may not use this file except in compliance with the License.
799// You may obtain a copy of the License at
800//
801// http://www.apache.org/licenses/LICENSE-2.0
802//
803// Unless required by applicable law or agreed to in writing, software
804// distributed under the License is distributed on an "AS IS" BASIS,
805// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
806// See the License for the specific language governing permissions and
807// limitations under the License.
808// ----------------------------- END-OF-FILE ----------------------------------
809
810/** @} */
811/** @} */
812/** @} */
Definition bdlb_variant.h:2312
Definition bslstl_stringview.h:441
Definition bslalg_constructorproxy.h:368
OBJECT_TYPE & object() BSLS_KEYWORD_NOEXCEPT
Return a reference to the modifiable object held by this proxy.
Definition bslalg_constructorproxy.h:1187
Definition bslma_allocator.h:457
Definition s_baltst_testchoice.h:130
int makeSelection(int selectionId)
Definition s_baltst_testchoice.h:415
TestChoice()
Definition s_baltst_testchoice.h:356
TYPED_SELECTION_0::Type Selection0Type
Definition s_baltst_testchoice.h:135
int accessSelection(ACCESSOR &accessor) const
Definition s_baltst_testchoice.h:541
void reset()
Definition s_baltst_testchoice.h:525
bool hasSelection(int selectionId) const
Definition s_baltst_testchoice.h:580
const Selection0Type & theSelection0() const
Definition s_baltst_testchoice.h:646
TYPED_SELECTION_0::Selection Selection0
Definition s_baltst_testchoice.h:134
TYPED_SELECTION_1::Type Selection1Type
Definition s_baltst_testchoice.h:137
TYPED_SELECTION_2::Type Selection2Type
Definition s_baltst_testchoice.h:139
const char * className() const
Definition s_baltst_testchoice.h:627
int manipulateSelection(MANIPULATOR &manipulator)
Definition s_baltst_testchoice.h:486
static bool areEqual(const TestChoice &lhs, const TestChoice &rhs)
Definition s_baltst_testchoice.h:346
TYPED_SELECTION_1::Selection Selection1
Definition s_baltst_testchoice.h:136
const Selection1Type & theSelection1() const
Definition s_baltst_testchoice.h:657
const Selection2Type & theSelection2() const
Definition s_baltst_testchoice.h:668
TestChoice & operator=(const TestChoice &original)
Definition s_baltst_testchoice.h:402
TYPED_SELECTION_2::Selection Selection2
Definition s_baltst_testchoice.h:138
int selectionId() const
Definition s_baltst_testchoice.h:636
Definition s_baltst_testnilvalue.h:60
Definition s_baltst_testselection.h:121
#define BSLMF_ASSERT(expr)
Definition bslmf_assert.h:229
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlat_choicefunctions.h:504
Definition balxml_encoderoptions.h:68
Definition s_baltst_address.h:66
bool bdlat_choiceHasSelection(const TestChoice< C0, C1, C2 > &object, const char *selectionName, int selectionNameLength)
Definition s_baltst_testchoice.h:752
int bdlat_valueTypeAssign(TestChoice< C0, C1, C2 > *lhs, const TestChoice< C0, C1, C2 > &rhs)
Definition s_baltst_testchoice.h:774
const char * bdlat_TypeName_className(const TestChoice< C0, C1, C2 > &object)
Definition s_baltst_testchoice.h:718
int bdlat_choiceManipulateSelection(TestChoice< C0, C1, C2 > *object, MANIPULATOR &manipulator)
Definition s_baltst_testchoice.h:738
int bdlat_choiceSelectionId(const TestChoice< C0, C1, C2 > &object)
Definition s_baltst_testchoice.h:768
int bdlat_choiceAccessSelection(const TestChoice< C0, C1, C2 > &object, ACCESSOR &accessor)
Definition s_baltst_testchoice.h:745
bsl::ostream & operator<<(bsl::ostream &stream, const Address &rhs)
int bdlat_choiceMakeSelection(TestChoice< C0, C1, C2 > *object, int selectionId)
Definition s_baltst_testchoice.h:724
void bdlat_valueTypeReset(TestChoice< C0, C1, C2 > *object)
Definition s_baltst_testchoice.h:782
Definition bdlat_selectioninfo.h:136
Definition bslmf_issame.h:181
Definition s_baltst_testchoice.h:71
static int access(ACCESSOR &accessor, const TestNilValue selection, const bdlat_SelectionInfo &selectionInfo)
Definition s_baltst_testchoice.h:306
static int manipulate(MANIPULATOR &manipulator, TestNilValue *selection, const bdlat_SelectionInfo &selectionInfo)
Definition s_baltst_testchoice.h:322