8#ifndef INCLUDED_S_BALTST_ANONYMOUSCHOICESEQUENCE
9#define INCLUDED_S_BALTST_ANONYMOUSCHOICESEQUENCE
43#include <bslalg_typetraits.h>
55#include <bsl_iosfwd.h>
56#include <bsl_limits.h>
60namespace s_baltst {
class AnonChoiceSequence; }
61namespace s_baltst {
class AnonChoice; }
125 template <
typename t_MANIPULATOR>
134 template <
typename t_MANIPULATOR>
143 template <
typename t_MANIPULATOR>
165 bsl::ostream&
print(bsl::ostream& stream,
167 int spacesPerLevel = 4)
const;
175 template <
typename t_ACCESSOR>
183 template <
typename t_ACCESSOR>
192 template <
typename t_ACCESSOR>
195 int nameLength)
const;
208 return lhs.a() == rhs.a();
215 return !(lhs == rhs);
223 return rhs.print(stream, 0, -1);
294#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
295 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
310#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
311 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
335#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
336 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
348 template <
typename t_MANIPULATOR>
371 bsl::ostream&
print(bsl::ostream& stream,
373 int spacesPerLevel = 4)
const;
383 template <
typename t_ACCESSOR>
411 return lhs.isEqualTo(rhs);
419 return !(lhs == rhs);
427 return rhs.print(stream, 0, -1);
449template <
typename t_MANIPULATOR>
462template <
typename t_MANIPULATOR>
465 enum { NOT_FOUND = -1 };
476template <
typename t_MANIPULATOR>
478 t_MANIPULATOR& manipulator,
482 enum { NOT_FOUND = -1 };
486 if (0 == attributeInfo) {
500template <
typename t_ACCESSOR>
513template <
typename t_ACCESSOR>
516 enum { NOT_FOUND = -1 };
527template <
typename t_ACCESSOR>
529 t_ACCESSOR& accessor,
531 int nameLength)
const
533 enum { NOT_FOUND = -1 };
537 if (0 == attributeInfo) {
559bool AnonChoice::isEqualTo(
const AnonChoice& rhs)
const
563 switch (rhs.selectionId()) {
564 case Class::SELECTION_ID_SEQUENCE:
567 BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId());
579: d_selectionId(SELECTION_ID_UNDEFINED)
590template <
typename t_MANIPULATOR>
593 switch (d_selectionId) {
614 return d_selectionId;
617template <
typename t_ACCESSOR>
620 switch (d_selectionId) {
Definition s_baltst_anonymouschoicesequence.h:68
static const bdlat_AttributeInfo ATTRIBUTE_INFO_ARRAY[]
Definition s_baltst_anonymouschoicesequence.h:90
@ NUM_ATTRIBUTES
Definition s_baltst_anonymouschoicesequence.h:80
friend bool operator!=(const AnonChoiceSequence &lhs, const AnonChoiceSequence &rhs)
Returns !(lhs == rhs)
Definition s_baltst_anonymouschoicesequence.h:212
int manipulateAttributes(t_MANIPULATOR &manipulator)
Definition s_baltst_anonymouschoicesequence.h:450
int & a()
Return a reference to the modifiable "A" attribute of this object.
Definition s_baltst_anonymouschoicesequence.h:494
static const char CLASS_NAME[]
Definition s_baltst_anonymouschoicesequence.h:88
friend bool operator==(const AnonChoiceSequence &lhs, const AnonChoiceSequence &rhs)
Definition s_baltst_anonymouschoicesequence.h:205
@ ATTRIBUTE_ID_A
Definition s_baltst_anonymouschoicesequence.h:76
int manipulateAttribute(t_MANIPULATOR &manipulator, int id)
Definition s_baltst_anonymouschoicesequence.h:463
friend bsl::ostream & operator<<(bsl::ostream &stream, const AnonChoiceSequence &rhs)
Definition s_baltst_anonymouschoicesequence.h:220
static const bdlat_AttributeInfo * lookupAttributeInfo(const char *name, int nameLength)
static const bdlat_AttributeInfo * lookupAttributeInfo(int id)
int accessAttribute(t_ACCESSOR &accessor, int id) const
Definition s_baltst_anonymouschoicesequence.h:514
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
int accessAttributes(t_ACCESSOR &accessor) const
Definition s_baltst_anonymouschoicesequence.h:501
@ ATTRIBUTE_INDEX_A
Definition s_baltst_anonymouschoicesequence.h:84
Definition s_baltst_anonymouschoicesequence.h:239
@ SELECTION_INDEX_SEQUENCE
Definition s_baltst_anonymouschoicesequence.h:264
AnonChoice & operator=(const AnonChoice &rhs)
Assign to this object the value of the specified rhs object.
AnonChoice()
Create an object of type AnonChoice having the default value.
Definition s_baltst_anonymouschoicesequence.h:578
static const bdlat_SelectionInfo * lookupSelectionInfo(const char *name, int nameLength)
AnonChoiceSequence & sequence()
Definition s_baltst_anonymouschoicesequence.h:604
@ SELECTION_ID_UNDEFINED
Definition s_baltst_anonymouschoicesequence.h:255
@ SELECTION_ID_SEQUENCE
Definition s_baltst_anonymouschoicesequence.h:256
int selectionId() const
Definition s_baltst_anonymouschoicesequence.h:612
static const bdlat_SelectionInfo * lookupSelectionInfo(int id)
bool isUndefinedValue() const
Definition s_baltst_anonymouschoicesequence.h:644
AnonChoiceSequence & makeSequence(const AnonChoiceSequence &value)
@ NUM_SELECTIONS
Definition s_baltst_anonymouschoicesequence.h:260
int manipulateSelection(t_MANIPULATOR &manipulator)
Definition s_baltst_anonymouschoicesequence.h:591
int makeSelection(const char *name, int nameLength)
friend bool operator==(const AnonChoice &lhs, const AnonChoice &rhs)
Definition s_baltst_anonymouschoicesequence.h:409
const char * selectionName() const
Return the symbolic name of the current selection of this object.
bsls::ObjectBuffer< AnonChoiceSequence > d_sequence
Definition s_baltst_anonymouschoicesequence.h:243
friend bool operator!=(const AnonChoice &lhs, const AnonChoice &rhs)
Definition s_baltst_anonymouschoicesequence.h:417
AnonChoiceSequence & makeSequence()
int accessSelection(t_ACCESSOR &accessor) const
Definition s_baltst_anonymouschoicesequence.h:618
~AnonChoice()
Destroy this object.
Definition s_baltst_anonymouschoicesequence.h:584
int makeSelection(int selectionId)
AnonChoice(const AnonChoice &original)
bool isSequenceValue() const
Definition s_baltst_anonymouschoicesequence.h:638
friend bsl::ostream & operator<<(bsl::ostream &stream, const AnonChoice &rhs)
Definition s_baltst_anonymouschoicesequence.h:424
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
static const char CLASS_NAME[]
Definition s_baltst_anonymouschoicesequence.h:268
static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]
Definition s_baltst_anonymouschoicesequence.h:270
#define BDLAT_DECL_CHOICE_WITH_BITWISEMOVEABLE_TRAITS(ClassName)
Definition bdlat_typetraits.h:261
#define BDLAT_DECL_SEQUENCE_WITH_BITWISEMOVEABLE_TRAITS(ClassName)
Definition bdlat_typetraits.h:294
#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 s_baltst_address.h:66
Definition bdlat_attributeinfo.h:139
int d_id
Definition bdlat_attributeinfo.h:142
Definition bdlat_selectioninfo.h:138
Definition bsls_objectbuffer.h:277