8#ifndef INCLUDED_S_BALTST_TOPCHOICE
9#define INCLUDED_S_BALTST_TOPCHOICE
43#include <bslalg_typetraits.h>
59#include <bsl_vector.h>
67#include <bsl_iosfwd.h>
68#include <bsl_limits.h>
72namespace bslma {
class Allocator; }
74namespace s_baltst {
class Topchoice; }
99 bool isEqualTo(
const Topchoice& rhs)
const;
164#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
165 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
189#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
190 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
214#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
215 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
224#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
225 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
234#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
235 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
244#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
245 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
254#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
255 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
264#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
265 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
280#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
281 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
293 template <
typename t_MANIPULATOR>
358 bsl::ostream&
print(bsl::ostream& stream,
360 int spacesPerLevel = 4)
const;
370 template <
typename t_ACCESSOR>
468 return lhs.isEqualTo(rhs);
476 return !(lhs == rhs);
483 return rhs.print(stream, 0, -1);
506bool Topchoice::isEqualTo(
const Topchoice& rhs)
const
510 switch (
rhs.selectionId()) {
511 case Class::SELECTION_ID_SELECTION1:
512 return this->
selection1() == rhs.selection1();
513 case Class::SELECTION_ID_SELECTION2:
514 return this->
selection2() == rhs.selection2();
515 case Class::SELECTION_ID_SELECTION3:
516 return this->
selection3() == rhs.selection3();
517 case Class::SELECTION_ID_SELECTION4:
518 return this->
selection4() == rhs.selection4();
519 case Class::SELECTION_ID_SELECTION5:
520 return this->
selection5() == rhs.selection5();
521 case Class::SELECTION_ID_SELECTION6:
522 return this->
selection6() == rhs.selection6();
523 case Class::SELECTION_ID_SELECTION7:
524 return this->
selection7() == rhs.selection7();
525 case Class::SELECTION_ID_SELECTION8:
526 return this->
selection8() == rhs.selection8();
540: d_selectionId(SELECTION_ID_UNDEFINED)
541, d_allocator_p(
bslma::Default::allocator(basicAllocator))
552template <
typename t_MANIPULATOR>
555 switch (d_selectionId) {
646 return d_selectionId;
649template <
typename t_ACCESSOR>
652 switch (d_selectionId) {
Definition bdlt_datetimetz.h:308
Definition bslstl_vector.h:1120
Definition bslma_allocator.h:545
Definition s_baltst_ratsnest.h:1011
Definition s_baltst_customstring.h:71
Definition s_baltst_ratsnest.h:2317
Definition s_baltst_ratsnest.h:2576
Definition s_baltst_ratsnest.h:95
Definition s_baltst_topchoice.h:81
s_baltst::CustomString & makeSelection6()
bsls::ObjectBuffer< bsl::vector< char > > d_selection2
Definition s_baltst_topchoice.h:86
bsls::ObjectBuffer< s_baltst::CustomString > d_selection6
Definition s_baltst_topchoice.h:90
s_baltst::Sequence1 & makeSelection1()
const char * selectionName() const
Return the symbolic name of the current selection of this object.
bsls::ObjectBuffer< bdlt::DatetimeTz > d_selection5
Definition s_baltst_topchoice.h:89
s_baltst::Sequence3 * d_selection4
Definition s_baltst_topchoice.h:88
bool isSelection1Value() const
Definition s_baltst_topchoice.h:740
bdlt::DatetimeTz & makeSelection5(const bdlt::DatetimeTz &value)
static const char CLASS_NAME[]
Definition s_baltst_topchoice.h:132
s_baltst::Sequence2 & makeSelection3()
@ NUM_SELECTIONS
Definition s_baltst_topchoice.h:117
s_baltst::CustomString & selection6()
Definition s_baltst_topchoice.h:622
bool isSelection8Value() const
Definition s_baltst_topchoice.h:782
bool isUndefinedValue() const
Definition s_baltst_topchoice.h:788
bool isSelection4Value() const
Definition s_baltst_topchoice.h:758
bool isSelection7Value() const
Definition s_baltst_topchoice.h:776
s_baltst::Sequence1 & makeSelection1(const s_baltst::Sequence1 &value)
bool isSelection6Value() const
Definition s_baltst_topchoice.h:770
s_baltst::Sequence1 & selection1()
Definition s_baltst_topchoice.h:587
bsl::vector< char > & selection2()
Definition s_baltst_topchoice.h:594
friend bool operator!=(const Topchoice &lhs, const Topchoice &rhs)
Definition s_baltst_topchoice.h:474
@ SELECTION_ID_SELECTION8
Definition s_baltst_topchoice.h:113
@ SELECTION_ID_UNDEFINED
Definition s_baltst_topchoice.h:105
@ SELECTION_ID_SELECTION5
Definition s_baltst_topchoice.h:110
@ SELECTION_ID_SELECTION2
Definition s_baltst_topchoice.h:107
@ SELECTION_ID_SELECTION1
Definition s_baltst_topchoice.h:106
@ SELECTION_ID_SELECTION3
Definition s_baltst_topchoice.h:108
@ SELECTION_ID_SELECTION4
Definition s_baltst_topchoice.h:109
@ SELECTION_ID_SELECTION7
Definition s_baltst_topchoice.h:112
@ SELECTION_ID_SELECTION6
Definition s_baltst_topchoice.h:111
int makeSelection(const char *name, int nameLength)
Topchoice(bslma::Allocator *basicAllocator=0)
Definition s_baltst_topchoice.h:539
friend bsl::ostream & operator<<(bsl::ostream &stream, const Topchoice &rhs)
Definition s_baltst_topchoice.h:481
s_baltst::Enumerated::Value & selection7()
Definition s_baltst_topchoice.h:629
bool isSelection2Value() const
Definition s_baltst_topchoice.h:746
static const bdlat_SelectionInfo * lookupSelectionInfo(const char *name, int nameLength)
s_baltst::Choice3 & makeSelection8(const s_baltst::Choice3 &value)
int manipulateSelection(t_MANIPULATOR &manipulator)
Definition s_baltst_topchoice.h:553
s_baltst::Sequence2 & makeSelection3(const s_baltst::Sequence2 &value)
bdlt::DatetimeTz & makeSelection5()
bsls::ObjectBuffer< s_baltst::Sequence2 > d_selection3
Definition s_baltst_topchoice.h:87
Topchoice(const Topchoice &original, bslma::Allocator *basicAllocator=0)
int selectionId() const
Definition s_baltst_topchoice.h:644
s_baltst::Sequence3 & selection4()
Definition s_baltst_topchoice.h:608
bool isSelection5Value() const
Definition s_baltst_topchoice.h:764
@ SELECTION_INDEX_SELECTION6
Definition s_baltst_topchoice.h:126
@ SELECTION_INDEX_SELECTION8
Definition s_baltst_topchoice.h:128
@ SELECTION_INDEX_SELECTION3
Definition s_baltst_topchoice.h:123
@ SELECTION_INDEX_SELECTION7
Definition s_baltst_topchoice.h:127
@ SELECTION_INDEX_SELECTION2
Definition s_baltst_topchoice.h:122
@ SELECTION_INDEX_SELECTION5
Definition s_baltst_topchoice.h:125
@ SELECTION_INDEX_SELECTION1
Definition s_baltst_topchoice.h:121
@ SELECTION_INDEX_SELECTION4
Definition s_baltst_topchoice.h:124
s_baltst::Sequence3 & makeSelection4()
bsls::ObjectBuffer< s_baltst::Choice3 > d_selection8
Definition s_baltst_topchoice.h:92
bsls::ObjectBuffer< s_baltst::Sequence1 > d_selection1
Definition s_baltst_topchoice.h:85
s_baltst::Enumerated::Value & makeSelection7(s_baltst::Enumerated::Value value)
int accessSelection(t_ACCESSOR &accessor) const
Definition s_baltst_topchoice.h:650
Topchoice & operator=(const Topchoice &rhs)
Assign to this object the value of the specified rhs object.
static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]
Definition s_baltst_topchoice.h:134
s_baltst::Enumerated::Value & makeSelection7()
bsls::ObjectBuffer< s_baltst::Enumerated::Value > d_selection7
Definition s_baltst_topchoice.h:91
static const bdlat_SelectionInfo * lookupSelectionInfo(int id)
bdlt::DatetimeTz & selection5()
Definition s_baltst_topchoice.h:615
s_baltst::Choice3 & selection8()
Definition s_baltst_topchoice.h:636
~Topchoice()
Destroy this object.
Definition s_baltst_topchoice.h:546
int makeSelection(int selectionId)
s_baltst::Sequence3 & makeSelection4(const s_baltst::Sequence3 &value)
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
bsl::vector< char > & makeSelection2(const bsl::vector< char > &value)
bool isSelection3Value() const
Definition s_baltst_topchoice.h:752
s_baltst::CustomString & makeSelection6(const s_baltst::CustomString &value)
s_baltst::Sequence2 & selection3()
Definition s_baltst_topchoice.h:601
friend bool operator==(const Topchoice &lhs, const Topchoice &rhs)
Definition s_baltst_topchoice.h:466
bsl::vector< char > & makeSelection2()
s_baltst::Choice3 & makeSelection8()
#define BDLAT_DECL_CHOICE_WITH_ALLOCATOR_BITWISEMOVEABLE_TRAITS(ClassName)
Definition bdlat_typetraits.h:268
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1976
#define BSLS_IDENT_RCSID(tag, str)
BSLS_IDENT_RCSID() - insert ident str (specific to platform/compiler)
Definition bsls_ident.h:244
#define BSLS_IDENT_PRAGMA_ONCE
BSLS_IDENT_PRAGMA_ONCE - macro to avoid multiple inclusion
Definition bsls_ident.h:263
ALLOCATOR const STRING_VIEW_LIKE_TYPE & rhs
Definition bslstl_string.h:3918
Definition baljsn_encoder_testtypes.h:76
Definition s_baltst_address.h:66
Definition bdlat_selectioninfo.h:138
Value
Definition s_baltst_enumerated.h:71
TYPE & object()
Definition bsls_objectbuffer.h:352