8#ifndef INCLUDED_S_BALTST_MYSEQUENCEWITHCHOICEARRAY
9#define INCLUDED_S_BALTST_MYSEQUENCEWITHCHOICEARRAY
43#include <bslalg_typetraits.h>
57#include <bsl_vector.h>
59#include <bsl_iosfwd.h>
60#include <bsl_limits.h>
64namespace bslma {
class Allocator; }
66namespace s_baltst {
class MySequenceWithChoiceArrayChoice; }
67namespace s_baltst {
class MySequenceWithChoiceArray; }
133#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
134 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
150#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
151 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
190 template <
typename t_MANIPULATOR>
219 bsl::ostream&
print(bsl::ostream& stream,
221 int spacesPerLevel = 4)
const;
231 template <
typename t_ACCESSOR>
271 return lhs.isEqualTo(rhs);
280 return !(lhs == rhs);
286 bsl::ostream& stream,
289 return rhs.print(stream, 0, -1);
358#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
359 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
384#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
385 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
402 template <
typename t_MANIPULATOR>
411 template <
typename t_MANIPULATOR>
420 template <
typename t_MANIPULATOR>
443 bsl::ostream&
print(bsl::ostream& stream,
445 int spacesPerLevel = 4)
const;
453 template <
typename t_ACCESSOR>
461 template <
typename t_ACCESSOR>
470 template <
typename t_ACCESSOR>
473 int nameLength)
const;
487 return lhs.choices() == rhs.choices();
494 return !(lhs == rhs);
502 return rhs.print(stream, 0, -1);
527bool MySequenceWithChoiceArrayChoice::isEqualTo(
const MySequenceWithChoiceArrayChoice& rhs)
const
531 switch (rhs.selectionId()) {
532 case Class::SELECTION_ID_CHOICE_A:
533 return this->
choiceA() == rhs.choiceA();
534 case Class::SELECTION_ID_CHOICE_B:
535 return this->
choiceB() == rhs.choiceB();
537 BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId());
549: d_selectionId(SELECTION_ID_UNDEFINED)
560template <
typename t_MANIPULATOR>
563 switch (d_selectionId) {
594 return d_selectionId;
597template <
typename t_ACCESSOR>
600 switch (d_selectionId) {
652template <
typename t_MANIPULATOR>
665template <
typename t_MANIPULATOR>
668 enum { NOT_FOUND = -1 };
679template <
typename t_MANIPULATOR>
681 t_MANIPULATOR& manipulator,
685 enum { NOT_FOUND = -1 };
689 if (0 == attributeInfo) {
703template <
typename t_ACCESSOR>
716template <
typename t_ACCESSOR>
719 enum { NOT_FOUND = -1 };
730template <
typename t_ACCESSOR>
732 t_ACCESSOR& accessor,
734 int nameLength)
const
736 enum { NOT_FOUND = -1 };
740 if (0 == attributeInfo) {
Definition bslstl_vector.h:1120
Definition bslma_allocator.h:545
Definition s_baltst_mysequencewithchoicearray.h:74
const char * selectionName() const
Return the symbolic name of the current selection of this object.
bsls::ObjectBuffer< int > d_choiceB
Definition s_baltst_mysequencewithchoicearray.h:79
friend bool operator==(const MySequenceWithChoiceArrayChoice &lhs, const MySequenceWithChoiceArrayChoice &rhs)
Definition s_baltst_mysequencewithchoicearray.h:268
@ NUM_SELECTIONS
Definition s_baltst_mysequencewithchoicearray.h:97
int & choiceA()
Definition s_baltst_mysequencewithchoicearray.h:577
friend bsl::ostream & operator<<(bsl::ostream &stream, const MySequenceWithChoiceArrayChoice &rhs)
Definition s_baltst_mysequencewithchoicearray.h:285
int makeSelection(const char *name, int nameLength)
friend bool operator!=(const MySequenceWithChoiceArrayChoice &lhs, const MySequenceWithChoiceArrayChoice &rhs)
Definition s_baltst_mysequencewithchoicearray.h:277
@ SELECTION_INDEX_CHOICE_B
Definition s_baltst_mysequencewithchoicearray.h:102
@ SELECTION_INDEX_CHOICE_A
Definition s_baltst_mysequencewithchoicearray.h:101
int makeSelection(int selectionId)
int & makeChoiceA(int value)
MySequenceWithChoiceArrayChoice()
Definition s_baltst_mysequencewithchoicearray.h:548
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
int & makeChoiceB(int value)
static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]
Definition s_baltst_mysequencewithchoicearray.h:108
MySequenceWithChoiceArrayChoice & operator=(const MySequenceWithChoiceArrayChoice &rhs)
Assign to this object the value of the specified rhs object.
int accessSelection(t_ACCESSOR &accessor) const
Definition s_baltst_mysequencewithchoicearray.h:598
~MySequenceWithChoiceArrayChoice()
Destroy this object.
Definition s_baltst_mysequencewithchoicearray.h:554
bsls::ObjectBuffer< int > d_choiceA
Definition s_baltst_mysequencewithchoicearray.h:78
MySequenceWithChoiceArrayChoice(const MySequenceWithChoiceArrayChoice &original)
static const bdlat_SelectionInfo * lookupSelectionInfo(const char *name, int nameLength)
int manipulateSelection(t_MANIPULATOR &manipulator)
Definition s_baltst_mysequencewithchoicearray.h:561
int & choiceB()
Definition s_baltst_mysequencewithchoicearray.h:584
@ SELECTION_ID_CHOICE_B
Definition s_baltst_mysequencewithchoicearray.h:93
@ SELECTION_ID_UNDEFINED
Definition s_baltst_mysequencewithchoicearray.h:91
@ SELECTION_ID_CHOICE_A
Definition s_baltst_mysequencewithchoicearray.h:92
bool isUndefinedValue() const
Definition s_baltst_mysequencewithchoicearray.h:640
static const char CLASS_NAME[]
Definition s_baltst_mysequencewithchoicearray.h:106
bool isChoiceAValue() const
Definition s_baltst_mysequencewithchoicearray.h:628
static const bdlat_SelectionInfo * lookupSelectionInfo(int id)
bool isChoiceBValue() const
Definition s_baltst_mysequencewithchoicearray.h:634
int selectionId() const
Definition s_baltst_mysequencewithchoicearray.h:592
Definition s_baltst_mysequencewithchoicearray.h:305
static const bdlat_AttributeInfo * lookupAttributeInfo(const char *name, int nameLength)
MySequenceWithChoiceArray(const MySequenceWithChoiceArray &original, bslma::Allocator *basicAllocator=0)
friend bsl::ostream & operator<<(bsl::ostream &stream, const MySequenceWithChoiceArray &rhs)
Definition s_baltst_mysequencewithchoicearray.h:499
~MySequenceWithChoiceArray()
Destroy this object.
@ ATTRIBUTE_ID_CHOICES
Definition s_baltst_mysequencewithchoicearray.h:313
static const char CLASS_NAME[]
Definition s_baltst_mysequencewithchoicearray.h:325
int manipulateAttributes(t_MANIPULATOR &manipulator)
Definition s_baltst_mysequencewithchoicearray.h:653
friend bool operator!=(const MySequenceWithChoiceArray &lhs, const MySequenceWithChoiceArray &rhs)
Returns !(lhs == rhs)
Definition s_baltst_mysequencewithchoicearray.h:491
MySequenceWithChoiceArray & operator=(const MySequenceWithChoiceArray &rhs)
Assign to this object the value of the specified rhs object.
bsl::vector< MySequenceWithChoiceArrayChoice > & choices()
Definition s_baltst_mysequencewithchoicearray.h:697
friend bool operator==(const MySequenceWithChoiceArray &lhs, const MySequenceWithChoiceArray &rhs)
Definition s_baltst_mysequencewithchoicearray.h:484
@ NUM_ATTRIBUTES
Definition s_baltst_mysequencewithchoicearray.h:317
@ ATTRIBUTE_INDEX_CHOICES
Definition s_baltst_mysequencewithchoicearray.h:321
int manipulateAttribute(t_MANIPULATOR &manipulator, int id)
Definition s_baltst_mysequencewithchoicearray.h:666
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
MySequenceWithChoiceArray(bslma::Allocator *basicAllocator=0)
static const bdlat_AttributeInfo ATTRIBUTE_INFO_ARRAY[]
Definition s_baltst_mysequencewithchoicearray.h:327
static const bdlat_AttributeInfo * lookupAttributeInfo(int id)
int accessAttributes(t_ACCESSOR &accessor) const
Definition s_baltst_mysequencewithchoicearray.h:704
int accessAttribute(t_ACCESSOR &accessor, int id) const
Definition s_baltst_mysequencewithchoicearray.h:717
#define BDLAT_DECL_SEQUENCE_WITH_ALLOCATOR_BITWISEMOVEABLE_TRAITS(ClassName)
Definition bdlat_typetraits.h:301
#define BDLAT_DECL_CHOICE_WITH_BITWISEMOVEABLE_TRAITS(ClassName)
Definition bdlat_typetraits.h:261
#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
Definition baljsn_encoder_testtypes.h:76
Definition s_baltst_address.h:66
Definition bdlat_attributeinfo.h:139
int d_id
Definition bdlat_attributeinfo.h:142
Definition bdlat_selectioninfo.h:138
Definition bdlat_typetraits.h:146
TYPE & object()
Definition bsls_objectbuffer.h:352