8#ifndef INCLUDED_S_BALTST_MYCHOICE
9#define INCLUDED_S_BALTST_MYCHOICE
43#include <bslalg_typetraits.h>
57#include <bsl_string.h>
59#include <bsl_iosfwd.h>
60#include <bsl_limits.h>
64namespace bslma {
class Allocator; }
66namespace s_baltst {
class MyChoice; }
135#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
136 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
160#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
161 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
191#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
192 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
204 template<
class MANIPULATOR>
230 bsl::ostream&
print(bsl::ostream& stream,
232 int spacesPerLevel = 4)
const;
242 template<
class ACCESSOR>
310: d_selectionId(SELECTION_ID_UNDEFINED)
311, d_allocator_p(
bslma::Default::allocator(basicAllocator))
322template <
class MANIPULATOR>
325 switch (d_selectionId) {
356 return d_selectionId;
359template <
class ACCESSOR>
362 switch (d_selectionId) {
418 case Class::SELECTION_ID_SELECTION1:
420 case Class::SELECTION_ID_SELECTION2:
437 return !(lhs == rhs);
442 bsl::ostream& stream,
445 return rhs.
print(stream, 0, -1);
Definition bslstl_string.h:1281
Definition bslma_allocator.h:457
Definition s_baltst_mychoice.h:73
static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]
Definition s_baltst_mychoice.h:105
bool isSelection1Value() const
Definition s_baltst_mychoice.h:390
const char * selectionName() const
Return the symbolic name of the current selection of this object.
@ SELECTION_ID_SELECTION1
Definition s_baltst_mychoice.h:89
@ SELECTION_ID_SELECTION2
Definition s_baltst_mychoice.h:90
@ SELECTION_ID_UNDEFINED
Definition s_baltst_mychoice.h:88
int makeSelection(int selectionId)
int makeSelection(const char *name, int nameLength)
bsls::ObjectBuffer< int > d_selection1
Definition s_baltst_mychoice.h:77
int manipulateSelection(MANIPULATOR &manipulator)
Definition s_baltst_mychoice.h:323
MyChoice & operator=(const MyChoice &rhs)
Assign to this object the value of the specified rhs object.
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
bsl::string & selection2()
Definition s_baltst_mychoice.h:346
bool isUndefinedValue() const
Definition s_baltst_mychoice.h:402
int accessSelection(ACCESSOR &accessor) const
Definition s_baltst_mychoice.h:360
@ SELECTION_INDEX_SELECTION1
Definition s_baltst_mychoice.h:98
@ SELECTION_INDEX_SELECTION2
Definition s_baltst_mychoice.h:99
static const bdlat_SelectionInfo * lookupSelectionInfo(int id)
static const bdlat_SelectionInfo * lookupSelectionInfo(const char *name, int nameLength)
bsl::string & makeSelection2(const bsl::string &value)
int & selection1()
Definition s_baltst_mychoice.h:339
bsl::string & makeSelection2()
@ NUM_SELECTIONS
Definition s_baltst_mychoice.h:94
~MyChoice()
Destroy this object.
Definition s_baltst_mychoice.h:316
static const char CLASS_NAME[]
Definition s_baltst_mychoice.h:103
int & makeSelection1(int value)
MyChoice(bslma::Allocator *basicAllocator=0)
Definition s_baltst_mychoice.h:309
MyChoice(const MyChoice &original, bslma::Allocator *basicAllocator=0)
int selectionId() const
Definition s_baltst_mychoice.h:354
bsls::ObjectBuffer< bsl::string > d_selection2
Definition s_baltst_mychoice.h:78
bool isSelection2Value() const
Definition s_baltst_mychoice.h:396
#define BDLAT_DECL_CHOICE_WITH_ALLOCATOR_BITWISEMOVEABLE_TRAITS(ClassName)
Definition bdlat_typetraits.h:249
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_IDENT_RCSID(tag, str)
Definition bsls_ident.h:260
#define BSLS_IDENT_PRAGMA_ONCE
Definition bsls_ident.h:310
Definition balxml_encoderoptions.h:68
Definition s_baltst_address.h:66
bool operator!=(const Address &lhs, const Address &rhs)
bool operator==(const Address &lhs, const Address &rhs)
bsl::ostream & operator<<(bsl::ostream &stream, const Address &rhs)
Definition bdlat_selectioninfo.h:136
TYPE & object()
Definition bsls_objectbuffer.h:351