BDE 4.39.x 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 // PRIVATE ACCESSORS
96 bool isEqualTo(const SequenceWithAnonymityChoice1& rhs) const;
97
98 public:
99 // TYPES
100
101 enum {
105 };
106
107 enum {
109 };
110
111 enum {
114 };
115
116 // CONSTANTS
117 static const char CLASS_NAME[];
118
120
121 // CLASS METHODS
122
123 /// Return selection information for the selection indicated by the
124 /// specified `id` if the selection exists, and 0 otherwise.
126
127 /// Return selection information for the selection indicated by the
128 /// specified `name` of the specified `nameLength` if the selection
129 /// exists, and 0 otherwise.
131 const char *name,
132 int nameLength);
133
134 // CREATORS
135
136 /// Create an object of type `SequenceWithAnonymityChoice1` having the
137 /// default value. Use the optionally specified `basicAllocator` to
138 /// supply memory. If `basicAllocator` is 0, the currently installed
139 /// default allocator is used.
140 explicit SequenceWithAnonymityChoice1(bslma::Allocator *basicAllocator = 0);
141
142 /// Create an object of type `SequenceWithAnonymityChoice1` having the
143 /// value of the specified `original` object. Use the optionally
144 /// specified `basicAllocator` to supply memory. If `basicAllocator` is
145 /// 0, the currently installed default allocator is used.
147 bslma::Allocator *basicAllocator = 0);
148
149#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
150 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
151 /// Create an object of type `SequenceWithAnonymityChoice1` having the
152 /// value of the specified `original` object. After performing this
153 /// action, the `original` object will be left in a valid, but
154 /// unspecified state.
156
157 /// Create an object of type `SequenceWithAnonymityChoice1` having the
158 /// value of the specified `original` object. After performing this
159 /// action, the `original` object will be left in a valid, but
160 /// unspecified state. Use the optionally specified `basicAllocator` to
161 /// supply memory. If `basicAllocator` is 0, the currently installed
162 /// default allocator is used.
164 bslma::Allocator *basicAllocator);
165#endif
166
167 /// Destroy this object.
169
170 // MANIPULATORS
171
172 /// Assign to this object the value of the specified `rhs` object.
174
175#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
176 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
177 /// Assign to this object the value of the specified `rhs` object.
178 /// After performing this action, the `rhs` object will be left in a
179 /// valid, but unspecified state.
181#endif
182
183 /// Reset this object to the default value (i.e., its value upon default
184 /// construction).
185 void reset();
186
187 /// Set the value of this object to be the default for the selection
188 /// indicated by the specified `selectionId`. Return 0 on success, and
189 /// non-zero value otherwise (i.e., the selection is not found).
191
192 /// Set the value of this object to be the default for the selection
193 /// indicated by the specified `name` of the specified `nameLength`.
194 /// Return 0 on success, and non-zero value otherwise (i.e., the
195 /// selection is not found).
196 int makeSelection(const char *name, int nameLength);
197
198 /// Set the value of this object to be a "Selection5" value. Optionally
199 /// specify the `value` of the "Selection5". If `value` is not
200 /// specified, the default "Selection5" value is used.
202 bool& makeSelection5(bool value);
203
206#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
207 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
209#endif
210 // Set the value of this object to be a "Selection6" value. Optionally
211 // specify the 'value' of the "Selection6". If 'value' is not
212 // specified, the default "Selection6" value is used.
213
214 /// Invoke the specified `manipulator` on the address of the modifiable
215 /// selection, supplying `manipulator` with the corresponding selection
216 /// information structure. Return the value returned from the
217 /// invocation of `manipulator` if this object has a defined selection,
218 /// and -1 otherwise.
219 template <typename t_MANIPULATOR>
220 int manipulateSelection(t_MANIPULATOR& manipulator);
221
222 /// Return a reference to the modifiable "Selection5" selection of this
223 /// object if "Selection5" is the current selection.
224 ///
225 /// \pre The behavior is undefined unless "Selection5" is the selection of this object.
226 bool& selection5();
227
228 /// Return a reference to the modifiable "Selection6" selection of this
229 /// object if "Selection6" is the current selection.
230 ///
231 /// \pre The behavior is undefined unless "Selection6" is the selection of this object.
233
234 // ACCESSORS
235
236 /// Format this object to the specified output `stream` at the
237 /// optionally specified indentation `level` and return a reference to
238 /// the modifiable `stream`. If `level` is specified, optionally
239 /// specify `spacesPerLevel`, the number of spaces per indentation level
240 /// for this and all of its nested objects. Each line is indented by
241 /// the absolute value of `level * spacesPerLevel`. If `level` is
242 /// negative, suppress indentation of the first line. If
243 /// `spacesPerLevel` is negative, suppress line breaks and format the
244 /// entire output on one line. If `stream` is initially invalid, this operation has no effect.
245 ///
246 /// \note Note that a trailing newline is provided
247 /// in multiline mode only.
248 bsl::ostream& print(bsl::ostream& stream,
249 int level = 0,
250 int spacesPerLevel = 4) const;
251
252 /// Return the id of the current selection if the selection is defined,
253 /// and -1 otherwise.
254 int selectionId() const;
255
256 /// Invoke the specified `accessor` on the non-modifiable selection,
257 /// supplying `accessor` with the corresponding selection information
258 /// structure. Return the value returned from the invocation of
259 /// `accessor` if this object has a defined selection, and -1 otherwise.
260 template <typename t_ACCESSOR>
261 int accessSelection(t_ACCESSOR& accessor) const;
262
263 /// Return a reference to the non-modifiable "Selection5" selection of
264 /// this object if "Selection5" is the current selection.
265 ///
266 /// \pre The behavior is undefined unless "Selection5" is the selection of this object.
267 const bool& selection5() const;
268
269 /// Return a reference to the non-modifiable "Selection6" selection of
270 /// this object if "Selection6" is the current selection.
271 ///
272 /// \pre The behavior is undefined unless "Selection6" is the selection of this object.
273 const bsl::string& selection6() const;
274
275 /// Return `true` if the value of this object is a "Selection5" value,
276 /// and return `false` otherwise.
277 bool isSelection5Value() const;
278
279 /// Return `true` if the value of this object is a "Selection6" value,
280 /// and return `false` otherwise.
281 bool isSelection6Value() const;
282
283 /// Return `true` if the value of this object is undefined, and `false`
284 /// otherwise.
285 bool isUndefinedValue() const;
286
287 /// Return the symbolic name of the current selection of this object.
288 const char *selectionName() const;
289
290 // HIDDEN FRIENDS
291
292 /// Return `true` if the specified `lhs` and `rhs` objects have the same
293 /// value, and `false` otherwise. Two `SequenceWithAnonymityChoice1`
294 /// objects have the same value if either the selections in both objects
295 /// have the same ids and the same values, or both selections are
296 /// undefined.
299 {
300 return lhs.isEqualTo(rhs);
301 }
302
303 /// Return `true` if the specified `lhs` and `rhs` objects do not have
304 /// the same values, as determined by `operator==`, and `false`
305 /// otherwise.
308 {
309 return !(lhs == rhs);
310 }
311
312 /// Format the specified `rhs` to the specified output `stream` and
313 /// return a reference to the modifiable `stream`.
314 friend bsl::ostream& operator<<(bsl::ostream& stream,
316 {
317 return rhs.print(stream, 0, -1);
318 }
319};
320
321} // close package namespace
322
323// TRAITS
324
326
327namespace s_baltst {
328
329 // =================================
330 // class SequenceWithAnonymityChoice
331 // =================================
332
334
335 // INSTANCE DATA
336 union {
341 };
342
343 int d_selectionId;
344 bslma::Allocator *d_allocator_p;
345
346 // PRIVATE ACCESSORS
347 bool isEqualTo(const SequenceWithAnonymityChoice& rhs) const;
348
349 public:
350 // TYPES
351
352 enum {
358 };
359
360 enum {
362 };
363
364 enum {
369 };
370
371 // CONSTANTS
372 static const char CLASS_NAME[];
373
375
376 // CLASS METHODS
377
378 /// Return selection information for the selection indicated by the
379 /// specified `id` if the selection exists, and 0 otherwise.
381
382 /// Return selection information for the selection indicated by the
383 /// specified `name` of the specified `nameLength` if the selection
384 /// exists, and 0 otherwise.
386 const char *name,
387 int nameLength);
388
389 // CREATORS
390
391 /// Create an object of type `SequenceWithAnonymityChoice` having the
392 /// default value. Use the optionally specified `basicAllocator` to
393 /// supply memory. If `basicAllocator` is 0, the currently installed
394 /// default allocator is used.
395 explicit SequenceWithAnonymityChoice(bslma::Allocator *basicAllocator = 0);
396
397 /// Create an object of type `SequenceWithAnonymityChoice` having the
398 /// value of the specified `original` object. Use the optionally
399 /// specified `basicAllocator` to supply memory. If `basicAllocator` is
400 /// 0, the currently installed default allocator is used.
402 bslma::Allocator *basicAllocator = 0);
403
404#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
405 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
406 /// Create an object of type `SequenceWithAnonymityChoice` having the
407 /// value of the specified `original` object. After performing this
408 /// action, the `original` object will be left in a valid, but
409 /// unspecified state.
411
412 /// Create an object of type `SequenceWithAnonymityChoice` having the
413 /// value of the specified `original` object. After performing this
414 /// action, the `original` object will be left in a valid, but
415 /// unspecified state. Use the optionally specified `basicAllocator` to
416 /// supply memory. If `basicAllocator` is 0, the currently installed
417 /// default allocator is used.
419 bslma::Allocator *basicAllocator);
420#endif
421
422 /// Destroy this object.
424
425 // MANIPULATORS
426
427 /// Assign to this object the value of the specified `rhs` object.
429
430#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
431 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
432 /// Assign to this object the value of the specified `rhs` object.
433 /// After performing this action, the `rhs` object will be left in a
434 /// valid, but unspecified state.
436#endif
437
438 /// Reset this object to the default value (i.e., its value upon default
439 /// construction).
440 void reset();
441
442 /// Set the value of this object to be the default for the selection
443 /// indicated by the specified `selectionId`. Return 0 on success, and
444 /// non-zero value otherwise (i.e., the selection is not found).
446
447 /// Set the value of this object to be the default for the selection
448 /// indicated by the specified `name` of the specified `nameLength`.
449 /// Return 0 on success, and non-zero value otherwise (i.e., the
450 /// selection is not found).
451 int makeSelection(const char *name, int nameLength);
452
455#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
456 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
458#endif
459 // Set the value of this object to be a "Selection1" value. Optionally
460 // specify the 'value' of the "Selection1". If 'value' is not
461 // specified, the default "Selection1" value is used.
462
463 /// Set the value of this object to be a "Selection2" value. Optionally
464 /// specify the `value` of the "Selection2". If `value` is not
465 /// specified, the default "Selection2" value is used.
466 unsigned char& makeSelection2();
467 unsigned char& makeSelection2(unsigned char value);
468
471#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
472 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
474#endif
475 // Set the value of this object to be a "Selection3" value. Optionally
476 // specify the 'value' of the "Selection3". If 'value' is not
477 // specified, the default "Selection3" value is used.
478
481#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
482 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
484#endif
485 // Set the value of this object to be a "Selection4" value. Optionally
486 // specify the 'value' of the "Selection4". If 'value' is not
487 // specified, the default "Selection4" value is used.
488
489 /// Invoke the specified `manipulator` on the address of the modifiable
490 /// selection, supplying `manipulator` with the corresponding selection
491 /// information structure. Return the value returned from the
492 /// invocation of `manipulator` if this object has a defined selection,
493 /// and -1 otherwise.
494 template <typename t_MANIPULATOR>
495 int manipulateSelection(t_MANIPULATOR& manipulator);
496
497 /// Return a reference to the modifiable "Selection1" selection of this
498 /// object if "Selection1" is the current selection.
499 ///
500 /// \pre The behavior is undefined unless "Selection1" is the selection of this object.
502
503 /// Return a reference to the modifiable "Selection2" selection of this
504 /// object if "Selection2" is the current selection.
505 ///
506 /// \pre The behavior is undefined unless "Selection2" is the selection of this object.
507 unsigned char& selection2();
508
509 /// Return a reference to the modifiable "Selection3" selection of this
510 /// object if "Selection3" is the current selection.
511 ///
512 /// \pre The behavior is undefined unless "Selection3" is the selection of this object.
514
515 /// Return a reference to the modifiable "Selection4" selection of this
516 /// object if "Selection4" is the current selection.
517 ///
518 /// \pre The behavior is undefined unless "Selection4" is the selection of this object.
520
521 // ACCESSORS
522
523 /// Format this object to the specified output `stream` at the
524 /// optionally specified indentation `level` and return a reference to
525 /// the modifiable `stream`. If `level` is specified, optionally
526 /// specify `spacesPerLevel`, the number of spaces per indentation level
527 /// for this and all of its nested objects. Each line is indented by
528 /// the absolute value of `level * spacesPerLevel`. If `level` is
529 /// negative, suppress indentation of the first line. If
530 /// `spacesPerLevel` is negative, suppress line breaks and format the
531 /// entire output on one line. If `stream` is initially invalid, this operation has no effect.
532 ///
533 /// \note Note that a trailing newline is provided
534 /// in multiline mode only.
535 bsl::ostream& print(bsl::ostream& stream,
536 int level = 0,
537 int spacesPerLevel = 4) const;
538
539 /// Return the id of the current selection if the selection is defined,
540 /// and -1 otherwise.
541 int selectionId() const;
542
543 /// Invoke the specified `accessor` on the non-modifiable selection,
544 /// supplying `accessor` with the corresponding selection information
545 /// structure. Return the value returned from the invocation of
546 /// `accessor` if this object has a defined selection, and -1 otherwise.
547 template <typename t_ACCESSOR>
548 int accessSelection(t_ACCESSOR& accessor) const;
549
550 /// Return a reference to the non-modifiable "Selection1" selection of
551 /// this object if "Selection1" is the current selection.
552 ///
553 /// \pre The behavior is undefined unless "Selection1" is the selection of this object.
554 const s_baltst::Sequence6& selection1() const;
555
556 /// Return a reference to the non-modifiable "Selection2" selection of
557 /// this object if "Selection2" is the current selection.
558 ///
559 /// \pre The behavior is undefined unless "Selection2" is the selection of this object.
560 const unsigned char& selection2() const;
561
562 /// Return a reference to the non-modifiable "Selection3" selection of
563 /// this object if "Selection3" is the current selection.
564 ///
565 /// \pre The behavior is undefined unless "Selection3" is the selection of this object.
566 const s_baltst::CustomString& selection3() const;
567
568 /// Return a reference to the non-modifiable "Selection4" selection of
569 /// this object if "Selection4" is the current selection.
570 ///
571 /// \pre The behavior is undefined unless "Selection4" is the selection of this object.
572 const s_baltst::CustomInt& selection4() const;
573
574 /// Return `true` if the value of this object is a "Selection1" value,
575 /// and return `false` otherwise.
576 bool isSelection1Value() const;
577
578 /// Return `true` if the value of this object is a "Selection2" value,
579 /// and return `false` otherwise.
580 bool isSelection2Value() const;
581
582 /// Return `true` if the value of this object is a "Selection3" value,
583 /// and return `false` otherwise.
584 bool isSelection3Value() const;
585
586 /// Return `true` if the value of this object is a "Selection4" value,
587 /// and return `false` otherwise.
588 bool isSelection4Value() const;
589
590 /// Return `true` if the value of this object is undefined, and `false`
591 /// otherwise.
592 bool isUndefinedValue() const;
593
594 /// Return the symbolic name of the current selection of this object.
595 const char *selectionName() const;
596
597 // HIDDEN FRIENDS
598
599 /// Return `true` if the specified `lhs` and `rhs` objects have the same
600 /// value, and `false` otherwise. Two `SequenceWithAnonymityChoice`
601 /// objects have the same value if either the selections in both objects
602 /// have the same ids and the same values, or both selections are
603 /// undefined.
606 {
607 return lhs.isEqualTo(rhs);
608 }
609
610 /// Return `true` if the specified `lhs` and `rhs` objects do not have
611 /// the same values, as determined by `operator==`, and `false`
612 /// otherwise.
615 {
616 return !(lhs == rhs);
617 }
618
619 /// Format the specified `rhs` to the specified output `stream` and
620 /// return a reference to the modifiable `stream`.
621 friend bsl::ostream& operator<<(bsl::ostream& stream,
623 {
624 return rhs.print(stream, 0, -1);
625 }
626};
627
628} // close package namespace
629
630// TRAITS
631
633
634namespace s_baltst {
635
636 // ==================================
637 // class SequenceWithAnonymityChoice2
638 // ==================================
639
641
642 // INSTANCE DATA
643 union {
646 };
647
648 int d_selectionId;
649 bslma::Allocator *d_allocator_p;
650
651 // PRIVATE ACCESSORS
652 bool isEqualTo(const SequenceWithAnonymityChoice2& rhs) const;
653
654 public:
655 // TYPES
656
657 enum {
661 };
662
663 enum {
665 };
666
667 enum {
670 };
671
672 // CONSTANTS
673 static const char CLASS_NAME[];
674
676
677 // CLASS METHODS
678
679 /// Return selection information for the selection indicated by the
680 /// specified `id` if the selection exists, and 0 otherwise.
682
683 /// Return selection information for the selection indicated by the
684 /// specified `name` of the specified `nameLength` if the selection
685 /// exists, and 0 otherwise.
687 const char *name,
688 int nameLength);
689
690 // CREATORS
691
692 /// Create an object of type `SequenceWithAnonymityChoice2` having the
693 /// default value. Use the optionally specified `basicAllocator` to
694 /// supply memory. If `basicAllocator` is 0, the currently installed
695 /// default allocator is used.
696 explicit SequenceWithAnonymityChoice2(bslma::Allocator *basicAllocator = 0);
697
698 /// Create an object of type `SequenceWithAnonymityChoice2` having the
699 /// value of the specified `original` object. Use the optionally
700 /// specified `basicAllocator` to supply memory. If `basicAllocator` is
701 /// 0, the currently installed default allocator is used.
703 bslma::Allocator *basicAllocator = 0);
704
705#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
706 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
707 /// Create an object of type `SequenceWithAnonymityChoice2` having the
708 /// value of the specified `original` object. After performing this
709 /// action, the `original` object will be left in a valid, but
710 /// unspecified state.
712
713 /// Create an object of type `SequenceWithAnonymityChoice2` having the
714 /// value of the specified `original` object. After performing this
715 /// action, the `original` object will be left in a valid, but
716 /// unspecified state. Use the optionally specified `basicAllocator` to
717 /// supply memory. If `basicAllocator` is 0, the currently installed
718 /// default allocator is used.
720 bslma::Allocator *basicAllocator);
721#endif
722
723 /// Destroy this object.
725
726 // MANIPULATORS
727
728 /// Assign to this object the value of the specified `rhs` object.
730
731#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
732 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
733 /// Assign to this object the value of the specified `rhs` object.
734 /// After performing this action, the `rhs` object will be left in a
735 /// valid, but unspecified state.
737#endif
738
739 /// Reset this object to the default value (i.e., its value upon default
740 /// construction).
741 void reset();
742
743 /// Set the value of this object to be the default for the selection
744 /// indicated by the specified `selectionId`. Return 0 on success, and
745 /// non-zero value otherwise (i.e., the selection is not found).
747
748 /// Set the value of this object to be the default for the selection
749 /// indicated by the specified `name` of the specified `nameLength`.
750 /// Return 0 on success, and non-zero value otherwise (i.e., the
751 /// selection is not found).
752 int makeSelection(const char *name, int nameLength);
753
756#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
757 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
759#endif
760 // Set the value of this object to be a "Selection7" value. Optionally
761 // specify the 'value' of the "Selection7". If 'value' is not
762 // specified, the default "Selection7" value is used.
763
766#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
767 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
769#endif
770 // Set the value of this object to be a "Selection8" value. Optionally
771 // specify the 'value' of the "Selection8". If 'value' is not
772 // specified, the default "Selection8" value is used.
773
774 /// Invoke the specified `manipulator` on the address of the modifiable
775 /// selection, supplying `manipulator` with the corresponding selection
776 /// information structure. Return the value returned from the
777 /// invocation of `manipulator` if this object has a defined selection,
778 /// and -1 otherwise.
779 template <typename t_MANIPULATOR>
780 int manipulateSelection(t_MANIPULATOR& manipulator);
781
782 /// Return a reference to the modifiable "Selection7" selection of this
783 /// object if "Selection7" is the current selection.
784 ///
785 /// \pre The behavior is undefined unless "Selection7" is the selection of this object.
787
788 /// Return a reference to the modifiable "Selection8" selection of this
789 /// object if "Selection8" is the current selection.
790 ///
791 /// \pre The behavior is undefined unless "Selection8" is the selection of this object.
793
794 // ACCESSORS
795
796 /// Format this object to the specified output `stream` at the
797 /// optionally specified indentation `level` and return a reference to
798 /// the modifiable `stream`. If `level` is specified, optionally
799 /// specify `spacesPerLevel`, the number of spaces per indentation level
800 /// for this and all of its nested objects. Each line is indented by
801 /// the absolute value of `level * spacesPerLevel`. If `level` is
802 /// negative, suppress indentation of the first line. If
803 /// `spacesPerLevel` is negative, suppress line breaks and format the
804 /// entire output on one line. If `stream` is initially invalid, this operation has no effect.
805 ///
806 /// \note Note that a trailing newline is provided
807 /// in multiline mode only.
808 bsl::ostream& print(bsl::ostream& stream,
809 int level = 0,
810 int spacesPerLevel = 4) const;
811
812 /// Return the id of the current selection if the selection is defined,
813 /// and -1 otherwise.
814 int selectionId() const;
815
816 /// Invoke the specified `accessor` on the non-modifiable selection,
817 /// supplying `accessor` with the corresponding selection information
818 /// structure. Return the value returned from the invocation of
819 /// `accessor` if this object has a defined selection, and -1 otherwise.
820 template <typename t_ACCESSOR>
821 int accessSelection(t_ACCESSOR& accessor) const;
822
823 /// Return a reference to the non-modifiable "Selection7" selection of
824 /// this object if "Selection7" is the current selection.
825 ///
826 /// \pre The behavior is undefined unless "Selection7" is the selection of this object.
827 const s_baltst::Sequence4& selection7() const;
828
829 /// Return a reference to the non-modifiable "Selection8" selection of
830 /// this object if "Selection8" is the current selection.
831 ///
832 /// \pre The behavior is undefined unless "Selection8" is the selection of this object.
833 const s_baltst::Choice2& selection8() const;
834
835 /// Return `true` if the value of this object is a "Selection7" value,
836 /// and return `false` otherwise.
837 bool isSelection7Value() const;
838
839 /// Return `true` if the value of this object is a "Selection8" value,
840 /// and return `false` otherwise.
841 bool isSelection8Value() const;
842
843 /// Return `true` if the value of this object is undefined, and `false`
844 /// otherwise.
845 bool isUndefinedValue() const;
846
847 /// Return the symbolic name of the current selection of this object.
848 const char *selectionName() const;
849
850 // HIDDEN FRIENDS
851
852 /// Return `true` if the specified `lhs` and `rhs` objects have the same
853 /// value, and `false` otherwise. Two `SequenceWithAnonymityChoice2`
854 /// objects have the same value if either the selections in both objects
855 /// have the same ids and the same values, or both selections are
856 /// undefined.
859 {
860 return lhs.isEqualTo(rhs);
861 }
862
863 /// Return `true` if the specified `lhs` and `rhs` objects do not have
864 /// the same values, as determined by `operator==`, and `false`
865 /// otherwise.
868 {
869 return !(lhs == rhs);
870 }
871
872 /// Format the specified `rhs` to the specified output `stream` and
873 /// return a reference to the modifiable `stream`.
874 friend bsl::ostream& operator<<(bsl::ostream& stream,
876 {
877 return rhs.print(stream, 0, -1);
878 }
879};
880
881} // close package namespace
882
883// TRAITS
884
886
887namespace s_baltst {
888
889 // ===========================
890 // class SequenceWithAnonymity
891 // ===========================
892
894
895 // INSTANCE DATA
896 s_baltst::Sequence6 d_element4;
900
901 // PRIVATE ACCESSORS
902 bool isEqualTo(const SequenceWithAnonymity& rhs) const;
903
904 public:
905 // TYPES
906 enum {
911 };
912
913 enum {
915 };
916
917 enum {
922 };
923
924 // CONSTANTS
925 static const char CLASS_NAME[];
926
928
929 public:
930 // CLASS METHODS
931
932 /// Return attribute information for the attribute indicated by the
933 /// specified `id` if the attribute exists, and 0 otherwise.
935
936 /// Return attribute information for the attribute indicated by the
937 /// specified `name` of the specified `nameLength` if the attribute
938 /// exists, and 0 otherwise.
940 const char *name,
941 int nameLength);
942
943 // CREATORS
944
945 /// Create an object of type `SequenceWithAnonymity` having the default
946 /// value. Use the optionally specified `basicAllocator` to supply
947 /// memory. If `basicAllocator` is 0, the currently installed default
948 /// allocator is used.
949 explicit SequenceWithAnonymity(bslma::Allocator *basicAllocator = 0);
950
951 /// Create an object of type `SequenceWithAnonymity` having the value of
952 /// the specified `original` object. Use the optionally specified
953 /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the
954 /// currently installed default allocator is used.
956 bslma::Allocator *basicAllocator = 0);
957
958#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
959 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
960 /// Create an object of type `SequenceWithAnonymity` having the value of
961 /// the specified `original` object. After performing this action, the
962 /// `original` object will be left in a valid, but unspecified state.
963 SequenceWithAnonymity(SequenceWithAnonymity&& original) noexcept;
964
965 /// Create an object of type `SequenceWithAnonymity` having the value of
966 /// the specified `original` object. After performing this action, the
967 /// `original` object will be left in a valid, but unspecified state.
968 /// Use the optionally specified `basicAllocator` to supply memory. If
969 /// `basicAllocator` is 0, the currently installed default allocator is
970 /// used.
972 bslma::Allocator *basicAllocator);
973#endif
974
975 /// Destroy this object.
977
978 // MANIPULATORS
979
980 /// Assign to this object the value of the specified `rhs` object.
982
983#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
984 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
985 /// Assign to this object the value of the specified `rhs` object.
986 /// After performing this action, the `rhs` object will be left in a
987 /// valid, but unspecified state.
989#endif
990
991 /// Reset this object to the default value (i.e., its value upon
992 /// default construction).
993 void reset();
994
995 /// Invoke the specified `manipulator` sequentially on the address of
996 /// each (modifiable) attribute of this object, supplying `manipulator`
997 /// with the corresponding attribute information structure until such
998 /// invocation returns a non-zero value. Return the value from the
999 /// last invocation of `manipulator` (i.e., the invocation that
1000 /// terminated the sequence).
1001 template <typename t_MANIPULATOR>
1002 int manipulateAttributes(t_MANIPULATOR& manipulator);
1003
1004 /// Invoke the specified `manipulator` on the address of
1005 /// the (modifiable) attribute indicated by the specified `id`,
1006 /// supplying `manipulator` with the corresponding attribute
1007 /// information structure. Return the value returned from the
1008 /// invocation of `manipulator` if `id` identifies an attribute of this
1009 /// class, and -1 otherwise.
1010 template <typename t_MANIPULATOR>
1011 int manipulateAttribute(t_MANIPULATOR& manipulator, int id);
1012
1013 /// Invoke the specified `manipulator` on the address of
1014 /// the (modifiable) attribute indicated by the specified `name` of the
1015 /// specified `nameLength`, supplying `manipulator` with the
1016 /// corresponding attribute information structure. Return the value
1017 /// returned from the invocation of `manipulator` if `name` identifies
1018 /// an attribute of this class, and -1 otherwise.
1019 template <typename t_MANIPULATOR>
1020 int manipulateAttribute(t_MANIPULATOR& manipulator,
1021 const char *name,
1022 int nameLength);
1023
1024 /// Return a reference to the modifiable "Choice" attribute of this
1025 /// object.
1027
1028 /// Return a reference to the modifiable "Choice1" attribute of this
1029 /// object.
1031
1032 /// Return a reference to the modifiable "Choice2" attribute of this
1033 /// object.
1035
1036 /// Return a reference to the modifiable "Element4" attribute of this
1037 /// object.
1039
1040 // ACCESSORS
1041
1042 /// Format this object to the specified output `stream` at the
1043 /// optionally specified indentation `level` and return a reference to
1044 /// the modifiable `stream`. If `level` is specified, optionally
1045 /// specify `spacesPerLevel`, the number of spaces per indentation level
1046 /// for this and all of its nested objects. Each line is indented by
1047 /// the absolute value of `level * spacesPerLevel`. If `level` is
1048 /// negative, suppress indentation of the first line. If
1049 /// `spacesPerLevel` is negative, suppress line breaks and format the
1050 /// entire output on one line. If `stream` is initially invalid, this operation has no effect.
1051 ///
1052 /// \note Note that a trailing newline is provided
1053 /// in multiline mode only.
1054 bsl::ostream& print(bsl::ostream& stream,
1055 int level = 0,
1056 int spacesPerLevel = 4) const;
1057
1058 /// Invoke the specified `accessor` sequentially on each
1059 /// (non-modifiable) attribute of this object, supplying `accessor`
1060 /// with the corresponding attribute information structure until such
1061 /// invocation returns a non-zero value. Return the value from the
1062 /// last invocation of `accessor` (i.e., the invocation that terminated
1063 /// the sequence).
1064 template <typename t_ACCESSOR>
1065 int accessAttributes(t_ACCESSOR& accessor) const;
1066
1067 /// Invoke the specified `accessor` on the (non-modifiable) attribute
1068 /// of this object indicated by the specified `id`, supplying `accessor`
1069 /// with the corresponding attribute information structure. Return the
1070 /// value returned from the invocation of `accessor` if `id` identifies
1071 /// an attribute of this class, and -1 otherwise.
1072 template <typename t_ACCESSOR>
1073 int accessAttribute(t_ACCESSOR& accessor, int id) const;
1074
1075 /// Invoke the specified `accessor` on the (non-modifiable) attribute
1076 /// of this object indicated by the specified `name` of the specified
1077 /// `nameLength`, supplying `accessor` with the corresponding attribute
1078 /// information structure. Return the value returned from the
1079 /// invocation of `accessor` if `name` identifies an attribute of this
1080 /// class, and -1 otherwise.
1081 template <typename t_ACCESSOR>
1082 int accessAttribute(t_ACCESSOR& accessor,
1083 const char *name,
1084 int nameLength) const;
1085
1086 /// Return a reference offering non-modifiable access to the "Choice"
1087 /// attribute of this object.
1088 const SequenceWithAnonymityChoice& choice() const;
1089
1090 /// Return a reference offering non-modifiable access to the "Choice1"
1091 /// attribute of this object.
1093
1094 /// Return a reference offering non-modifiable access to the "Choice2"
1095 /// attribute of this object.
1097
1098 /// Return a reference offering non-modifiable access to the "Element4"
1099 /// attribute of this object.
1100 const s_baltst::Sequence6& element4() const;
1101
1102 // HIDDEN FRIENDS
1103
1104 /// Return `true` if the specified `lhs` and `rhs` attribute objects
1105 /// have the same value, and `false` otherwise. Two attribute objects
1106 /// have the same value if each respective attribute has the same value.
1107 friend bool operator==(const SequenceWithAnonymity& lhs,
1108 const SequenceWithAnonymity& rhs)
1109 {
1110 return lhs.isEqualTo(rhs);
1111 }
1112
1113 /// Returns `!(lhs == rhs)`
1114 friend bool operator!=(const SequenceWithAnonymity& lhs,
1115 const SequenceWithAnonymity& rhs)
1116 {
1117 return !(lhs == rhs);
1118 }
1119
1120 /// Format the specified `rhs` to the specified output `stream` and
1121 /// return a reference to the modifiable `stream`.
1122 friend bsl::ostream& operator<<(bsl::ostream& stream,
1123 const SequenceWithAnonymity& rhs)
1124 {
1125 return rhs.print(stream, 0, -1);
1126 }
1127};
1128
1129} // close package namespace
1130
1131// TRAITS
1132
1134template <>
1135struct bdlat_UsesDefaultValueFlag<s_baltst::SequenceWithAnonymity> : bsl::true_type {};
1136
1137// ============================================================================
1138// INLINE DEFINITIONS
1139// ============================================================================
1140
1141namespace s_baltst {
1142
1143 // ----------------------------------
1144 // class SequenceWithAnonymityChoice1
1145 // ----------------------------------
1146
1147// CLASS METHODS
1148// PRIVATE ACCESSORS
1149inline
1150bool SequenceWithAnonymityChoice1::isEqualTo(const SequenceWithAnonymityChoice1& rhs) const
1151{
1152 typedef SequenceWithAnonymityChoice1 Class;
1153 if (this->selectionId() == rhs.selectionId()) {
1154 switch (rhs.selectionId()) {
1155 case Class::SELECTION_ID_SELECTION5:
1156 return this->selection5() == rhs.selection5();
1157 case Class::SELECTION_ID_SELECTION6:
1158 return this->selection6() == rhs.selection6();
1159 default:
1160 BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId());
1161 return true;
1162 }
1163 }
1164 else {
1165 return false;
1166 }
1167}
1168
1169// CREATORS
1170inline
1172: d_selectionId(SELECTION_ID_UNDEFINED)
1173, d_allocator_p(bslma::Default::allocator(basicAllocator))
1174{
1175}
1176
1177inline
1182
1183// MANIPULATORS
1184template <typename t_MANIPULATOR>
1186{
1187 switch (d_selectionId) {
1189 return manipulator(&d_selection5.object(),
1192 return manipulator(&d_selection6.object(),
1194 default:
1196 return -1;
1197 }
1198}
1199
1200inline
1206
1207inline
1213
1214// ACCESSORS
1215inline
1217{
1218 return d_selectionId;
1219}
1220
1221template <typename t_ACCESSOR>
1223{
1224 switch (d_selectionId) {
1226 return accessor(d_selection5.object(),
1229 return accessor(d_selection6.object(),
1231 default:
1232 BSLS_ASSERT(SELECTION_ID_UNDEFINED == d_selectionId);
1233 return -1;
1234 }
1235}
1236
1237inline
1239{
1240 BSLS_ASSERT(SELECTION_ID_SELECTION5 == d_selectionId);
1241 return d_selection5.object();
1242}
1243
1244inline
1246{
1247 BSLS_ASSERT(SELECTION_ID_SELECTION6 == d_selectionId);
1248 return d_selection6.object();
1249}
1250
1251inline
1253{
1254 return SELECTION_ID_SELECTION5 == d_selectionId;
1255}
1256
1257inline
1259{
1260 return SELECTION_ID_SELECTION6 == d_selectionId;
1261}
1262
1263inline
1265{
1266 return SELECTION_ID_UNDEFINED == d_selectionId;
1267}
1268
1269
1270 // ---------------------------------
1271 // class SequenceWithAnonymityChoice
1272 // ---------------------------------
1273
1274// CLASS METHODS
1275// PRIVATE ACCESSORS
1276inline
1277bool SequenceWithAnonymityChoice::isEqualTo(const SequenceWithAnonymityChoice& rhs) const
1278{
1279 typedef SequenceWithAnonymityChoice Class;
1280 if (this->selectionId() == rhs.selectionId()) {
1281 switch (rhs.selectionId()) {
1282 case Class::SELECTION_ID_SELECTION1:
1283 return this->selection1() == rhs.selection1();
1284 case Class::SELECTION_ID_SELECTION2:
1285 return this->selection2() == rhs.selection2();
1286 case Class::SELECTION_ID_SELECTION3:
1287 return this->selection3() == rhs.selection3();
1288 case Class::SELECTION_ID_SELECTION4:
1289 return this->selection4() == rhs.selection4();
1290 default:
1291 BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId());
1292 return true;
1293 }
1294 }
1295 else {
1296 return false;
1297 }
1298}
1299
1300// CREATORS
1301inline
1303: d_selectionId(SELECTION_ID_UNDEFINED)
1304, d_allocator_p(bslma::Default::allocator(basicAllocator))
1305{
1306}
1307
1308inline
1313
1314// MANIPULATORS
1315template <typename t_MANIPULATOR>
1336
1337inline
1343
1344inline
1346{
1347 BSLS_ASSERT(SELECTION_ID_SELECTION2 == d_selectionId);
1348 return d_selection2.object();
1349}
1350
1351inline
1357
1358inline
1364
1365// ACCESSORS
1366inline
1368{
1369 return d_selectionId;
1370}
1371
1372template <typename t_ACCESSOR>
1374{
1375 switch (d_selectionId) {
1377 return accessor(d_selection1.object(),
1380 return accessor(d_selection2.object(),
1383 return accessor(d_selection3.object(),
1386 return accessor(d_selection4.object(),
1388 default:
1389 BSLS_ASSERT(SELECTION_ID_UNDEFINED == d_selectionId);
1390 return -1;
1391 }
1392}
1393
1394inline
1400
1401inline
1403{
1404 BSLS_ASSERT(SELECTION_ID_SELECTION2 == d_selectionId);
1405 return d_selection2.object();
1406}
1407
1408inline
1414
1415inline
1421
1422inline
1424{
1425 return SELECTION_ID_SELECTION1 == d_selectionId;
1426}
1427
1428inline
1430{
1431 return SELECTION_ID_SELECTION2 == d_selectionId;
1432}
1433
1434inline
1436{
1437 return SELECTION_ID_SELECTION3 == d_selectionId;
1438}
1439
1440inline
1442{
1443 return SELECTION_ID_SELECTION4 == d_selectionId;
1444}
1445
1446inline
1448{
1449 return SELECTION_ID_UNDEFINED == d_selectionId;
1450}
1451
1452
1453 // ----------------------------------
1454 // class SequenceWithAnonymityChoice2
1455 // ----------------------------------
1456
1457// CLASS METHODS
1458// PRIVATE ACCESSORS
1459inline
1460bool SequenceWithAnonymityChoice2::isEqualTo(const SequenceWithAnonymityChoice2& rhs) const
1461{
1462 typedef SequenceWithAnonymityChoice2 Class;
1463 if (this->selectionId() == rhs.selectionId()) {
1464 switch (rhs.selectionId()) {
1465 case Class::SELECTION_ID_SELECTION7:
1466 return this->selection7() == rhs.selection7();
1467 case Class::SELECTION_ID_SELECTION8:
1468 return this->selection8() == rhs.selection8();
1469 default:
1470 BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId());
1471 return true;
1472 }
1473 }
1474 else {
1475 return false;
1476 }
1477}
1478
1479// CREATORS
1480inline
1482: d_selectionId(SELECTION_ID_UNDEFINED)
1483, d_allocator_p(bslma::Default::allocator(basicAllocator))
1484{
1485}
1486
1487inline
1492
1493// MANIPULATORS
1494template <typename t_MANIPULATOR>
1496{
1497 switch (d_selectionId) {
1499 return manipulator(d_selection7,
1502 return manipulator(d_selection8,
1504 default:
1506 return -1;
1507 }
1508}
1509
1510inline
1516
1517inline
1523
1524// ACCESSORS
1525inline
1527{
1528 return d_selectionId;
1529}
1530
1531template <typename t_ACCESSOR>
1533{
1534 switch (d_selectionId) {
1536 return accessor(*d_selection7,
1539 return accessor(*d_selection8,
1541 default:
1542 BSLS_ASSERT(SELECTION_ID_UNDEFINED == d_selectionId);
1543 return -1;
1544 }
1545}
1546
1547inline
1553
1554inline
1560
1561inline
1563{
1564 return SELECTION_ID_SELECTION7 == d_selectionId;
1565}
1566
1567inline
1569{
1570 return SELECTION_ID_SELECTION8 == d_selectionId;
1571}
1572
1573inline
1575{
1576 return SELECTION_ID_UNDEFINED == d_selectionId;
1577}
1578
1579
1580 // ---------------------------
1581 // class SequenceWithAnonymity
1582 // ---------------------------
1583
1584// PRIVATE ACCESSORS
1585inline
1586bool SequenceWithAnonymity::isEqualTo(const SequenceWithAnonymity& rhs) const
1587{
1588 return this->choice() == rhs.choice() &&
1589 this->choice1() == rhs.choice1() &&
1590 this->choice2() == rhs.choice2() &&
1591 this->element4() == rhs.element4();
1592}
1593
1594// CLASS METHODS
1595// MANIPULATORS
1596template <typename t_MANIPULATOR>
1597int SequenceWithAnonymity::manipulateAttributes(t_MANIPULATOR& manipulator)
1598{
1599 int ret;
1600
1601 ret = manipulator(&d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
1602 if (ret) {
1603 return ret;
1604 }
1605
1606 ret = manipulator(&d_choice1, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE1]);
1607 if (ret) {
1608 return ret;
1609 }
1610
1611 ret = manipulator(&d_choice2, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE2]);
1612 if (ret) {
1613 return ret;
1614 }
1615
1616 ret = manipulator(&d_element4, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ELEMENT4]);
1617 if (ret) {
1618 return ret;
1619 }
1620
1621 return 0;
1622}
1623
1624template <typename t_MANIPULATOR>
1625int SequenceWithAnonymity::manipulateAttribute(t_MANIPULATOR& manipulator, int id)
1626{
1627 enum { NOT_FOUND = -1 };
1628
1629 switch (id) {
1630 case ATTRIBUTE_ID_CHOICE: {
1631 return manipulator(&d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
1632 }
1633 case ATTRIBUTE_ID_CHOICE1: {
1634 return manipulator(&d_choice1, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE1]);
1635 }
1636 case ATTRIBUTE_ID_CHOICE2: {
1637 return manipulator(&d_choice2, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE2]);
1638 }
1639 case ATTRIBUTE_ID_ELEMENT4: {
1640 return manipulator(&d_element4, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ELEMENT4]);
1641 }
1642 default:
1643 return NOT_FOUND;
1644 }
1645}
1646
1647template <typename t_MANIPULATOR>
1649 t_MANIPULATOR& manipulator,
1650 const char *name,
1651 int nameLength)
1652{
1653 enum { NOT_FOUND = -1 };
1654
1655 const bdlat_AttributeInfo *attributeInfo =
1656 lookupAttributeInfo(name, nameLength);
1657 if (0 == attributeInfo) {
1658 return NOT_FOUND;
1659 }
1660
1661 return manipulateAttribute(manipulator, attributeInfo->d_id);
1662}
1663
1664inline
1669
1670inline
1675
1676inline
1681
1682inline
1684{
1685 return d_element4;
1686}
1687
1688// ACCESSORS
1689template <typename t_ACCESSOR>
1690int SequenceWithAnonymity::accessAttributes(t_ACCESSOR& accessor) const
1691{
1692 int ret;
1693
1694 ret = accessor(d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
1695 if (ret) {
1696 return ret;
1697 }
1698
1699 ret = accessor(d_choice1, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE1]);
1700 if (ret) {
1701 return ret;
1702 }
1703
1704 ret = accessor(d_choice2, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE2]);
1705 if (ret) {
1706 return ret;
1707 }
1708
1709 ret = accessor(d_element4, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ELEMENT4]);
1710 if (ret) {
1711 return ret;
1712 }
1713
1714 return 0;
1715}
1716
1717template <typename t_ACCESSOR>
1718int SequenceWithAnonymity::accessAttribute(t_ACCESSOR& accessor, int id) const
1719{
1720 enum { NOT_FOUND = -1 };
1721
1722 switch (id) {
1723 case ATTRIBUTE_ID_CHOICE: {
1724 return accessor(d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
1725 }
1726 case ATTRIBUTE_ID_CHOICE1: {
1727 return accessor(d_choice1, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE1]);
1728 }
1729 case ATTRIBUTE_ID_CHOICE2: {
1730 return accessor(d_choice2, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE2]);
1731 }
1732 case ATTRIBUTE_ID_ELEMENT4: {
1733 return accessor(d_element4, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ELEMENT4]);
1734 }
1735 default:
1736 return NOT_FOUND;
1737 }
1738}
1739
1740template <typename t_ACCESSOR>
1742 t_ACCESSOR& accessor,
1743 const char *name,
1744 int nameLength) const
1745{
1746 enum { NOT_FOUND = -1 };
1747
1748 const bdlat_AttributeInfo *attributeInfo =
1749 lookupAttributeInfo(name, nameLength);
1750 if (0 == attributeInfo) {
1751 return NOT_FOUND;
1752 }
1753
1754 return accessAttribute(accessor, attributeInfo->d_id);
1755}
1756
1757inline
1759{
1760 return d_choice;
1761}
1762
1763inline
1765{
1766 return d_choice1;
1767}
1768
1769inline
1774
1775inline
1777{
1778 return d_element4;
1779}
1780
1781} // close package namespace
1782
1783// FREE FUNCTIONS
1784
1785
1786#endif
1787
1788// GENERATED BY BLP_BAS_CODEGEN_2025.08.21
1789// USING bas_codegen.pl s_baltst_sequencewithanonymity.xsd --mode msg --includedir . --msgComponent sequencewithanonymity --noRecurse --noExternalization --noHashSupport --noAggregateConversion
1790// ----------------------------------------------------------------------------
1791// NOTICE:
1792// Copyright 2025 Bloomberg Finance L.P. All rights reserved.
1793// Property of Bloomberg Finance L.P. (BFLP)
1794// This software is made available solely pursuant to the
1795// terms of a BFLP license agreement which governs its use.
1796// ------------------------------- END-OF-FILE --------------------------------
1797
1798/** @} */
1799/** @} */
1800/** @} */
Definition bdlb_nullablevalue.h:262
Definition bslstl_string.h:1252
Definition bslma_allocator.h:545
Definition s_baltst_ratsnest.h:1611
Definition s_baltst_customint.h:65
Definition s_baltst_customstring.h:71
Definition s_baltst_ratsnest.h:1909
Definition s_baltst_ratsnest.h:645
Definition s_baltst_sequencewithanonymity.h:84
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
@ SELECTION_ID_SELECTION5
Definition s_baltst_sequencewithanonymity.h:103
@ SELECTION_ID_UNDEFINED
Definition s_baltst_sequencewithanonymity.h:102
@ SELECTION_ID_SELECTION6
Definition s_baltst_sequencewithanonymity.h:104
static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]
Definition s_baltst_sequencewithanonymity.h:119
static const char CLASS_NAME[]
Definition s_baltst_sequencewithanonymity.h:117
friend bsl::ostream & operator<<(bsl::ostream &stream, const SequenceWithAnonymityChoice1 &rhs)
Definition s_baltst_sequencewithanonymity.h:314
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:1252
int accessSelection(t_ACCESSOR &accessor) const
Definition s_baltst_sequencewithanonymity.h:1222
bsls::ObjectBuffer< bsl::string > d_selection6
Definition s_baltst_sequencewithanonymity.h:89
@ NUM_SELECTIONS
Definition s_baltst_sequencewithanonymity.h:108
static const bdlat_SelectionInfo * lookupSelectionInfo(int id)
bool isUndefinedValue() const
Definition s_baltst_sequencewithanonymity.h:1264
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:1171
bool isSelection6Value() const
Definition s_baltst_sequencewithanonymity.h:1258
friend bool operator!=(const SequenceWithAnonymityChoice1 &lhs, const SequenceWithAnonymityChoice1 &rhs)
Definition s_baltst_sequencewithanonymity.h:306
int selectionId() const
Definition s_baltst_sequencewithanonymity.h:1216
bool & selection5()
Definition s_baltst_sequencewithanonymity.h:1201
SequenceWithAnonymityChoice1(const SequenceWithAnonymityChoice1 &original, bslma::Allocator *basicAllocator=0)
~SequenceWithAnonymityChoice1()
Destroy this object.
Definition s_baltst_sequencewithanonymity.h:1178
friend bool operator==(const SequenceWithAnonymityChoice1 &lhs, const SequenceWithAnonymityChoice1 &rhs)
Definition s_baltst_sequencewithanonymity.h:297
bsl::string & makeSelection6(const bsl::string &value)
int manipulateSelection(t_MANIPULATOR &manipulator)
Definition s_baltst_sequencewithanonymity.h:1185
@ SELECTION_INDEX_SELECTION6
Definition s_baltst_sequencewithanonymity.h:113
@ SELECTION_INDEX_SELECTION5
Definition s_baltst_sequencewithanonymity.h:112
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:1208
Definition s_baltst_sequencewithanonymity.h:640
s_baltst::Choice2 & makeSelection8()
s_baltst::Choice2 & makeSelection8(const s_baltst::Choice2 &value)
@ SELECTION_ID_UNDEFINED
Definition s_baltst_sequencewithanonymity.h:658
@ SELECTION_ID_SELECTION7
Definition s_baltst_sequencewithanonymity.h:659
@ SELECTION_ID_SELECTION8
Definition s_baltst_sequencewithanonymity.h:660
s_baltst::Choice2 * d_selection8
Definition s_baltst_sequencewithanonymity.h:645
s_baltst::Choice2 & selection8()
Definition s_baltst_sequencewithanonymity.h:1518
~SequenceWithAnonymityChoice2()
Destroy this object.
Definition s_baltst_sequencewithanonymity.h:1488
bool isUndefinedValue() const
Definition s_baltst_sequencewithanonymity.h:1574
int accessSelection(t_ACCESSOR &accessor) const
Definition s_baltst_sequencewithanonymity.h:1532
SequenceWithAnonymityChoice2(bslma::Allocator *basicAllocator=0)
Definition s_baltst_sequencewithanonymity.h:1481
s_baltst::Sequence4 & makeSelection7()
s_baltst::Sequence4 & selection7()
Definition s_baltst_sequencewithanonymity.h:1511
friend bool operator!=(const SequenceWithAnonymityChoice2 &lhs, const SequenceWithAnonymityChoice2 &rhs)
Definition s_baltst_sequencewithanonymity.h:866
static const bdlat_SelectionInfo * lookupSelectionInfo(const char *name, int nameLength)
@ SELECTION_INDEX_SELECTION8
Definition s_baltst_sequencewithanonymity.h:669
@ SELECTION_INDEX_SELECTION7
Definition s_baltst_sequencewithanonymity.h:668
@ NUM_SELECTIONS
Definition s_baltst_sequencewithanonymity.h:664
int manipulateSelection(t_MANIPULATOR &manipulator)
Definition s_baltst_sequencewithanonymity.h:1495
s_baltst::Sequence4 & makeSelection7(const s_baltst::Sequence4 &value)
static const char CLASS_NAME[]
Definition s_baltst_sequencewithanonymity.h:673
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:1568
static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]
Definition s_baltst_sequencewithanonymity.h:675
bool isSelection7Value() const
Definition s_baltst_sequencewithanonymity.h:1562
friend bsl::ostream & operator<<(bsl::ostream &stream, const SequenceWithAnonymityChoice2 &rhs)
Definition s_baltst_sequencewithanonymity.h:874
static const bdlat_SelectionInfo * lookupSelectionInfo(int id)
SequenceWithAnonymityChoice2(const SequenceWithAnonymityChoice2 &original, bslma::Allocator *basicAllocator=0)
int selectionId() const
Definition s_baltst_sequencewithanonymity.h:1526
friend bool operator==(const SequenceWithAnonymityChoice2 &lhs, const SequenceWithAnonymityChoice2 &rhs)
Definition s_baltst_sequencewithanonymity.h:857
s_baltst::Sequence4 * d_selection7
Definition s_baltst_sequencewithanonymity.h:644
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:333
bsls::ObjectBuffer< s_baltst::CustomInt > d_selection4
Definition s_baltst_sequencewithanonymity.h:340
bsls::ObjectBuffer< s_baltst::Sequence6 > d_selection1
Definition s_baltst_sequencewithanonymity.h:337
s_baltst::CustomInt & makeSelection4()
unsigned char & makeSelection2(unsigned char value)
bsls::ObjectBuffer< s_baltst::CustomString > d_selection3
Definition s_baltst_sequencewithanonymity.h:339
bool isSelection1Value() const
Definition s_baltst_sequencewithanonymity.h:1423
s_baltst::Sequence6 & selection1()
Definition s_baltst_sequencewithanonymity.h:1338
~SequenceWithAnonymityChoice()
Destroy this object.
Definition s_baltst_sequencewithanonymity.h:1309
@ NUM_SELECTIONS
Definition s_baltst_sequencewithanonymity.h:361
unsigned char & selection2()
Definition s_baltst_sequencewithanonymity.h:1345
int manipulateSelection(t_MANIPULATOR &manipulator)
Definition s_baltst_sequencewithanonymity.h:1316
bool isSelection3Value() const
Definition s_baltst_sequencewithanonymity.h:1435
s_baltst::CustomString & makeSelection3()
SequenceWithAnonymityChoice(bslma::Allocator *basicAllocator=0)
Definition s_baltst_sequencewithanonymity.h:1302
int accessSelection(t_ACCESSOR &accessor) const
Definition s_baltst_sequencewithanonymity.h:1373
int selectionId() const
Definition s_baltst_sequencewithanonymity.h:1367
s_baltst::CustomString & makeSelection3(const s_baltst::CustomString &value)
static const bdlat_SelectionInfo * lookupSelectionInfo(int id)
s_baltst::CustomString & selection3()
Definition s_baltst_sequencewithanonymity.h:1352
SequenceWithAnonymityChoice & operator=(const SequenceWithAnonymityChoice &rhs)
Assign to this object the value of the specified rhs object.
@ SELECTION_ID_SELECTION2
Definition s_baltst_sequencewithanonymity.h:355
@ SELECTION_ID_SELECTION1
Definition s_baltst_sequencewithanonymity.h:354
@ SELECTION_ID_SELECTION4
Definition s_baltst_sequencewithanonymity.h:357
@ SELECTION_ID_SELECTION3
Definition s_baltst_sequencewithanonymity.h:356
@ SELECTION_ID_UNDEFINED
Definition s_baltst_sequencewithanonymity.h:353
static const char CLASS_NAME[]
Definition s_baltst_sequencewithanonymity.h:372
static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]
Definition s_baltst_sequencewithanonymity.h:374
bsls::ObjectBuffer< unsigned char > d_selection2
Definition s_baltst_sequencewithanonymity.h:338
bool isSelection4Value() const
Definition s_baltst_sequencewithanonymity.h:1441
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)
friend bool operator==(const SequenceWithAnonymityChoice &lhs, const SequenceWithAnonymityChoice &rhs)
Definition s_baltst_sequencewithanonymity.h:604
friend bool operator!=(const SequenceWithAnonymityChoice &lhs, const SequenceWithAnonymityChoice &rhs)
Definition s_baltst_sequencewithanonymity.h:613
bool isSelection2Value() const
Definition s_baltst_sequencewithanonymity.h:1429
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:1359
friend bsl::ostream & operator<<(bsl::ostream &stream, const SequenceWithAnonymityChoice &rhs)
Definition s_baltst_sequencewithanonymity.h:621
bool isUndefinedValue() const
Definition s_baltst_sequencewithanonymity.h:1447
@ SELECTION_INDEX_SELECTION3
Definition s_baltst_sequencewithanonymity.h:367
@ SELECTION_INDEX_SELECTION2
Definition s_baltst_sequencewithanonymity.h:366
@ SELECTION_INDEX_SELECTION4
Definition s_baltst_sequencewithanonymity.h:368
@ SELECTION_INDEX_SELECTION1
Definition s_baltst_sequencewithanonymity.h:365
s_baltst::Sequence6 & makeSelection1(const s_baltst::Sequence6 &value)
Definition s_baltst_sequencewithanonymity.h:893
~SequenceWithAnonymity()
Destroy this object.
int manipulateAttributes(t_MANIPULATOR &manipulator)
Definition s_baltst_sequencewithanonymity.h:1597
static const bdlat_AttributeInfo * lookupAttributeInfo(const char *name, int nameLength)
@ ATTRIBUTE_INDEX_CHOICE2
Definition s_baltst_sequencewithanonymity.h:920
@ ATTRIBUTE_INDEX_CHOICE
Definition s_baltst_sequencewithanonymity.h:918
@ ATTRIBUTE_INDEX_CHOICE1
Definition s_baltst_sequencewithanonymity.h:919
@ ATTRIBUTE_INDEX_ELEMENT4
Definition s_baltst_sequencewithanonymity.h:921
static const char CLASS_NAME[]
Definition s_baltst_sequencewithanonymity.h:925
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
@ NUM_ATTRIBUTES
Definition s_baltst_sequencewithanonymity.h:914
friend bool operator==(const SequenceWithAnonymity &lhs, const SequenceWithAnonymity &rhs)
Definition s_baltst_sequencewithanonymity.h:1107
friend bool operator!=(const SequenceWithAnonymity &lhs, const SequenceWithAnonymity &rhs)
Returns !(lhs == rhs)
Definition s_baltst_sequencewithanonymity.h:1114
SequenceWithAnonymityChoice & choice()
Definition s_baltst_sequencewithanonymity.h:1665
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(t_ACCESSOR &accessor, int id) const
Definition s_baltst_sequencewithanonymity.h:1718
friend bsl::ostream & operator<<(bsl::ostream &stream, const SequenceWithAnonymity &rhs)
Definition s_baltst_sequencewithanonymity.h:1122
int accessAttributes(t_ACCESSOR &accessor) const
Definition s_baltst_sequencewithanonymity.h:1690
static const bdlat_AttributeInfo ATTRIBUTE_INFO_ARRAY[]
Definition s_baltst_sequencewithanonymity.h:927
s_baltst::Sequence6 & element4()
Definition s_baltst_sequencewithanonymity.h:1683
static const bdlat_AttributeInfo * lookupAttributeInfo(int id)
SequenceWithAnonymityChoice1 & choice1()
Definition s_baltst_sequencewithanonymity.h:1671
@ ATTRIBUTE_ID_CHOICE2
Definition s_baltst_sequencewithanonymity.h:909
@ ATTRIBUTE_ID_ELEMENT4
Definition s_baltst_sequencewithanonymity.h:910
@ ATTRIBUTE_ID_CHOICE1
Definition s_baltst_sequencewithanonymity.h:908
@ ATTRIBUTE_ID_CHOICE
Definition s_baltst_sequencewithanonymity.h:907
int manipulateAttribute(t_MANIPULATOR &manipulator, int id)
Definition s_baltst_sequencewithanonymity.h:1625
bdlb::NullableValue< SequenceWithAnonymityChoice2 > & choice2()
Definition s_baltst_sequencewithanonymity.h:1677
#define BDLAT_DECL_CHOICE_WITH_ALLOCATOR_BITWISEMOVEABLE_TRAITS(ClassName)
Definition bdlat_typetraits.h:268
#define BDLAT_DECL_SEQUENCE_WITH_ALLOCATOR_BITWISEMOVEABLE_TRAITS(ClassName)
Definition bdlat_typetraits.h:301
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1976
#define BSLS_IDENT_RCSID(tag, str)
BSLS_IDENT_RCSID() - insert ident str (specific to platform/compiler)
Definition bsls_ident.h:244
#define BSLS_IDENT_PRAGMA_ONCE
BSLS_IDENT_PRAGMA_ONCE - macro to avoid multiple inclusion
Definition bsls_ident.h:263
Definition baljsn_encoder_testtypes.h:76
Definition s_baltst_address.h:66
Definition bdlat_attributeinfo.h:139
int d_id
Definition bdlat_attributeinfo.h:142
Definition bdlat_selectioninfo.h:138
Definition bdlat_typetraits.h:146
TYPE & object()
Definition bsls_objectbuffer.h:352