BDE 4.14.0 Production release
Loading...
Searching...
No Matches
s_baltst_sequencewithanonymity.h
Go to the documentation of this file.
1/// @file s_baltst_sequencewithanonymity.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// s_baltst_sequencewithanonymity.h *DO NOT EDIT* @generated -*-C++-*-
8#ifndef INCLUDED_S_BALTST_SEQUENCEWITHANONYMITY
9#define INCLUDED_S_BALTST_SEQUENCEWITHANONYMITY
10
11#include <bsls_ident.h>
12BSLS_IDENT_RCSID(s_baltst_sequencewithanonymity_h, "$Id$ $CSID$")
14
15/// @defgroup s_baltst_sequencewithanonymity s_baltst_sequencewithanonymity
16/// @brief Provide value-semantic attribute classes
17/// @addtogroup Standalones
18/// @{
19/// @addtogroup s_baltst
20/// @{
21/// @addtogroup s_baltst_sequencewithanonymity
22/// @{
23///
24/// <h1> Outline </h1>
25/// * <a href="#s_baltst_sequencewithanonymity-purpose"> Purpose</a>
26///
27/// # Purpose {#s_baltst_sequencewithanonymity-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_sequencewithanonymity
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 <s_baltst_customint.h>
62
64
65#include <s_baltst_ratsnest.h>
66
67#include <bsl_iosfwd.h>
68#include <bsl_limits.h>
69
70
71
72namespace bslma { class Allocator; }
73
74namespace s_baltst { class SequenceWithAnonymityChoice1; }
75namespace s_baltst { class SequenceWithAnonymityChoice; }
76namespace s_baltst { class SequenceWithAnonymityChoice2; }
77namespace s_baltst { class SequenceWithAnonymity; }
78namespace s_baltst {
79
80 // ==================================
81 // class SequenceWithAnonymityChoice1
82 // ==================================
83
85
86 // INSTANCE DATA
87 union {
90 };
91
92 int d_selectionId;
93 bslma::Allocator *d_allocator_p;
94
95 public:
96 // TYPES
97
98 enum {
102 };
103
104 enum {
106 };
107
108 enum {
111 };
112
113 // CONSTANTS
114 static const char CLASS_NAME[];
115
117
118 // CLASS METHODS
119
120 /// Return selection information for the selection indicated by the
121 /// specified `id` if the selection exists, and 0 otherwise.
123
124 /// Return selection information for the selection indicated by the
125 /// specified `name` of the specified `nameLength` if the selection
126 /// exists, and 0 otherwise.
128 const char *name,
129 int nameLength);
130
131 // CREATORS
132
133 /// Create an object of type `SequenceWithAnonymityChoice1` having the
134 /// default value. Use the optionally specified `basicAllocator` to
135 /// supply memory. If `basicAllocator` is 0, the currently installed
136 /// default allocator is used.
137 explicit SequenceWithAnonymityChoice1(bslma::Allocator *basicAllocator = 0);
138
139 /// Create an object of type `SequenceWithAnonymityChoice1` having the
140 /// value of the specified `original` object. Use the optionally
141 /// specified `basicAllocator` to supply memory. If `basicAllocator` is
142 /// 0, the currently installed default allocator is used.
144 bslma::Allocator *basicAllocator = 0);
145
146#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
147 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
148 /// Create an object of type `SequenceWithAnonymityChoice1` having the
149 /// value of the specified `original` object. After performing this
150 /// action, the `original` object will be left in a valid, but
151 /// unspecified state.
153
154 /// Create an object of type `SequenceWithAnonymityChoice1` having the
155 /// value of the specified `original` object. After performing this
156 /// action, the `original` object will be left in a valid, but
157 /// unspecified state. Use the optionally specified `basicAllocator` to
158 /// supply memory. If `basicAllocator` is 0, the currently installed
159 /// default allocator is used.
161 bslma::Allocator *basicAllocator);
162#endif
163
164 /// Destroy this object.
166
167 // MANIPULATORS
168
169 /// Assign to this object the value of the specified `rhs` object.
171
172#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
173 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
174 /// Assign to this object the value of the specified `rhs` object.
175 /// After performing this action, the `rhs` object will be left in a
176 /// valid, but unspecified state.
178#endif
179
180 /// Reset this object to the default value (i.e., its value upon default
181 /// construction).
182 void reset();
183
184 /// Set the value of this object to be the default for the selection
185 /// indicated by the specified `selectionId`. Return 0 on success, and
186 /// non-zero value otherwise (i.e., the selection is not found).
188
189 /// Set the value of this object to be the default for the selection
190 /// indicated by the specified `name` of the specified `nameLength`.
191 /// Return 0 on success, and non-zero value otherwise (i.e., the
192 /// selection is not found).
193 int makeSelection(const char *name, int nameLength);
194
195 /// Set the value of this object to be a "Selection5" value. Optionally
196 /// specify the `value` of the "Selection5". If `value` is not
197 /// specified, the default "Selection5" value is used.
199 bool& makeSelection5(bool value);
200
203#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
204 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
206#endif
207 // Set the value of this object to be a "Selection6" value. Optionally
208 // specify the 'value' of the "Selection6". If 'value' is not
209 // specified, the default "Selection6" value is used.
210
211 /// Invoke the specified `manipulator` on the address of the modifiable
212 /// selection, supplying `manipulator` with the corresponding selection
213 /// information structure. Return the value returned from the
214 /// invocation of `manipulator` if this object has a defined selection,
215 /// and -1 otherwise.
216 template<class MANIPULATOR>
217 int manipulateSelection(MANIPULATOR& manipulator);
218
219 /// Return a reference to the modifiable "Selection5" selection of this
220 /// object if "Selection5" is the current selection. The behavior is
221 /// undefined unless "Selection5" is the selection of this object.
222 bool& selection5();
223
224 /// Return a reference to the modifiable "Selection6" selection of this
225 /// object if "Selection6" is the current selection. The behavior is
226 /// undefined unless "Selection6" is the selection of this object.
228
229 // ACCESSORS
230
231 /// Format this object to the specified output `stream` at the
232 /// optionally specified indentation `level` and return a reference to
233 /// the modifiable `stream`. If `level` is specified, optionally
234 /// specify `spacesPerLevel`, the number of spaces per indentation level
235 /// for this and all of its nested objects. Each line is indented by
236 /// the absolute value of `level * spacesPerLevel`. If `level` is
237 /// negative, suppress indentation of the first line. If
238 /// `spacesPerLevel` is negative, suppress line breaks and format the
239 /// entire output on one line. If `stream` is initially invalid, this
240 /// operation has no effect. Note that a trailing newline is provided
241 /// in multiline mode only.
242 bsl::ostream& print(bsl::ostream& stream,
243 int level = 0,
244 int spacesPerLevel = 4) const;
245
246 /// Return the id of the current selection if the selection is defined,
247 /// and -1 otherwise.
248 int selectionId() const;
249
250 /// Invoke the specified `accessor` on the non-modifiable selection,
251 /// supplying `accessor` with the corresponding selection information
252 /// structure. Return the value returned from the invocation of
253 /// `accessor` if this object has a defined selection, and -1 otherwise.
254 template<class ACCESSOR>
255 int accessSelection(ACCESSOR& accessor) const;
256
257 /// Return a reference to the non-modifiable "Selection5" selection of
258 /// this object if "Selection5" is the current selection. The behavior
259 /// is undefined unless "Selection5" is the selection of this object.
260 const bool& selection5() const;
261
262 /// Return a reference to the non-modifiable "Selection6" selection of
263 /// this object if "Selection6" is the current selection. The behavior
264 /// is undefined unless "Selection6" is the selection of this object.
265 const bsl::string& selection6() const;
266
267 /// Return `true` if the value of this object is a "Selection5" value,
268 /// and return `false` otherwise.
269 bool isSelection5Value() const;
270
271 /// Return `true` if the value of this object is a "Selection6" value,
272 /// and return `false` otherwise.
273 bool isSelection6Value() const;
274
275 /// Return `true` if the value of this object is undefined, and `false`
276 /// otherwise.
277 bool isUndefinedValue() const;
278
279 /// Return the symbolic name of the current selection of this object.
280 const char *selectionName() const;
281};
282
283// FREE OPERATORS
284
285/// Return `true` if the specified `lhs` and `rhs` objects have the same
286/// value, and `false` otherwise. Two `SequenceWithAnonymityChoice1` objects have the same
287/// value if either the selections in both objects have the same ids and
288/// the same values, or both selections are undefined.
289inline
290bool operator==(const SequenceWithAnonymityChoice1& lhs, const SequenceWithAnonymityChoice1& rhs);
291
292/// Return `true` if the specified `lhs` and `rhs` objects do not have the
293/// same values, as determined by `operator==`, and `false` otherwise.
294inline
295bool operator!=(const SequenceWithAnonymityChoice1& lhs, const SequenceWithAnonymityChoice1& rhs);
296
297/// Format the specified `rhs` to the specified output `stream` and
298/// return a reference to the modifiable `stream`.
299inline
300bsl::ostream& operator<<(bsl::ostream& stream, const SequenceWithAnonymityChoice1& rhs);
301
302} // close package namespace
303
304// TRAITS
305
307
308namespace s_baltst {
309
310 // =================================
311 // class SequenceWithAnonymityChoice
312 // =================================
313
315
316 // INSTANCE DATA
317 union {
322 };
323
324 int d_selectionId;
325 bslma::Allocator *d_allocator_p;
326
327 public:
328 // TYPES
329
330 enum {
336 };
337
338 enum {
340 };
341
342 enum {
347 };
348
349 // CONSTANTS
350 static const char CLASS_NAME[];
351
353
354 // CLASS METHODS
355
356 /// Return selection information for the selection indicated by the
357 /// specified `id` if the selection exists, and 0 otherwise.
359
360 /// Return selection information for the selection indicated by the
361 /// specified `name` of the specified `nameLength` if the selection
362 /// exists, and 0 otherwise.
364 const char *name,
365 int nameLength);
366
367 // CREATORS
368
369 /// Create an object of type `SequenceWithAnonymityChoice` having the
370 /// default value. Use the optionally specified `basicAllocator` to
371 /// supply memory. If `basicAllocator` is 0, the currently installed
372 /// default allocator is used.
373 explicit SequenceWithAnonymityChoice(bslma::Allocator *basicAllocator = 0);
374
375 /// Create an object of type `SequenceWithAnonymityChoice` having the
376 /// value of the specified `original` object. Use the optionally
377 /// specified `basicAllocator` to supply memory. If `basicAllocator` is
378 /// 0, the currently installed default allocator is used.
380 bslma::Allocator *basicAllocator = 0);
381
382#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
383 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
384 /// Create an object of type `SequenceWithAnonymityChoice` having the
385 /// value of the specified `original` object. After performing this
386 /// action, the `original` object will be left in a valid, but
387 /// unspecified state.
389
390 /// Create an object of type `SequenceWithAnonymityChoice` having the
391 /// value of the specified `original` object. After performing this
392 /// action, the `original` object will be left in a valid, but
393 /// unspecified state. Use the optionally specified `basicAllocator` to
394 /// supply memory. If `basicAllocator` is 0, the currently installed
395 /// default allocator is used.
397 bslma::Allocator *basicAllocator);
398#endif
399
400 /// Destroy this object.
402
403 // MANIPULATORS
404
405 /// Assign to this object the value of the specified `rhs` object.
407
408#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
409 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
410 /// Assign to this object the value of the specified `rhs` object.
411 /// After performing this action, the `rhs` object will be left in a
412 /// valid, but unspecified state.
414#endif
415
416 /// Reset this object to the default value (i.e., its value upon default
417 /// construction).
418 void reset();
419
420 /// Set the value of this object to be the default for the selection
421 /// indicated by the specified `selectionId`. Return 0 on success, and
422 /// non-zero value otherwise (i.e., the selection is not found).
424
425 /// Set the value of this object to be the default for the selection
426 /// indicated by the specified `name` of the specified `nameLength`.
427 /// Return 0 on success, and non-zero value otherwise (i.e., the
428 /// selection is not found).
429 int makeSelection(const char *name, int nameLength);
430
433#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
434 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
436#endif
437 // Set the value of this object to be a "Selection1" value. Optionally
438 // specify the 'value' of the "Selection1". If 'value' is not
439 // specified, the default "Selection1" value is used.
440
441 /// Set the value of this object to be a "Selection2" value. Optionally
442 /// specify the `value` of the "Selection2". If `value` is not
443 /// specified, the default "Selection2" value is used.
444 unsigned char& makeSelection2();
445 unsigned char& makeSelection2(unsigned char value);
446
449#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
450 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
452#endif
453 // Set the value of this object to be a "Selection3" value. Optionally
454 // specify the 'value' of the "Selection3". If 'value' is not
455 // specified, the default "Selection3" value is used.
456
459#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
460 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
462#endif
463 // Set the value of this object to be a "Selection4" value. Optionally
464 // specify the 'value' of the "Selection4". If 'value' is not
465 // specified, the default "Selection4" value is used.
466
467 /// Invoke the specified `manipulator` on the address of the modifiable
468 /// selection, supplying `manipulator` with the corresponding selection
469 /// information structure. Return the value returned from the
470 /// invocation of `manipulator` if this object has a defined selection,
471 /// and -1 otherwise.
472 template<class MANIPULATOR>
473 int manipulateSelection(MANIPULATOR& manipulator);
474
475 /// Return a reference to the modifiable "Selection1" selection of this
476 /// object if "Selection1" is the current selection. The behavior is
477 /// undefined unless "Selection1" is the selection of this object.
479
480 /// Return a reference to the modifiable "Selection2" selection of this
481 /// object if "Selection2" is the current selection. The behavior is
482 /// undefined unless "Selection2" is the selection of this object.
483 unsigned char& selection2();
484
485 /// Return a reference to the modifiable "Selection3" selection of this
486 /// object if "Selection3" is the current selection. The behavior is
487 /// undefined unless "Selection3" is the selection of this object.
489
490 /// Return a reference to the modifiable "Selection4" selection of this
491 /// object if "Selection4" is the current selection. The behavior is
492 /// undefined unless "Selection4" is the selection of this object.
494
495 // ACCESSORS
496
497 /// Format this object to the specified output `stream` at the
498 /// optionally specified indentation `level` and return a reference to
499 /// the modifiable `stream`. If `level` is specified, optionally
500 /// specify `spacesPerLevel`, the number of spaces per indentation level
501 /// for this and all of its nested objects. Each line is indented by
502 /// the absolute value of `level * spacesPerLevel`. If `level` is
503 /// negative, suppress indentation of the first line. If
504 /// `spacesPerLevel` is negative, suppress line breaks and format the
505 /// entire output on one line. If `stream` is initially invalid, this
506 /// operation has no effect. Note that a trailing newline is provided
507 /// in multiline mode only.
508 bsl::ostream& print(bsl::ostream& stream,
509 int level = 0,
510 int spacesPerLevel = 4) const;
511
512 /// Return the id of the current selection if the selection is defined,
513 /// and -1 otherwise.
514 int selectionId() const;
515
516 /// Invoke the specified `accessor` on the non-modifiable selection,
517 /// supplying `accessor` with the corresponding selection information
518 /// structure. Return the value returned from the invocation of
519 /// `accessor` if this object has a defined selection, and -1 otherwise.
520 template<class ACCESSOR>
521 int accessSelection(ACCESSOR& accessor) const;
522
523 /// Return a reference to the non-modifiable "Selection1" selection of
524 /// this object if "Selection1" is the current selection. The behavior
525 /// is undefined unless "Selection1" is the selection of this object.
526 const s_baltst::Sequence6& selection1() const;
527
528 /// Return a reference to the non-modifiable "Selection2" selection of
529 /// this object if "Selection2" is the current selection. The behavior
530 /// is undefined unless "Selection2" is the selection of this object.
531 const unsigned char& selection2() const;
532
533 /// Return a reference to the non-modifiable "Selection3" selection of
534 /// this object if "Selection3" is the current selection. The behavior
535 /// is undefined unless "Selection3" is the selection of this object.
536 const s_baltst::CustomString& selection3() const;
537
538 /// Return a reference to the non-modifiable "Selection4" selection of
539 /// this object if "Selection4" is the current selection. The behavior
540 /// is undefined unless "Selection4" is the selection of this object.
541 const s_baltst::CustomInt& selection4() const;
542
543 /// Return `true` if the value of this object is a "Selection1" value,
544 /// and return `false` otherwise.
545 bool isSelection1Value() const;
546
547 /// Return `true` if the value of this object is a "Selection2" value,
548 /// and return `false` otherwise.
549 bool isSelection2Value() const;
550
551 /// Return `true` if the value of this object is a "Selection3" value,
552 /// and return `false` otherwise.
553 bool isSelection3Value() const;
554
555 /// Return `true` if the value of this object is a "Selection4" value,
556 /// and return `false` otherwise.
557 bool isSelection4Value() const;
558
559 /// Return `true` if the value of this object is undefined, and `false`
560 /// otherwise.
561 bool isUndefinedValue() const;
562
563 /// Return the symbolic name of the current selection of this object.
564 const char *selectionName() const;
565};
566
567// FREE OPERATORS
568
569/// Return `true` if the specified `lhs` and `rhs` objects have the same
570/// value, and `false` otherwise. Two `SequenceWithAnonymityChoice` objects have the same
571/// value if either the selections in both objects have the same ids and
572/// the same values, or both selections are undefined.
573inline
574bool operator==(const SequenceWithAnonymityChoice& lhs, const SequenceWithAnonymityChoice& rhs);
575
576/// Return `true` if the specified `lhs` and `rhs` objects do not have the
577/// same values, as determined by `operator==`, and `false` otherwise.
578inline
579bool operator!=(const SequenceWithAnonymityChoice& lhs, const SequenceWithAnonymityChoice& rhs);
580
581/// Format the specified `rhs` to the specified output `stream` and
582/// return a reference to the modifiable `stream`.
583inline
584bsl::ostream& operator<<(bsl::ostream& stream, const SequenceWithAnonymityChoice& rhs);
585
586} // close package namespace
587
588// TRAITS
589
591
592namespace s_baltst {
593
594 // ==================================
595 // class SequenceWithAnonymityChoice2
596 // ==================================
597
599
600 // INSTANCE DATA
601 union {
604 };
605
606 int d_selectionId;
607 bslma::Allocator *d_allocator_p;
608
609 public:
610 // TYPES
611
612 enum {
616 };
617
618 enum {
620 };
621
622 enum {
625 };
626
627 // CONSTANTS
628 static const char CLASS_NAME[];
629
631
632 // CLASS METHODS
633
634 /// Return selection information for the selection indicated by the
635 /// specified `id` if the selection exists, and 0 otherwise.
637
638 /// Return selection information for the selection indicated by the
639 /// specified `name` of the specified `nameLength` if the selection
640 /// exists, and 0 otherwise.
642 const char *name,
643 int nameLength);
644
645 // CREATORS
646
647 /// Create an object of type `SequenceWithAnonymityChoice2` having the
648 /// default value. Use the optionally specified `basicAllocator` to
649 /// supply memory. If `basicAllocator` is 0, the currently installed
650 /// default allocator is used.
651 explicit SequenceWithAnonymityChoice2(bslma::Allocator *basicAllocator = 0);
652
653 /// Create an object of type `SequenceWithAnonymityChoice2` having the
654 /// value of the specified `original` object. Use the optionally
655 /// specified `basicAllocator` to supply memory. If `basicAllocator` is
656 /// 0, the currently installed default allocator is used.
658 bslma::Allocator *basicAllocator = 0);
659
660#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
661 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
662 /// Create an object of type `SequenceWithAnonymityChoice2` having the
663 /// value of the specified `original` object. After performing this
664 /// action, the `original` object will be left in a valid, but
665 /// unspecified state.
667
668 /// Create an object of type `SequenceWithAnonymityChoice2` having the
669 /// value of the specified `original` object. After performing this
670 /// action, the `original` object will be left in a valid, but
671 /// unspecified state. Use the optionally specified `basicAllocator` to
672 /// supply memory. If `basicAllocator` is 0, the currently installed
673 /// default allocator is used.
675 bslma::Allocator *basicAllocator);
676#endif
677
678 /// Destroy this object.
680
681 // MANIPULATORS
682
683 /// Assign to this object the value of the specified `rhs` object.
685
686#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
687 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
688 /// Assign to this object the value of the specified `rhs` object.
689 /// After performing this action, the `rhs` object will be left in a
690 /// valid, but unspecified state.
692#endif
693
694 /// Reset this object to the default value (i.e., its value upon default
695 /// construction).
696 void reset();
697
698 /// Set the value of this object to be the default for the selection
699 /// indicated by the specified `selectionId`. Return 0 on success, and
700 /// non-zero value otherwise (i.e., the selection is not found).
702
703 /// Set the value of this object to be the default for the selection
704 /// indicated by the specified `name` of the specified `nameLength`.
705 /// Return 0 on success, and non-zero value otherwise (i.e., the
706 /// selection is not found).
707 int makeSelection(const char *name, int nameLength);
708
711#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
712 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
714#endif
715 // Set the value of this object to be a "Selection7" value. Optionally
716 // specify the 'value' of the "Selection7". If 'value' is not
717 // specified, the default "Selection7" value is used.
718
721#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
722 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
724#endif
725 // Set the value of this object to be a "Selection8" value. Optionally
726 // specify the 'value' of the "Selection8". If 'value' is not
727 // specified, the default "Selection8" value is used.
728
729 /// Invoke the specified `manipulator` on the address of the modifiable
730 /// selection, supplying `manipulator` with the corresponding selection
731 /// information structure. Return the value returned from the
732 /// invocation of `manipulator` if this object has a defined selection,
733 /// and -1 otherwise.
734 template<class MANIPULATOR>
735 int manipulateSelection(MANIPULATOR& manipulator);
736
737 /// Return a reference to the modifiable "Selection7" selection of this
738 /// object if "Selection7" is the current selection. The behavior is
739 /// undefined unless "Selection7" is the selection of this object.
741
742 /// Return a reference to the modifiable "Selection8" selection of this
743 /// object if "Selection8" is the current selection. The behavior is
744 /// undefined unless "Selection8" is the selection of this object.
746
747 // ACCESSORS
748
749 /// Format this object to the specified output `stream` at the
750 /// optionally specified indentation `level` and return a reference to
751 /// the modifiable `stream`. If `level` is specified, optionally
752 /// specify `spacesPerLevel`, the number of spaces per indentation level
753 /// for this and all of its nested objects. Each line is indented by
754 /// the absolute value of `level * spacesPerLevel`. If `level` is
755 /// negative, suppress indentation of the first line. If
756 /// `spacesPerLevel` is negative, suppress line breaks and format the
757 /// entire output on one line. If `stream` is initially invalid, this
758 /// operation has no effect. Note that a trailing newline is provided
759 /// in multiline mode only.
760 bsl::ostream& print(bsl::ostream& stream,
761 int level = 0,
762 int spacesPerLevel = 4) const;
763
764 /// Return the id of the current selection if the selection is defined,
765 /// and -1 otherwise.
766 int selectionId() const;
767
768 /// Invoke the specified `accessor` on the non-modifiable selection,
769 /// supplying `accessor` with the corresponding selection information
770 /// structure. Return the value returned from the invocation of
771 /// `accessor` if this object has a defined selection, and -1 otherwise.
772 template<class ACCESSOR>
773 int accessSelection(ACCESSOR& accessor) const;
774
775 /// Return a reference to the non-modifiable "Selection7" selection of
776 /// this object if "Selection7" is the current selection. The behavior
777 /// is undefined unless "Selection7" is the selection of this object.
778 const s_baltst::Sequence4& selection7() const;
779
780 /// Return a reference to the non-modifiable "Selection8" selection of
781 /// this object if "Selection8" is the current selection. The behavior
782 /// is undefined unless "Selection8" is the selection of this object.
783 const s_baltst::Choice2& selection8() const;
784
785 /// Return `true` if the value of this object is a "Selection7" value,
786 /// and return `false` otherwise.
787 bool isSelection7Value() const;
788
789 /// Return `true` if the value of this object is a "Selection8" value,
790 /// and return `false` otherwise.
791 bool isSelection8Value() const;
792
793 /// Return `true` if the value of this object is undefined, and `false`
794 /// otherwise.
795 bool isUndefinedValue() const;
796
797 /// Return the symbolic name of the current selection of this object.
798 const char *selectionName() const;
799};
800
801// FREE OPERATORS
802
803/// Return `true` if the specified `lhs` and `rhs` objects have the same
804/// value, and `false` otherwise. Two `SequenceWithAnonymityChoice2` objects have the same
805/// value if either the selections in both objects have the same ids and
806/// the same values, or both selections are undefined.
807inline
808bool operator==(const SequenceWithAnonymityChoice2& lhs, const SequenceWithAnonymityChoice2& rhs);
809
810/// Return `true` if the specified `lhs` and `rhs` objects do not have the
811/// same values, as determined by `operator==`, and `false` otherwise.
812inline
813bool operator!=(const SequenceWithAnonymityChoice2& lhs, const SequenceWithAnonymityChoice2& rhs);
814
815/// Format the specified `rhs` to the specified output `stream` and
816/// return a reference to the modifiable `stream`.
817inline
818bsl::ostream& operator<<(bsl::ostream& stream, const SequenceWithAnonymityChoice2& rhs);
819
820} // close package namespace
821
822// TRAITS
823
825
826namespace s_baltst {
827
828 // ===========================
829 // class SequenceWithAnonymity
830 // ===========================
831
833
834 // INSTANCE DATA
835 s_baltst::Sequence6 d_element4;
839
840 public:
841 // TYPES
842 enum {
847 };
848
849 enum {
851 };
852
853 enum {
858 };
859
860 // CONSTANTS
861 static const char CLASS_NAME[];
862
864
865 public:
866 // CLASS METHODS
867
868 /// Return attribute information for the attribute indicated by the
869 /// specified `id` if the attribute exists, and 0 otherwise.
871
872 /// Return attribute information for the attribute indicated by the
873 /// specified `name` of the specified `nameLength` if the attribute
874 /// exists, and 0 otherwise.
876 const char *name,
877 int nameLength);
878
879 // CREATORS
880
881 /// Create an object of type `SequenceWithAnonymity` having the default
882 /// value. Use the optionally specified `basicAllocator` to supply
883 /// memory. If `basicAllocator` is 0, the currently installed default
884 /// allocator is used.
885 explicit SequenceWithAnonymity(bslma::Allocator *basicAllocator = 0);
886
887 /// Create an object of type `SequenceWithAnonymity` having the value of
888 /// the specified `original` object. Use the optionally specified
889 /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the
890 /// currently installed default allocator is used.
892 bslma::Allocator *basicAllocator = 0);
893
894#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
895 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
896 /// Create an object of type `SequenceWithAnonymity` having the value of
897 /// the specified `original` object. After performing this action, the
898 /// `original` object will be left in a valid, but unspecified state.
899 SequenceWithAnonymity(SequenceWithAnonymity&& original) noexcept;
900
901 /// Create an object of type `SequenceWithAnonymity` having the value of
902 /// the specified `original` object. After performing this action, the
903 /// `original` object will be left in a valid, but unspecified state.
904 /// Use the optionally specified `basicAllocator` to supply memory. If
905 /// `basicAllocator` is 0, the currently installed default allocator is
906 /// used.
908 bslma::Allocator *basicAllocator);
909#endif
910
911 /// Destroy this object.
913
914 // MANIPULATORS
915
916 /// Assign to this object the value of the specified `rhs` object.
918
919#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
920 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
921 /// Assign to this object the value of the specified `rhs` object.
922 /// After performing this action, the `rhs` object will be left in a
923 /// valid, but unspecified state.
925#endif
926
927 /// Reset this object to the default value (i.e., its value upon
928 /// default construction).
929 void reset();
930
931 /// Invoke the specified `manipulator` sequentially on the address of
932 /// each (modifiable) attribute of this object, supplying `manipulator`
933 /// with the corresponding attribute information structure until such
934 /// invocation returns a non-zero value. Return the value from the
935 /// last invocation of `manipulator` (i.e., the invocation that
936 /// terminated the sequence).
937 template<class MANIPULATOR>
938 int manipulateAttributes(MANIPULATOR& manipulator);
939
940 /// Invoke the specified `manipulator` on the address of
941 /// the (modifiable) attribute indicated by the specified `id`,
942 /// supplying `manipulator` with the corresponding attribute
943 /// information structure. Return the value returned from the
944 /// invocation of `manipulator` if `id` identifies an attribute of this
945 /// class, and -1 otherwise.
946 template<class MANIPULATOR>
947 int manipulateAttribute(MANIPULATOR& manipulator, int id);
948
949 /// Invoke the specified `manipulator` on the address of
950 /// the (modifiable) attribute indicated by the specified `name` of the
951 /// specified `nameLength`, supplying `manipulator` with the
952 /// corresponding attribute information structure. Return the value
953 /// returned from the invocation of `manipulator` if `name` identifies
954 /// an attribute of this class, and -1 otherwise.
955 template<class MANIPULATOR>
956 int manipulateAttribute(MANIPULATOR& manipulator,
957 const char *name,
958 int nameLength);
959
960 /// Return a reference to the modifiable "Choice" attribute of this
961 /// object.
963
964 /// Return a reference to the modifiable "Choice1" attribute of this
965 /// object.
967
968 /// Return a reference to the modifiable "Choice2" attribute of this
969 /// object.
971
972 /// Return a reference to the modifiable "Element4" attribute of this
973 /// object.
975
976 // ACCESSORS
977
978 /// Format this object to the specified output `stream` at the
979 /// optionally specified indentation `level` and return a reference to
980 /// the modifiable `stream`. If `level` is specified, optionally
981 /// specify `spacesPerLevel`, the number of spaces per indentation level
982 /// for this and all of its nested objects. Each line is indented by
983 /// the absolute value of `level * spacesPerLevel`. If `level` is
984 /// negative, suppress indentation of the first line. If
985 /// `spacesPerLevel` is negative, suppress line breaks and format the
986 /// entire output on one line. If `stream` is initially invalid, this
987 /// operation has no effect. Note that a trailing newline is provided
988 /// in multiline mode only.
989 bsl::ostream& print(bsl::ostream& stream,
990 int level = 0,
991 int spacesPerLevel = 4) const;
992
993 /// Invoke the specified `accessor` sequentially on each
994 /// (non-modifiable) attribute of this object, supplying `accessor`
995 /// with the corresponding attribute information structure until such
996 /// invocation returns a non-zero value. Return the value from the
997 /// last invocation of `accessor` (i.e., the invocation that terminated
998 /// the sequence).
999 template<class ACCESSOR>
1000 int accessAttributes(ACCESSOR& accessor) const;
1001
1002 /// Invoke the specified `accessor` on the (non-modifiable) attribute
1003 /// of this object indicated by the specified `id`, supplying `accessor`
1004 /// with the corresponding attribute information structure. Return the
1005 /// value returned from the invocation of `accessor` if `id` identifies
1006 /// an attribute of this class, and -1 otherwise.
1007 template<class ACCESSOR>
1008 int accessAttribute(ACCESSOR& accessor, int id) const;
1009
1010 /// Invoke the specified `accessor` on the (non-modifiable) attribute
1011 /// of this object indicated by the specified `name` of the specified
1012 /// `nameLength`, supplying `accessor` with the corresponding attribute
1013 /// information structure. Return the value returned from the
1014 /// invocation of `accessor` if `name` identifies an attribute of this
1015 /// class, and -1 otherwise.
1016 template<class ACCESSOR>
1017 int accessAttribute(ACCESSOR& accessor,
1018 const char *name,
1019 int nameLength) const;
1020
1021 /// Return a reference offering non-modifiable access to the "Choice"
1022 /// attribute of this object.
1023 const SequenceWithAnonymityChoice& choice() const;
1024
1025 /// Return a reference offering non-modifiable access to the "Choice1"
1026 /// attribute of this object.
1028
1029 /// Return a reference offering non-modifiable access to the "Choice2"
1030 /// attribute of this object.
1032
1033 /// Return a reference offering non-modifiable access to the "Element4"
1034 /// attribute of this object.
1035 const s_baltst::Sequence6& element4() const;
1036};
1037
1038// FREE OPERATORS
1039
1040/// Return `true` if the specified `lhs` and `rhs` attribute objects have
1041/// the same value, and `false` otherwise. Two attribute objects have the
1042/// same value if each respective attribute has the same value.
1043inline
1044bool operator==(const SequenceWithAnonymity& lhs, const SequenceWithAnonymity& rhs);
1045
1046/// Return `true` if the specified `lhs` and `rhs` attribute objects do not
1047/// have the same value, and `false` otherwise. Two attribute objects do
1048/// not have the same value if one or more respective attributes differ in
1049/// values.
1050inline
1051bool operator!=(const SequenceWithAnonymity& lhs, const SequenceWithAnonymity& rhs);
1052
1053/// Format the specified `rhs` to the specified output `stream` and
1054/// return a reference to the modifiable `stream`.
1055inline
1056bsl::ostream& operator<<(bsl::ostream& stream, const SequenceWithAnonymity& rhs);
1057
1058} // close package namespace
1059
1060// TRAITS
1061
1063
1064// ============================================================================
1065// INLINE FUNCTION DEFINITIONS
1066// ============================================================================
1067
1068namespace s_baltst {
1069
1070 // ----------------------------------
1071 // class SequenceWithAnonymityChoice1
1072 // ----------------------------------
1073
1074// CLASS METHODS
1075// CREATORS
1076inline
1078: d_selectionId(SELECTION_ID_UNDEFINED)
1079, d_allocator_p(bslma::Default::allocator(basicAllocator))
1080{
1081}
1082
1083inline
1088
1089// MANIPULATORS
1090template <class MANIPULATOR>
1092{
1093 switch (d_selectionId) {
1095 return manipulator(&d_selection5.object(),
1098 return manipulator(&d_selection6.object(),
1100 default:
1102 return -1;
1103 }
1104}
1105
1106inline
1112
1113inline
1119
1120// ACCESSORS
1121inline
1123{
1124 return d_selectionId;
1125}
1126
1127template <class ACCESSOR>
1129{
1130 switch (d_selectionId) {
1132 return accessor(d_selection5.object(),
1135 return accessor(d_selection6.object(),
1137 default:
1138 BSLS_ASSERT(SELECTION_ID_UNDEFINED == d_selectionId);
1139 return -1;
1140 }
1141}
1142
1143inline
1145{
1146 BSLS_ASSERT(SELECTION_ID_SELECTION5 == d_selectionId);
1147 return d_selection5.object();
1148}
1149
1150inline
1152{
1153 BSLS_ASSERT(SELECTION_ID_SELECTION6 == d_selectionId);
1154 return d_selection6.object();
1155}
1156
1157inline
1159{
1160 return SELECTION_ID_SELECTION5 == d_selectionId;
1161}
1162
1163inline
1165{
1166 return SELECTION_ID_SELECTION6 == d_selectionId;
1167}
1168
1169inline
1171{
1172 return SELECTION_ID_UNDEFINED == d_selectionId;
1173}
1174
1175
1176 // ---------------------------------
1177 // class SequenceWithAnonymityChoice
1178 // ---------------------------------
1179
1180// CLASS METHODS
1181// CREATORS
1182inline
1184: d_selectionId(SELECTION_ID_UNDEFINED)
1185, d_allocator_p(bslma::Default::allocator(basicAllocator))
1186{
1187}
1188
1189inline
1194
1195// MANIPULATORS
1196template <class MANIPULATOR>
1217
1218inline
1224
1225inline
1227{
1228 BSLS_ASSERT(SELECTION_ID_SELECTION2 == d_selectionId);
1229 return d_selection2.object();
1230}
1231
1232inline
1238
1239inline
1245
1246// ACCESSORS
1247inline
1249{
1250 return d_selectionId;
1251}
1252
1253template <class ACCESSOR>
1255{
1256 switch (d_selectionId) {
1258 return accessor(d_selection1.object(),
1261 return accessor(d_selection2.object(),
1264 return accessor(d_selection3.object(),
1267 return accessor(d_selection4.object(),
1269 default:
1270 BSLS_ASSERT(SELECTION_ID_UNDEFINED == d_selectionId);
1271 return -1;
1272 }
1273}
1274
1275inline
1281
1282inline
1284{
1285 BSLS_ASSERT(SELECTION_ID_SELECTION2 == d_selectionId);
1286 return d_selection2.object();
1287}
1288
1289inline
1295
1296inline
1302
1303inline
1305{
1306 return SELECTION_ID_SELECTION1 == d_selectionId;
1307}
1308
1309inline
1311{
1312 return SELECTION_ID_SELECTION2 == d_selectionId;
1313}
1314
1315inline
1317{
1318 return SELECTION_ID_SELECTION3 == d_selectionId;
1319}
1320
1321inline
1323{
1324 return SELECTION_ID_SELECTION4 == d_selectionId;
1325}
1326
1327inline
1329{
1330 return SELECTION_ID_UNDEFINED == d_selectionId;
1331}
1332
1333
1334 // ----------------------------------
1335 // class SequenceWithAnonymityChoice2
1336 // ----------------------------------
1337
1338// CLASS METHODS
1339// CREATORS
1340inline
1342: d_selectionId(SELECTION_ID_UNDEFINED)
1343, d_allocator_p(bslma::Default::allocator(basicAllocator))
1344{
1345}
1346
1347inline
1352
1353// MANIPULATORS
1354template <class MANIPULATOR>
1356{
1357 switch (d_selectionId) {
1359 return manipulator(d_selection7,
1362 return manipulator(d_selection8,
1364 default:
1366 return -1;
1367 }
1368}
1369
1370inline
1376
1377inline
1383
1384// ACCESSORS
1385inline
1387{
1388 return d_selectionId;
1389}
1390
1391template <class ACCESSOR>
1393{
1394 switch (d_selectionId) {
1396 return accessor(*d_selection7,
1399 return accessor(*d_selection8,
1401 default:
1402 BSLS_ASSERT(SELECTION_ID_UNDEFINED == d_selectionId);
1403 return -1;
1404 }
1405}
1406
1407inline
1413
1414inline
1420
1421inline
1423{
1424 return SELECTION_ID_SELECTION7 == d_selectionId;
1425}
1426
1427inline
1429{
1430 return SELECTION_ID_SELECTION8 == d_selectionId;
1431}
1432
1433inline
1435{
1436 return SELECTION_ID_UNDEFINED == d_selectionId;
1437}
1438
1439
1440 // ---------------------------
1441 // class SequenceWithAnonymity
1442 // ---------------------------
1443
1444// CLASS METHODS
1445// MANIPULATORS
1446template <class MANIPULATOR>
1448{
1449 int ret;
1450
1451 ret = manipulator(&d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
1452 if (ret) {
1453 return ret;
1454 }
1455
1456 ret = manipulator(&d_choice1, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE1]);
1457 if (ret) {
1458 return ret;
1459 }
1460
1461 ret = manipulator(&d_choice2, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE2]);
1462 if (ret) {
1463 return ret;
1464 }
1465
1466 ret = manipulator(&d_element4, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ELEMENT4]);
1467 if (ret) {
1468 return ret;
1469 }
1470
1471 return 0;
1472}
1473
1474template <class MANIPULATOR>
1475int SequenceWithAnonymity::manipulateAttribute(MANIPULATOR& manipulator, int id)
1476{
1477 enum { NOT_FOUND = -1 };
1478
1479 switch (id) {
1480 case ATTRIBUTE_ID_CHOICE: {
1481 return manipulator(&d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
1482 }
1483 case ATTRIBUTE_ID_CHOICE1: {
1484 return manipulator(&d_choice1, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE1]);
1485 }
1486 case ATTRIBUTE_ID_CHOICE2: {
1487 return manipulator(&d_choice2, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE2]);
1488 }
1489 case ATTRIBUTE_ID_ELEMENT4: {
1490 return manipulator(&d_element4, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ELEMENT4]);
1491 }
1492 default:
1493 return NOT_FOUND;
1494 }
1495}
1496
1497template <class MANIPULATOR>
1499 MANIPULATOR& manipulator,
1500 const char *name,
1501 int nameLength)
1502{
1503 enum { NOT_FOUND = -1 };
1504
1505 const bdlat_AttributeInfo *attributeInfo =
1506 lookupAttributeInfo(name, nameLength);
1507 if (0 == attributeInfo) {
1508 return NOT_FOUND;
1509 }
1510
1511 return manipulateAttribute(manipulator, attributeInfo->d_id);
1512}
1513
1514inline
1519
1520inline
1525
1526inline
1531
1532inline
1534{
1535 return d_element4;
1536}
1537
1538// ACCESSORS
1539template <class ACCESSOR>
1540int SequenceWithAnonymity::accessAttributes(ACCESSOR& accessor) const
1541{
1542 int ret;
1543
1544 ret = accessor(d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
1545 if (ret) {
1546 return ret;
1547 }
1548
1549 ret = accessor(d_choice1, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE1]);
1550 if (ret) {
1551 return ret;
1552 }
1553
1554 ret = accessor(d_choice2, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE2]);
1555 if (ret) {
1556 return ret;
1557 }
1558
1559 ret = accessor(d_element4, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ELEMENT4]);
1560 if (ret) {
1561 return ret;
1562 }
1563
1564 return 0;
1565}
1566
1567template <class ACCESSOR>
1568int SequenceWithAnonymity::accessAttribute(ACCESSOR& accessor, int id) const
1569{
1570 enum { NOT_FOUND = -1 };
1571
1572 switch (id) {
1573 case ATTRIBUTE_ID_CHOICE: {
1574 return accessor(d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
1575 }
1576 case ATTRIBUTE_ID_CHOICE1: {
1577 return accessor(d_choice1, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE1]);
1578 }
1579 case ATTRIBUTE_ID_CHOICE2: {
1580 return accessor(d_choice2, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE2]);
1581 }
1582 case ATTRIBUTE_ID_ELEMENT4: {
1583 return accessor(d_element4, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ELEMENT4]);
1584 }
1585 default:
1586 return NOT_FOUND;
1587 }
1588}
1589
1590template <class ACCESSOR>
1592 ACCESSOR& accessor,
1593 const char *name,
1594 int nameLength) const
1595{
1596 enum { NOT_FOUND = -1 };
1597
1598 const bdlat_AttributeInfo *attributeInfo =
1599 lookupAttributeInfo(name, nameLength);
1600 if (0 == attributeInfo) {
1601 return NOT_FOUND;
1602 }
1603
1604 return accessAttribute(accessor, attributeInfo->d_id);
1605}
1606
1607inline
1609{
1610 return d_choice;
1611}
1612
1613inline
1615{
1616 return d_choice1;
1617}
1618
1619inline
1624
1625inline
1627{
1628 return d_element4;
1629}
1630
1631} // close package namespace
1632
1633// FREE FUNCTIONS
1634
1635inline
1639{
1641 if (lhs.selectionId() == rhs.selectionId()) {
1642 switch (rhs.selectionId()) {
1643 case Class::SELECTION_ID_SELECTION5:
1644 return lhs.selection5() == rhs.selection5();
1645 case Class::SELECTION_ID_SELECTION6:
1646 return lhs.selection6() == rhs.selection6();
1647 default:
1648 BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId());
1649 return true;
1650 }
1651 }
1652 else {
1653 return false;
1654 }
1655}
1656
1657inline
1661{
1662 return !(lhs == rhs);
1663}
1664
1665inline
1666bsl::ostream& s_baltst::operator<<(
1667 bsl::ostream& stream,
1669{
1670 return rhs.print(stream, 0, -1);
1671}
1672
1673
1674inline
1678{
1680 if (lhs.selectionId() == rhs.selectionId()) {
1681 switch (rhs.selectionId()) {
1682 case Class::SELECTION_ID_SELECTION1:
1683 return lhs.selection1() == rhs.selection1();
1684 case Class::SELECTION_ID_SELECTION2:
1685 return lhs.selection2() == rhs.selection2();
1686 case Class::SELECTION_ID_SELECTION3:
1687 return lhs.selection3() == rhs.selection3();
1688 case Class::SELECTION_ID_SELECTION4:
1689 return lhs.selection4() == rhs.selection4();
1690 default:
1691 BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId());
1692 return true;
1693 }
1694 }
1695 else {
1696 return false;
1697 }
1698}
1699
1700inline
1704{
1705 return !(lhs == rhs);
1706}
1707
1708inline
1709bsl::ostream& s_baltst::operator<<(
1710 bsl::ostream& stream,
1712{
1713 return rhs.print(stream, 0, -1);
1714}
1715
1716
1717inline
1721{
1723 if (lhs.selectionId() == rhs.selectionId()) {
1724 switch (rhs.selectionId()) {
1725 case Class::SELECTION_ID_SELECTION7:
1726 return lhs.selection7() == rhs.selection7();
1727 case Class::SELECTION_ID_SELECTION8:
1728 return lhs.selection8() == rhs.selection8();
1729 default:
1730 BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId());
1731 return true;
1732 }
1733 }
1734 else {
1735 return false;
1736 }
1737}
1738
1739inline
1743{
1744 return !(lhs == rhs);
1745}
1746
1747inline
1748bsl::ostream& s_baltst::operator<<(
1749 bsl::ostream& stream,
1751{
1752 return rhs.print(stream, 0, -1);
1753}
1754
1755
1756inline
1760{
1761 return lhs.choice() == rhs.choice()
1762 && lhs.choice1() == rhs.choice1()
1763 && lhs.choice2() == rhs.choice2()
1764 && lhs.element4() == rhs.element4();
1765}
1766
1767inline
1771{
1772 return !(lhs == rhs);
1773}
1774
1775inline
1776bsl::ostream& s_baltst::operator<<(
1777 bsl::ostream& stream,
1779{
1780 return rhs.print(stream, 0, -1);
1781}
1782
1783
1784#endif
1785
1786// GENERATED BY @BLP_BAS_CODEGEN_VERSION@
1787// USING bas_codegen.pl s_baltst_sequencewithanonymity.xsd --mode msg --includedir . --msgComponent sequencewithanonymity --noRecurse --noExternalization --noHashSupport --noAggregateConversion
1788// ----------------------------------------------------------------------------
1789// NOTICE:
1790// Copyright 2022 Bloomberg Finance L.P. All rights reserved.
1791// Property of Bloomberg Finance L.P. (BFLP)
1792// This software is made available solely pursuant to the
1793// terms of a BFLP license agreement which governs its use.
1794// ------------------------------- END-OF-FILE --------------------------------
1795
1796/** @} */
1797/** @} */
1798/** @} */
Definition bdlb_nullablevalue.h:257
Definition bslstl_string.h:1281
Definition bslma_allocator.h:457
Definition s_baltst_ratsnest.h:1546
Definition s_baltst_customint.h:65
Definition s_baltst_customstring.h:71
Definition s_baltst_ratsnest.h:1825
Definition s_baltst_ratsnest.h:627
Definition s_baltst_sequencewithanonymity.h:84
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]
Definition s_baltst_sequencewithanonymity.h:116
static const char CLASS_NAME[]
Definition s_baltst_sequencewithanonymity.h:114
int manipulateSelection(MANIPULATOR &manipulator)
Definition s_baltst_sequencewithanonymity.h:1091
const char * selectionName() const
Return the symbolic name of the current selection of this object.
bsls::ObjectBuffer< bool > d_selection5
Definition s_baltst_sequencewithanonymity.h:88
bool isSelection5Value() const
Definition s_baltst_sequencewithanonymity.h:1158
int accessSelection(ACCESSOR &accessor) const
Definition s_baltst_sequencewithanonymity.h:1128
bsls::ObjectBuffer< bsl::string > d_selection6
Definition s_baltst_sequencewithanonymity.h:89
static const bdlat_SelectionInfo * lookupSelectionInfo(int id)
bool isUndefinedValue() const
Definition s_baltst_sequencewithanonymity.h:1170
SequenceWithAnonymityChoice1 & operator=(const SequenceWithAnonymityChoice1 &rhs)
Assign to this object the value of the specified rhs object.
SequenceWithAnonymityChoice1(bslma::Allocator *basicAllocator=0)
Definition s_baltst_sequencewithanonymity.h:1077
@ SELECTION_ID_SELECTION5
Definition s_baltst_sequencewithanonymity.h:100
@ SELECTION_ID_UNDEFINED
Definition s_baltst_sequencewithanonymity.h:99
@ SELECTION_ID_SELECTION6
Definition s_baltst_sequencewithanonymity.h:101
bool isSelection6Value() const
Definition s_baltst_sequencewithanonymity.h:1164
int selectionId() const
Definition s_baltst_sequencewithanonymity.h:1122
bool & selection5()
Definition s_baltst_sequencewithanonymity.h:1107
SequenceWithAnonymityChoice1(const SequenceWithAnonymityChoice1 &original, bslma::Allocator *basicAllocator=0)
~SequenceWithAnonymityChoice1()
Destroy this object.
Definition s_baltst_sequencewithanonymity.h:1084
bsl::string & makeSelection6(const bsl::string &value)
@ SELECTION_INDEX_SELECTION6
Definition s_baltst_sequencewithanonymity.h:110
@ SELECTION_INDEX_SELECTION5
Definition s_baltst_sequencewithanonymity.h:109
static const bdlat_SelectionInfo * lookupSelectionInfo(const char *name, int nameLength)
int makeSelection(const char *name, int nameLength)
bsl::string & selection6()
Definition s_baltst_sequencewithanonymity.h:1114
@ NUM_SELECTIONS
Definition s_baltst_sequencewithanonymity.h:105
Definition s_baltst_sequencewithanonymity.h:598
s_baltst::Choice2 & makeSelection8()
s_baltst::Choice2 & makeSelection8(const s_baltst::Choice2 &value)
@ NUM_SELECTIONS
Definition s_baltst_sequencewithanonymity.h:619
s_baltst::Choice2 * d_selection8
Definition s_baltst_sequencewithanonymity.h:603
s_baltst::Choice2 & selection8()
Definition s_baltst_sequencewithanonymity.h:1378
~SequenceWithAnonymityChoice2()
Destroy this object.
Definition s_baltst_sequencewithanonymity.h:1348
bool isUndefinedValue() const
Definition s_baltst_sequencewithanonymity.h:1434
@ SELECTION_ID_UNDEFINED
Definition s_baltst_sequencewithanonymity.h:613
@ SELECTION_ID_SELECTION7
Definition s_baltst_sequencewithanonymity.h:614
@ SELECTION_ID_SELECTION8
Definition s_baltst_sequencewithanonymity.h:615
int manipulateSelection(MANIPULATOR &manipulator)
Definition s_baltst_sequencewithanonymity.h:1355
SequenceWithAnonymityChoice2(bslma::Allocator *basicAllocator=0)
Definition s_baltst_sequencewithanonymity.h:1341
s_baltst::Sequence4 & makeSelection7()
s_baltst::Sequence4 & selection7()
Definition s_baltst_sequencewithanonymity.h:1371
static const bdlat_SelectionInfo * lookupSelectionInfo(const char *name, int nameLength)
@ SELECTION_INDEX_SELECTION8
Definition s_baltst_sequencewithanonymity.h:624
@ SELECTION_INDEX_SELECTION7
Definition s_baltst_sequencewithanonymity.h:623
int accessSelection(ACCESSOR &accessor) const
Definition s_baltst_sequencewithanonymity.h:1392
s_baltst::Sequence4 & makeSelection7(const s_baltst::Sequence4 &value)
static const char CLASS_NAME[]
Definition s_baltst_sequencewithanonymity.h:628
const char * selectionName() const
Return the symbolic name of the current selection of this object.
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
bool isSelection8Value() const
Definition s_baltst_sequencewithanonymity.h:1428
static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]
Definition s_baltst_sequencewithanonymity.h:630
bool isSelection7Value() const
Definition s_baltst_sequencewithanonymity.h:1422
static const bdlat_SelectionInfo * lookupSelectionInfo(int id)
SequenceWithAnonymityChoice2(const SequenceWithAnonymityChoice2 &original, bslma::Allocator *basicAllocator=0)
int selectionId() const
Definition s_baltst_sequencewithanonymity.h:1386
s_baltst::Sequence4 * d_selection7
Definition s_baltst_sequencewithanonymity.h:602
int makeSelection(const char *name, int nameLength)
SequenceWithAnonymityChoice2 & operator=(const SequenceWithAnonymityChoice2 &rhs)
Assign to this object the value of the specified rhs object.
Definition s_baltst_sequencewithanonymity.h:314
bsls::ObjectBuffer< s_baltst::CustomInt > d_selection4
Definition s_baltst_sequencewithanonymity.h:321
bsls::ObjectBuffer< s_baltst::Sequence6 > d_selection1
Definition s_baltst_sequencewithanonymity.h:318
s_baltst::CustomInt & makeSelection4()
unsigned char & makeSelection2(unsigned char value)
bsls::ObjectBuffer< s_baltst::CustomString > d_selection3
Definition s_baltst_sequencewithanonymity.h:320
bool isSelection1Value() const
Definition s_baltst_sequencewithanonymity.h:1304
s_baltst::Sequence6 & selection1()
Definition s_baltst_sequencewithanonymity.h:1219
~SequenceWithAnonymityChoice()
Destroy this object.
Definition s_baltst_sequencewithanonymity.h:1190
unsigned char & selection2()
Definition s_baltst_sequencewithanonymity.h:1226
bool isSelection3Value() const
Definition s_baltst_sequencewithanonymity.h:1316
s_baltst::CustomString & makeSelection3()
SequenceWithAnonymityChoice(bslma::Allocator *basicAllocator=0)
Definition s_baltst_sequencewithanonymity.h:1183
int selectionId() const
Definition s_baltst_sequencewithanonymity.h:1248
s_baltst::CustomString & makeSelection3(const s_baltst::CustomString &value)
@ SELECTION_ID_SELECTION2
Definition s_baltst_sequencewithanonymity.h:333
@ SELECTION_ID_SELECTION1
Definition s_baltst_sequencewithanonymity.h:332
@ SELECTION_ID_SELECTION4
Definition s_baltst_sequencewithanonymity.h:335
@ SELECTION_ID_SELECTION3
Definition s_baltst_sequencewithanonymity.h:334
@ SELECTION_ID_UNDEFINED
Definition s_baltst_sequencewithanonymity.h:331
@ SELECTION_INDEX_SELECTION3
Definition s_baltst_sequencewithanonymity.h:345
@ SELECTION_INDEX_SELECTION2
Definition s_baltst_sequencewithanonymity.h:344
@ SELECTION_INDEX_SELECTION4
Definition s_baltst_sequencewithanonymity.h:346
@ SELECTION_INDEX_SELECTION1
Definition s_baltst_sequencewithanonymity.h:343
static const bdlat_SelectionInfo * lookupSelectionInfo(int id)
int manipulateSelection(MANIPULATOR &manipulator)
Definition s_baltst_sequencewithanonymity.h:1197
s_baltst::CustomString & selection3()
Definition s_baltst_sequencewithanonymity.h:1233
SequenceWithAnonymityChoice & operator=(const SequenceWithAnonymityChoice &rhs)
Assign to this object the value of the specified rhs object.
@ NUM_SELECTIONS
Definition s_baltst_sequencewithanonymity.h:339
static const char CLASS_NAME[]
Definition s_baltst_sequencewithanonymity.h:350
static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]
Definition s_baltst_sequencewithanonymity.h:352
bsls::ObjectBuffer< unsigned char > d_selection2
Definition s_baltst_sequencewithanonymity.h:319
bool isSelection4Value() const
Definition s_baltst_sequencewithanonymity.h:1322
SequenceWithAnonymityChoice(const SequenceWithAnonymityChoice &original, bslma::Allocator *basicAllocator=0)
static const bdlat_SelectionInfo * lookupSelectionInfo(const char *name, int nameLength)
s_baltst::CustomInt & makeSelection4(const s_baltst::CustomInt &value)
bool isSelection2Value() const
Definition s_baltst_sequencewithanonymity.h:1310
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
const char * selectionName() const
Return the symbolic name of the current selection of this object.
s_baltst::Sequence6 & makeSelection1()
int makeSelection(const char *name, int nameLength)
s_baltst::CustomInt & selection4()
Definition s_baltst_sequencewithanonymity.h:1240
bool isUndefinedValue() const
Definition s_baltst_sequencewithanonymity.h:1328
int accessSelection(ACCESSOR &accessor) const
Definition s_baltst_sequencewithanonymity.h:1254
s_baltst::Sequence6 & makeSelection1(const s_baltst::Sequence6 &value)
Definition s_baltst_sequencewithanonymity.h:832
@ ATTRIBUTE_ID_CHOICE2
Definition s_baltst_sequencewithanonymity.h:845
@ ATTRIBUTE_ID_ELEMENT4
Definition s_baltst_sequencewithanonymity.h:846
@ ATTRIBUTE_ID_CHOICE1
Definition s_baltst_sequencewithanonymity.h:844
@ ATTRIBUTE_ID_CHOICE
Definition s_baltst_sequencewithanonymity.h:843
~SequenceWithAnonymity()
Destroy this object.
static const bdlat_AttributeInfo * lookupAttributeInfo(const char *name, int nameLength)
static const char CLASS_NAME[]
Definition s_baltst_sequencewithanonymity.h:861
@ ATTRIBUTE_INDEX_CHOICE2
Definition s_baltst_sequencewithanonymity.h:856
@ ATTRIBUTE_INDEX_CHOICE
Definition s_baltst_sequencewithanonymity.h:854
@ ATTRIBUTE_INDEX_CHOICE1
Definition s_baltst_sequencewithanonymity.h:855
@ ATTRIBUTE_INDEX_ELEMENT4
Definition s_baltst_sequencewithanonymity.h:857
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
int accessAttributes(ACCESSOR &accessor) const
Definition s_baltst_sequencewithanonymity.h:1540
SequenceWithAnonymityChoice & choice()
Definition s_baltst_sequencewithanonymity.h:1515
SequenceWithAnonymity(bslma::Allocator *basicAllocator=0)
SequenceWithAnonymity & operator=(const SequenceWithAnonymity &rhs)
Assign to this object the value of the specified rhs object.
SequenceWithAnonymity(const SequenceWithAnonymity &original, bslma::Allocator *basicAllocator=0)
int accessAttribute(ACCESSOR &accessor, int id) const
Definition s_baltst_sequencewithanonymity.h:1568
@ NUM_ATTRIBUTES
Definition s_baltst_sequencewithanonymity.h:850
static const bdlat_AttributeInfo ATTRIBUTE_INFO_ARRAY[]
Definition s_baltst_sequencewithanonymity.h:863
s_baltst::Sequence6 & element4()
Definition s_baltst_sequencewithanonymity.h:1533
static const bdlat_AttributeInfo * lookupAttributeInfo(int id)
SequenceWithAnonymityChoice1 & choice1()
Definition s_baltst_sequencewithanonymity.h:1521
int manipulateAttributes(MANIPULATOR &manipulator)
Definition s_baltst_sequencewithanonymity.h:1447
bdlb::NullableValue< SequenceWithAnonymityChoice2 > & choice2()
Definition s_baltst_sequencewithanonymity.h:1527
int manipulateAttribute(MANIPULATOR &manipulator, int id)
Definition s_baltst_sequencewithanonymity.h:1475
#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