BDE 4.14.0 Production release
Loading...
Searching...
No Matches
s_baltst_mysequencewithanonymouschoice.h
Go to the documentation of this file.
1/// @file s_baltst_mysequencewithanonymouschoice.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// s_baltst_mysequencewithanonymouschoice.h *DO NOT EDIT* @generated -*-C++-*-
8#ifndef INCLUDED_S_BALTST_MYSEQUENCEWITHANONYMOUSCHOICE
9#define INCLUDED_S_BALTST_MYSEQUENCEWITHANONYMOUSCHOICE
10
11#include <bsls_ident.h>
12BSLS_IDENT_RCSID(s_baltst_mysequencewithanonymouschoice_h, "$Id$ $CSID$")
14
15/// @defgroup s_baltst_mysequencewithanonymouschoice s_baltst_mysequencewithanonymouschoice
16/// @brief Provide value-semantic attribute classes
17/// @addtogroup Standalones
18/// @{
19/// @addtogroup s_baltst
20/// @{
21/// @addtogroup s_baltst_mysequencewithanonymouschoice
22/// @{
23///
24/// <h1> Outline </h1>
25/// * <a href="#s_baltst_mysequencewithanonymouschoice-purpose"> Purpose</a>
26///
27/// # Purpose {#s_baltst_mysequencewithanonymouschoice-purpose}
28/// Provide value-semantic attribute classes
29/// @}
30/** @} */
31/** @} */
32
33/** @addtogroup Standalones
34 * @{
35 */
36/** @addtogroup s_baltst
37 * @{
38 */
39/** @addtogroup s_baltst_mysequencewithanonymouschoice
40 * @{
41 */
42
43#include <bslalg_typetraits.h>
44
45#include <bdlat_attributeinfo.h>
46
47#include <bdlat_selectioninfo.h>
48
49#include <bdlat_typetraits.h>
50
51#include <bsls_objectbuffer.h>
52
53#include <bslma_default.h>
54
55#include <bsls_assert.h>
56
57#include <bdlb_nullablevalue.h>
58
59#include <bsl_string.h>
60
61#include <bsl_iosfwd.h>
62#include <bsl_limits.h>
63
64
65
66namespace bslma { class Allocator; }
67
68namespace s_baltst { class MySequenceWithAnonymousChoiceChoice; }
69namespace s_baltst { class MySequenceWithAnonymousChoice; }
70namespace s_baltst {
71
72 // =========================================
73 // class MySequenceWithAnonymousChoiceChoice
74 // =========================================
75
77
78 // INSTANCE DATA
79 union {
82 };
83
84 int d_selectionId;
85 bslma::Allocator *d_allocator_p;
86
87 public:
88 // TYPES
89
90 enum {
94 };
95
96 enum {
98 };
99
100 enum {
103 };
104
105 // CONSTANTS
106 static const char CLASS_NAME[];
107
109
110 // CLASS METHODS
111
112 /// Return selection information for the selection indicated by the
113 /// specified `id` if the selection exists, and 0 otherwise.
115
116 /// Return selection information for the selection indicated by the
117 /// specified `name` of the specified `nameLength` if the selection
118 /// exists, and 0 otherwise.
120 const char *name,
121 int nameLength);
122
123 // CREATORS
124
125 /// Create an object of type `MySequenceWithAnonymousChoiceChoice`
126 /// having the default value. Use the optionally specified
127 /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the
128 /// currently installed default allocator is used.
129 explicit MySequenceWithAnonymousChoiceChoice(bslma::Allocator *basicAllocator = 0);
130
131 /// Create an object of type `MySequenceWithAnonymousChoiceChoice`
132 /// having the value of the specified `original` object. Use the
133 /// optionally specified `basicAllocator` to supply memory. If
134 /// `basicAllocator` is 0, the currently installed default allocator is
135 /// used.
137 bslma::Allocator *basicAllocator = 0);
138
139#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
140 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
141 /// Create an object of type `MySequenceWithAnonymousChoiceChoice`
142 /// having the value of the specified `original` object. After
143 /// performing this action, the `original` object will be left in a
144 /// valid, but unspecified state.
146
147 /// Create an object of type `MySequenceWithAnonymousChoiceChoice`
148 /// having the value of the specified `original` object. After
149 /// performing this action, the `original` object will be left in a
150 /// valid, but unspecified state. Use the optionally specified
151 /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the
152 /// currently installed default allocator is used.
154 bslma::Allocator *basicAllocator);
155#endif
156
157 /// Destroy this object.
159
160 // MANIPULATORS
161
162 /// Assign to this object the value of the specified `rhs` object.
164
165#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
166 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
167 /// Assign to this object the value of the specified `rhs` object.
168 /// After performing this action, the `rhs` object will be left in a
169 /// valid, but unspecified state.
171#endif
172
173 /// Reset this object to the default value (i.e., its value upon default
174 /// construction).
175 void reset();
176
177 /// Set the value of this object to be the default for the selection
178 /// indicated by the specified `selectionId`. Return 0 on success, and
179 /// non-zero value otherwise (i.e., the selection is not found).
181
182 /// Set the value of this object to be the default for the selection
183 /// indicated by the specified `name` of the specified `nameLength`.
184 /// Return 0 on success, and non-zero value otherwise (i.e., the
185 /// selection is not found).
186 int makeSelection(const char *name, int nameLength);
187
188 /// Set the value of this object to be a "MyChoice1" value. Optionally
189 /// specify the `value` of the "MyChoice1". If `value` is not
190 /// specified, the default "MyChoice1" value is used.
192 int& makeMyChoice1(int value);
193
196#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
197 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
199#endif
200 // Set the value of this object to be a "MyChoice2" value. Optionally
201 // specify the 'value' of the "MyChoice2". If 'value' is not
202 // specified, the default "MyChoice2" value is used.
203
204 /// Invoke the specified `manipulator` on the address of the modifiable
205 /// selection, supplying `manipulator` with the corresponding selection
206 /// information structure. Return the value returned from the
207 /// invocation of `manipulator` if this object has a defined selection,
208 /// and -1 otherwise.
209 template<class MANIPULATOR>
210 int manipulateSelection(MANIPULATOR& manipulator);
211
212 /// Return a reference to the modifiable "MyChoice1" selection of this
213 /// object if "MyChoice1" is the current selection. The behavior is
214 /// undefined unless "MyChoice1" is the selection of this object.
215 int& myChoice1();
216
217 /// Return a reference to the modifiable "MyChoice2" selection of this
218 /// object if "MyChoice2" is the current selection. The behavior is
219 /// undefined unless "MyChoice2" is the selection of this object.
221
222 // ACCESSORS
223
224 /// Format this object to the specified output `stream` at the
225 /// optionally specified indentation `level` and return a reference to
226 /// the modifiable `stream`. If `level` is specified, optionally
227 /// specify `spacesPerLevel`, the number of spaces per indentation level
228 /// for this and all of its nested objects. Each line is indented by
229 /// the absolute value of `level * spacesPerLevel`. If `level` is
230 /// negative, suppress indentation of the first line. If
231 /// `spacesPerLevel` is negative, suppress line breaks and format the
232 /// entire output on one line. If `stream` is initially invalid, this
233 /// operation has no effect. Note that a trailing newline is provided
234 /// in multiline mode only.
235 bsl::ostream& print(bsl::ostream& stream,
236 int level = 0,
237 int spacesPerLevel = 4) const;
238
239 /// Return the id of the current selection if the selection is defined,
240 /// and -1 otherwise.
241 int selectionId() const;
242
243 /// Invoke the specified `accessor` on the non-modifiable selection,
244 /// supplying `accessor` with the corresponding selection information
245 /// structure. Return the value returned from the invocation of
246 /// `accessor` if this object has a defined selection, and -1 otherwise.
247 template<class ACCESSOR>
248 int accessSelection(ACCESSOR& accessor) const;
249
250 /// Return a reference to the non-modifiable "MyChoice1" selection of
251 /// this object if "MyChoice1" is the current selection. The behavior
252 /// is undefined unless "MyChoice1" is the selection of this object.
253 const int& myChoice1() const;
254
255 /// Return a reference to the non-modifiable "MyChoice2" selection of
256 /// this object if "MyChoice2" is the current selection. The behavior
257 /// is undefined unless "MyChoice2" is the selection of this object.
258 const bsl::string& myChoice2() const;
259
260 /// Return `true` if the value of this object is a "MyChoice1" value,
261 /// and return `false` otherwise.
262 bool isMyChoice1Value() const;
263
264 /// Return `true` if the value of this object is a "MyChoice2" value,
265 /// and return `false` otherwise.
266 bool isMyChoice2Value() const;
267
268 /// Return `true` if the value of this object is undefined, and `false`
269 /// otherwise.
270 bool isUndefinedValue() const;
271
272 /// Return the symbolic name of the current selection of this object.
273 const char *selectionName() const;
274};
275
276// FREE OPERATORS
277
278/// Return `true` if the specified `lhs` and `rhs` objects have the same
279/// value, and `false` otherwise. Two `MySequenceWithAnonymousChoiceChoice` objects have the same
280/// value if either the selections in both objects have the same ids and
281/// the same values, or both selections are undefined.
282inline
284
285/// Return `true` if the specified `lhs` and `rhs` objects do not have the
286/// same values, as determined by `operator==`, and `false` otherwise.
287inline
289
290/// Format the specified `rhs` to the specified output `stream` and
291/// return a reference to the modifiable `stream`.
292inline
293bsl::ostream& operator<<(bsl::ostream& stream, const MySequenceWithAnonymousChoiceChoice& rhs);
294
295} // close package namespace
296
297// TRAITS
298
300
301namespace s_baltst {
302
303 // ===================================
304 // class MySequenceWithAnonymousChoice
305 // ===================================
306
308
309 // INSTANCE DATA
312 bdlb::NullableValue<int> d_attribute1;
313
314 public:
315 // TYPES
316 enum {
320 };
321
322 enum {
324 };
325
326 enum {
330 };
331
332 // CONSTANTS
333 static const char CLASS_NAME[];
334
336
337 public:
338 // CLASS METHODS
339
340 /// Return attribute information for the attribute indicated by the
341 /// specified `id` if the attribute exists, and 0 otherwise.
343
344 /// Return attribute information for the attribute indicated by the
345 /// specified `name` of the specified `nameLength` if the attribute
346 /// exists, and 0 otherwise.
348 const char *name,
349 int nameLength);
350
351 // CREATORS
352
353 /// Create an object of type `MySequenceWithAnonymousChoice` having the
354 /// default value. Use the optionally specified `basicAllocator` to
355 /// supply memory. If `basicAllocator` is 0, the currently installed
356 /// default allocator is used.
357 explicit MySequenceWithAnonymousChoice(bslma::Allocator *basicAllocator = 0);
358
359 /// Create an object of type `MySequenceWithAnonymousChoice` having the
360 /// value of the specified `original` object. Use the optionally
361 /// specified `basicAllocator` to supply memory. If `basicAllocator` is
362 /// 0, the currently installed default allocator is used.
364 bslma::Allocator *basicAllocator = 0);
365
366#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
367 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
368 /// Create an object of type `MySequenceWithAnonymousChoice` having the
369 /// value of the specified `original` object. After performing this
370 /// action, the `original` object will be left in a valid, but
371 /// unspecified state.
373
374 /// Create an object of type `MySequenceWithAnonymousChoice` having the
375 /// value of the specified `original` object. After performing this
376 /// action, the `original` object will be left in a valid, but
377 /// unspecified state. Use the optionally specified `basicAllocator` to
378 /// supply memory. If `basicAllocator` is 0, the currently installed
379 /// default allocator is used.
381 bslma::Allocator *basicAllocator);
382#endif
383
384 /// Destroy this object.
386
387 // MANIPULATORS
388
389 /// Assign to this object the value of the specified `rhs` object.
391
392#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
393 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
394 /// Assign to this object the value of the specified `rhs` object.
395 /// After performing this action, the `rhs` object will be left in a
396 /// valid, but unspecified state.
398#endif
399
400 /// Reset this object to the default value (i.e., its value upon
401 /// default construction).
402 void reset();
403
404 /// Invoke the specified `manipulator` sequentially on the address of
405 /// each (modifiable) attribute of this object, supplying `manipulator`
406 /// with the corresponding attribute information structure until such
407 /// invocation returns a non-zero value. Return the value from the
408 /// last invocation of `manipulator` (i.e., the invocation that
409 /// terminated the sequence).
410 template<class MANIPULATOR>
411 int manipulateAttributes(MANIPULATOR& manipulator);
412
413 /// Invoke the specified `manipulator` on the address of
414 /// the (modifiable) attribute indicated by the specified `id`,
415 /// supplying `manipulator` with the corresponding attribute
416 /// information structure. Return the value returned from the
417 /// invocation of `manipulator` if `id` identifies an attribute of this
418 /// class, and -1 otherwise.
419 template<class MANIPULATOR>
420 int manipulateAttribute(MANIPULATOR& manipulator, int id);
421
422 /// Invoke the specified `manipulator` on the address of
423 /// the (modifiable) attribute indicated by the specified `name` of the
424 /// specified `nameLength`, supplying `manipulator` with the
425 /// corresponding attribute information structure. Return the value
426 /// returned from the invocation of `manipulator` if `name` identifies
427 /// an attribute of this class, and -1 otherwise.
428 template<class MANIPULATOR>
429 int manipulateAttribute(MANIPULATOR& manipulator,
430 const char *name,
431 int nameLength);
432
433 /// Return a reference to the modifiable "Attribute1" attribute of this
434 /// object.
436
437 /// Return a reference to the modifiable "Choice" attribute of this
438 /// object.
440
441 /// Return a reference to the modifiable "Attribute2" attribute of this
442 /// object.
444
445 // ACCESSORS
446
447 /// Format this object to the specified output `stream` at the
448 /// optionally specified indentation `level` and return a reference to
449 /// the modifiable `stream`. If `level` is specified, optionally
450 /// specify `spacesPerLevel`, the number of spaces per indentation level
451 /// for this and all of its nested objects. Each line is indented by
452 /// the absolute value of `level * spacesPerLevel`. If `level` is
453 /// negative, suppress indentation of the first line. If
454 /// `spacesPerLevel` is negative, suppress line breaks and format the
455 /// entire output on one line. If `stream` is initially invalid, this
456 /// operation has no effect. Note that a trailing newline is provided
457 /// in multiline mode only.
458 bsl::ostream& print(bsl::ostream& stream,
459 int level = 0,
460 int spacesPerLevel = 4) const;
461
462 /// Invoke the specified `accessor` sequentially on each
463 /// (non-modifiable) attribute of this object, supplying `accessor`
464 /// with the corresponding attribute information structure until such
465 /// invocation returns a non-zero value. Return the value from the
466 /// last invocation of `accessor` (i.e., the invocation that terminated
467 /// the sequence).
468 template<class ACCESSOR>
469 int accessAttributes(ACCESSOR& accessor) const;
470
471 /// Invoke the specified `accessor` on the (non-modifiable) attribute
472 /// of this object indicated by the specified `id`, supplying `accessor`
473 /// with the corresponding attribute information structure. Return the
474 /// value returned from the invocation of `accessor` if `id` identifies
475 /// an attribute of this class, and -1 otherwise.
476 template<class ACCESSOR>
477 int accessAttribute(ACCESSOR& accessor, int id) const;
478
479 /// Invoke the specified `accessor` on the (non-modifiable) attribute
480 /// of this object indicated by the specified `name` of the specified
481 /// `nameLength`, supplying `accessor` with the corresponding attribute
482 /// information structure. Return the value returned from the
483 /// invocation of `accessor` if `name` identifies an attribute of this
484 /// class, and -1 otherwise.
485 template<class ACCESSOR>
486 int accessAttribute(ACCESSOR& accessor,
487 const char *name,
488 int nameLength) const;
489
490 /// Return a reference offering non-modifiable access to the
491 /// "Attribute1" attribute of this object.
493
494 /// Return a reference offering non-modifiable access to the "Choice"
495 /// attribute of this object.
497
498 /// Return a reference offering non-modifiable access to the
499 /// "Attribute2" attribute of this object.
501};
502
503// FREE OPERATORS
504
505/// Return `true` if the specified `lhs` and `rhs` attribute objects have
506/// the same value, and `false` otherwise. Two attribute objects have the
507/// same value if each respective attribute has the same value.
508inline
509bool operator==(const MySequenceWithAnonymousChoice& lhs, const MySequenceWithAnonymousChoice& rhs);
510
511/// Return `true` if the specified `lhs` and `rhs` attribute objects do not
512/// have the same value, and `false` otherwise. Two attribute objects do
513/// not have the same value if one or more respective attributes differ in
514/// values.
515inline
516bool operator!=(const MySequenceWithAnonymousChoice& lhs, const MySequenceWithAnonymousChoice& rhs);
517
518/// Format the specified `rhs` to the specified output `stream` and
519/// return a reference to the modifiable `stream`.
520inline
521bsl::ostream& operator<<(bsl::ostream& stream, const MySequenceWithAnonymousChoice& rhs);
522
523} // close package namespace
524
525// TRAITS
526
528
529// ============================================================================
530// INLINE FUNCTION DEFINITIONS
531// ============================================================================
532
533namespace s_baltst {
534
535 // -----------------------------------------
536 // class MySequenceWithAnonymousChoiceChoice
537 // -----------------------------------------
538
539// CLASS METHODS
540// CREATORS
541inline
543: d_selectionId(SELECTION_ID_UNDEFINED)
544, d_allocator_p(bslma::Default::allocator(basicAllocator))
545{
546}
547
548inline
553
554// MANIPULATORS
555template <class MANIPULATOR>
570
571inline
577
578inline
584
585// ACCESSORS
586inline
588{
589 return d_selectionId;
590}
591
592template <class ACCESSOR>
594{
595 switch (d_selectionId) {
597 return accessor(d_myChoice1.object(),
600 return accessor(d_myChoice2.object(),
602 default:
603 BSLS_ASSERT(SELECTION_ID_UNDEFINED == d_selectionId);
604 return -1;
605 }
606}
607
608inline
610{
611 BSLS_ASSERT(SELECTION_ID_MY_CHOICE1 == d_selectionId);
612 return d_myChoice1.object();
613}
614
615inline
617{
618 BSLS_ASSERT(SELECTION_ID_MY_CHOICE2 == d_selectionId);
619 return d_myChoice2.object();
620}
621
622inline
624{
625 return SELECTION_ID_MY_CHOICE1 == d_selectionId;
626}
627
628inline
630{
631 return SELECTION_ID_MY_CHOICE2 == d_selectionId;
632}
633
634inline
636{
637 return SELECTION_ID_UNDEFINED == d_selectionId;
638}
639
640
641 // -----------------------------------
642 // class MySequenceWithAnonymousChoice
643 // -----------------------------------
644
645// CLASS METHODS
646// MANIPULATORS
647template <class MANIPULATOR>
649{
650 int ret;
651
652 ret = manipulator(&d_attribute1, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ATTRIBUTE1]);
653 if (ret) {
654 return ret;
655 }
656
657 ret = manipulator(&d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
658 if (ret) {
659 return ret;
660 }
661
662 ret = manipulator(&d_attribute2, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ATTRIBUTE2]);
663 if (ret) {
664 return ret;
665 }
666
667 return 0;
668}
669
670template <class MANIPULATOR>
671int MySequenceWithAnonymousChoice::manipulateAttribute(MANIPULATOR& manipulator, int id)
672{
673 enum { NOT_FOUND = -1 };
674
675 switch (id) {
677 return manipulator(&d_attribute1, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ATTRIBUTE1]);
678 }
679 case ATTRIBUTE_ID_CHOICE: {
680 return manipulator(&d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
681 }
683 return manipulator(&d_attribute2, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ATTRIBUTE2]);
684 }
685 default:
686 return NOT_FOUND;
687 }
688}
689
690template <class MANIPULATOR>
692 MANIPULATOR& manipulator,
693 const char *name,
694 int nameLength)
695{
696 enum { NOT_FOUND = -1 };
697
698 const bdlat_AttributeInfo *attributeInfo =
699 lookupAttributeInfo(name, nameLength);
700 if (0 == attributeInfo) {
701 return NOT_FOUND;
702 }
703
704 return manipulateAttribute(manipulator, attributeInfo->d_id);
705}
706
707inline
712
713inline
718
719inline
724
725// ACCESSORS
726template <class ACCESSOR>
728{
729 int ret;
730
731 ret = accessor(d_attribute1, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ATTRIBUTE1]);
732 if (ret) {
733 return ret;
734 }
735
736 ret = accessor(d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
737 if (ret) {
738 return ret;
739 }
740
741 ret = accessor(d_attribute2, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ATTRIBUTE2]);
742 if (ret) {
743 return ret;
744 }
745
746 return 0;
747}
748
749template <class ACCESSOR>
750int MySequenceWithAnonymousChoice::accessAttribute(ACCESSOR& accessor, int id) const
751{
752 enum { NOT_FOUND = -1 };
753
754 switch (id) {
756 return accessor(d_attribute1, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ATTRIBUTE1]);
757 }
758 case ATTRIBUTE_ID_CHOICE: {
759 return accessor(d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
760 }
762 return accessor(d_attribute2, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ATTRIBUTE2]);
763 }
764 default:
765 return NOT_FOUND;
766 }
767}
768
769template <class ACCESSOR>
771 ACCESSOR& accessor,
772 const char *name,
773 int nameLength) const
774{
775 enum { NOT_FOUND = -1 };
776
777 const bdlat_AttributeInfo *attributeInfo =
778 lookupAttributeInfo(name, nameLength);
779 if (0 == attributeInfo) {
780 return NOT_FOUND;
781 }
782
783 return accessAttribute(accessor, attributeInfo->d_id);
784}
785
786inline
788{
789 return d_attribute1;
790}
791
792inline
797
798inline
800{
801 return d_attribute2;
802}
803
804} // close package namespace
805
806// FREE FUNCTIONS
807
808inline
812{
814 if (lhs.selectionId() == rhs.selectionId()) {
815 switch (rhs.selectionId()) {
816 case Class::SELECTION_ID_MY_CHOICE1:
817 return lhs.myChoice1() == rhs.myChoice1();
818 case Class::SELECTION_ID_MY_CHOICE2:
819 return lhs.myChoice2() == rhs.myChoice2();
820 default:
821 BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId());
822 return true;
823 }
824 }
825 else {
826 return false;
827 }
828}
829
830inline
834{
835 return !(lhs == rhs);
836}
837
838inline
839bsl::ostream& s_baltst::operator<<(
840 bsl::ostream& stream,
842{
843 return rhs.print(stream, 0, -1);
844}
845
846
847inline
851{
852 return lhs.attribute1() == rhs.attribute1()
853 && lhs.choice() == rhs.choice()
854 && lhs.attribute2() == rhs.attribute2();
855}
856
857inline
861{
862 return !(lhs == rhs);
863}
864
865inline
866bsl::ostream& s_baltst::operator<<(
867 bsl::ostream& stream,
869{
870 return rhs.print(stream, 0, -1);
871}
872
873
874#endif
875
876// GENERATED BY @BLP_BAS_CODEGEN_VERSION@
877// USING bas_codegen.pl s_baltst_mysequencewithanonymouschoice.xsd --mode msg --includedir . --msgComponent mysequencewithanonymouschoice --noRecurse --noExternalization --noHashSupport --noAggregateConversion
878// ----------------------------------------------------------------------------
879// NOTICE:
880// Copyright 2022 Bloomberg Finance L.P. All rights reserved.
881// Property of Bloomberg Finance L.P. (BFLP)
882// This software is made available solely pursuant to the
883// terms of a BFLP license agreement which governs its use.
884// ------------------------------- END-OF-FILE --------------------------------
885
886/** @} */
887/** @} */
888/** @} */
Definition bdlb_nullablevalue.h:257
Definition bslstl_string.h:1281
Definition bslma_allocator.h:457
Definition s_baltst_mysequencewithanonymouschoice.h:76
bsls::ObjectBuffer< int > d_myChoice1
Definition s_baltst_mysequencewithanonymouschoice.h:80
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
bsls::ObjectBuffer< bsl::string > d_myChoice2
Definition s_baltst_mysequencewithanonymouschoice.h:81
static const char CLASS_NAME[]
Definition s_baltst_mysequencewithanonymouschoice.h:106
const char * selectionName() const
Return the symbolic name of the current selection of this object.
static const bdlat_SelectionInfo * lookupSelectionInfo(int id)
bool isMyChoice2Value() const
Definition s_baltst_mysequencewithanonymouschoice.h:629
bsl::string & myChoice2()
Definition s_baltst_mysequencewithanonymouschoice.h:579
MySequenceWithAnonymousChoiceChoice(bslma::Allocator *basicAllocator=0)
Definition s_baltst_mysequencewithanonymouschoice.h:542
bool isMyChoice1Value() const
Definition s_baltst_mysequencewithanonymouschoice.h:623
~MySequenceWithAnonymousChoiceChoice()
Destroy this object.
Definition s_baltst_mysequencewithanonymouschoice.h:549
int selectionId() const
Definition s_baltst_mysequencewithanonymouschoice.h:587
int & myChoice1()
Definition s_baltst_mysequencewithanonymouschoice.h:572
int makeSelection(const char *name, int nameLength)
@ SELECTION_INDEX_MY_CHOICE2
Definition s_baltst_mysequencewithanonymouschoice.h:102
@ SELECTION_INDEX_MY_CHOICE1
Definition s_baltst_mysequencewithanonymouschoice.h:101
@ SELECTION_ID_UNDEFINED
Definition s_baltst_mysequencewithanonymouschoice.h:91
@ SELECTION_ID_MY_CHOICE1
Definition s_baltst_mysequencewithanonymouschoice.h:92
@ SELECTION_ID_MY_CHOICE2
Definition s_baltst_mysequencewithanonymouschoice.h:93
MySequenceWithAnonymousChoiceChoice & operator=(const MySequenceWithAnonymousChoiceChoice &rhs)
Assign to this object the value of the specified rhs object.
bool isUndefinedValue() const
Definition s_baltst_mysequencewithanonymouschoice.h:635
MySequenceWithAnonymousChoiceChoice(const MySequenceWithAnonymousChoiceChoice &original, bslma::Allocator *basicAllocator=0)
@ NUM_SELECTIONS
Definition s_baltst_mysequencewithanonymouschoice.h:97
static const bdlat_SelectionInfo * lookupSelectionInfo(const char *name, int nameLength)
static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]
Definition s_baltst_mysequencewithanonymouschoice.h:108
bsl::string & makeMyChoice2(const bsl::string &value)
int accessSelection(ACCESSOR &accessor) const
Definition s_baltst_mysequencewithanonymouschoice.h:593
int manipulateSelection(MANIPULATOR &manipulator)
Definition s_baltst_mysequencewithanonymouschoice.h:556
Definition s_baltst_mysequencewithanonymouschoice.h:307
int manipulateAttributes(MANIPULATOR &manipulator)
Definition s_baltst_mysequencewithanonymouschoice.h:648
int accessAttribute(ACCESSOR &accessor, int id) const
Definition s_baltst_mysequencewithanonymouschoice.h:750
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
static const bdlat_AttributeInfo ATTRIBUTE_INFO_ARRAY[]
Definition s_baltst_mysequencewithanonymouschoice.h:335
MySequenceWithAnonymousChoice & operator=(const MySequenceWithAnonymousChoice &rhs)
Assign to this object the value of the specified rhs object.
MySequenceWithAnonymousChoice(const MySequenceWithAnonymousChoice &original, bslma::Allocator *basicAllocator=0)
int manipulateAttribute(MANIPULATOR &manipulator, int id)
Definition s_baltst_mysequencewithanonymouschoice.h:671
@ ATTRIBUTE_ID_ATTRIBUTE1
Definition s_baltst_mysequencewithanonymouschoice.h:317
@ ATTRIBUTE_ID_CHOICE
Definition s_baltst_mysequencewithanonymouschoice.h:318
@ ATTRIBUTE_ID_ATTRIBUTE2
Definition s_baltst_mysequencewithanonymouschoice.h:319
int accessAttributes(ACCESSOR &accessor) const
Definition s_baltst_mysequencewithanonymouschoice.h:727
static const char CLASS_NAME[]
Definition s_baltst_mysequencewithanonymouschoice.h:333
static const bdlat_AttributeInfo * lookupAttributeInfo(const char *name, int nameLength)
~MySequenceWithAnonymousChoice()
Destroy this object.
MySequenceWithAnonymousChoiceChoice & choice()
Definition s_baltst_mysequencewithanonymouschoice.h:714
@ ATTRIBUTE_INDEX_ATTRIBUTE2
Definition s_baltst_mysequencewithanonymouschoice.h:329
@ ATTRIBUTE_INDEX_ATTRIBUTE1
Definition s_baltst_mysequencewithanonymouschoice.h:327
@ ATTRIBUTE_INDEX_CHOICE
Definition s_baltst_mysequencewithanonymouschoice.h:328
@ NUM_ATTRIBUTES
Definition s_baltst_mysequencewithanonymouschoice.h:323
MySequenceWithAnonymousChoice(bslma::Allocator *basicAllocator=0)
bdlb::NullableValue< int > & attribute1()
Definition s_baltst_mysequencewithanonymouschoice.h:708
bdlb::NullableValue< bsl::string > & attribute2()
Definition s_baltst_mysequencewithanonymouschoice.h:720
static const bdlat_AttributeInfo * lookupAttributeInfo(int id)
#define BDLAT_DECL_CHOICE_WITH_ALLOCATOR_BITWISEMOVEABLE_TRAITS(ClassName)
Definition bdlat_typetraits.h:249
#define BDLAT_DECL_SEQUENCE_WITH_ALLOCATOR_BITWISEMOVEABLE_TRAITS(ClassName)
Definition bdlat_typetraits.h:282
#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_attributeinfo.h:137
int d_id
Definition bdlat_attributeinfo.h:140
Definition bdlat_selectioninfo.h:136
TYPE & object()
Definition bsls_objectbuffer.h:351