BDE 4.39.x Production Release
Loading...
Searching...
No Matches
s_baltst_basicschema.h
Go to the documentation of this file.
1/// @file s_baltst_basicschema.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// s_baltst_basicschema.h *DO NOT EDIT* @generated -*-C++-*-
8#ifndef INCLUDED_S_BALTST_BASICSCHEMA
9#define INCLUDED_S_BALTST_BASICSCHEMA
10
11#include <bsls_ident.h>
12BSLS_IDENT_RCSID(s_baltst_basicschema_h,"$Id$ $CSID$")
14
15/// @defgroup s_baltst_basicschema s_baltst_basicschema
16/// @brief Provide value-semantic attribute classes
17/// @addtogroup Standalones
18/// @{
19/// @addtogroup s_baltst
20/// @{
21/// @addtogroup s_baltst_basicschema
22/// @{
23///
24/// <h1> Outline </h1>
25/// * <a href="#s_baltst_basicschema-purpose"> Purpose</a>
26///
27/// # Purpose {#s_baltst_basicschema-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_basicschema
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 <bslh_hash.h>
52#include <bsls_objectbuffer.h>
53
54#include <bslma_default.h>
55
56#include <bsls_assert.h>
57
58#include <bdlb_nullablevalue.h>
59
60#include <bsl_string.h>
61
62#include <bsl_vector.h>
63
64#include <bsl_iosfwd.h>
65#include <bsl_limits.h>
66
67#include <bslma_allocator.h>
68
69
70
71
72namespace s_baltst { class BasicSchemaAnnotationElement; }
73namespace s_baltst { class BasicSchemaEnumerationElementChoice; }
74namespace s_baltst { class BasicSchemaEnumerationElement; }
75namespace s_baltst { class BasicSchemaRestrictionElementChoice; }
76namespace s_baltst { class BasicSchemaRestrictionElement; }
77namespace s_baltst { class BasicSchemaSimpleTypeElementChoice; }
78namespace s_baltst { class BasicSchemaSimpleTypeElement; }
79namespace s_baltst { class BasicSchemaChoiceElement; }
80namespace s_baltst { class BasicSchemaChoiceElementChoice; }
81namespace s_baltst { class BasicSchemaComplexTypeElement; }
82namespace s_baltst { class BasicSchemaComplexTypeElementChoice; }
83namespace s_baltst { class BasicSchemaElement; }
84namespace s_baltst { class BasicSchemaElementChoice; }
85namespace s_baltst { class BasicSchemaSequenceElement; }
86namespace s_baltst { class BasicSchemaSequenceElementChoice; }
87namespace s_baltst { class BasicSchemaChoice; }
88namespace s_baltst { class BasicSchema; }
89namespace s_baltst {
90
91 // ==================================
92 // class BasicSchemaAnnotationElement
93 // ==================================
94
96
97 // INSTANCE DATA
99
100 public:
101 // TYPES
102 enum {
104 };
105
106 enum {
108 };
109
110 enum {
112 };
113
114 // CONSTANTS
115 static const char CLASS_NAME[];
116
118
119 public:
120 // CLASS METHODS
121
122 /// Return attribute information for the attribute indicated by the
123 /// specified `id` if the attribute exists, and 0 otherwise.
125
126 /// Return attribute information for the attribute indicated by the
127 /// specified `name` of the specified `nameLength` if the attribute
128 /// exists, and 0 otherwise.
130 const char *name,
131 int nameLength);
132
133 // CREATORS
134
135 /// Create an object of type `BasicSchemaAnnotationElement` having the
136 /// default value. Use the optionally specified `basicAllocator` to
137 /// supply memory. If `basicAllocator` is 0, the currently installed
138 /// default allocator is used.
139 explicit BasicSchemaAnnotationElement(bslma::Allocator *basicAllocator = 0);
140
141 /// Create an object of type `BasicSchemaAnnotationElement` having the
142 /// value of the specified `original` object. Use the optionally
143 /// specified `basicAllocator` to supply memory. If `basicAllocator` is
144 /// 0, the currently installed default allocator is used.
146 bslma::Allocator *basicAllocator = 0);
147
148#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
149 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
150 /// Create an object of type `BasicSchemaAnnotationElement` having the
151 /// value of the specified `original` object. After performing this
152 /// action, the `original` object will be left in a valid, but
153 /// unspecified state.
155
156 /// Create an object of type `BasicSchemaAnnotationElement` having the
157 /// value of the specified `original` object. After performing this
158 /// action, the `original` object will be left in a valid, but
159 /// unspecified state. Use the optionally specified `basicAllocator` to
160 /// supply memory. If `basicAllocator` is 0, the currently installed
161 /// default allocator is used.
163 bslma::Allocator *basicAllocator);
164#endif
165
166 /// Destroy this object.
168
169 // MANIPULATORS
170
171 /// Assign to this object the value of the specified `rhs` object.
173
174#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
175 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
176 /// Assign to this object the value of the specified `rhs` object.
177 /// After performing this action, the `rhs` object will be left in a
178 /// valid, but unspecified state.
180#endif
181
182 /// Reset this object to the default value (i.e., its value upon
183 /// default construction).
184 void reset();
185
186 /// Invoke the specified `manipulator` sequentially on the address of
187 /// each (modifiable) attribute of this object, supplying `manipulator`
188 /// with the corresponding attribute information structure until such
189 /// invocation returns a non-zero value. Return the value from the
190 /// last invocation of `manipulator` (i.e., the invocation that
191 /// terminated the sequence).
192 template<class MANIPULATOR>
193 int manipulateAttributes(MANIPULATOR& manipulator);
194
195 /// Invoke the specified `manipulator` on the address of
196 /// the (modifiable) attribute indicated by the specified `id`,
197 /// supplying `manipulator` with the corresponding attribute
198 /// information structure. Return the value returned from the
199 /// invocation of `manipulator` if `id` identifies an attribute of this
200 /// class, and -1 otherwise.
201 template<class MANIPULATOR>
202 int manipulateAttribute(MANIPULATOR& manipulator, int id);
203
204 /// Invoke the specified `manipulator` on the address of
205 /// the (modifiable) attribute indicated by the specified `name` of the
206 /// specified `nameLength`, supplying `manipulator` with the
207 /// corresponding attribute information structure. Return the value
208 /// returned from the invocation of `manipulator` if `name` identifies
209 /// an attribute of this class, and -1 otherwise.
210 template<class MANIPULATOR>
211 int manipulateAttribute(MANIPULATOR& manipulator,
212 const char *name,
213 int nameLength);
214
215 /// Return a reference to the modifiable "Documentation" attribute of
216 /// this object.
218
219 // ACCESSORS
220
221 /// Format this object to the specified output `stream` at the
222 /// optionally specified indentation `level` and return a reference to
223 /// the modifiable `stream`. If `level` is specified, optionally
224 /// specify `spacesPerLevel`, the number of spaces per indentation level
225 /// for this and all of its nested objects. Each line is indented by
226 /// the absolute value of `level * spacesPerLevel`. If `level` is
227 /// negative, suppress indentation of the first line. If
228 /// `spacesPerLevel` is negative, suppress line breaks and format the
229 /// entire output on one line. If `stream` is initially invalid, this operation has no effect.
230 ///
231 /// \note Note that a trailing newline is provided
232 /// in multiline mode only.
233 bsl::ostream& print(bsl::ostream& stream,
234 int level = 0,
235 int spacesPerLevel = 4) const;
236
237 /// Invoke the specified `accessor` sequentially on each
238 /// (non-modifiable) attribute of this object, supplying `accessor`
239 /// with the corresponding attribute information structure until such
240 /// invocation returns a non-zero value. Return the value from the
241 /// last invocation of `accessor` (i.e., the invocation that terminated
242 /// the sequence).
243 template<class ACCESSOR>
244 int accessAttributes(ACCESSOR& accessor) const;
245
246 /// Invoke the specified `accessor` on the (non-modifiable) attribute
247 /// of this object indicated by the specified `id`, supplying `accessor`
248 /// with the corresponding attribute information structure. Return the
249 /// value returned from the invocation of `accessor` if `id` identifies
250 /// an attribute of this class, and -1 otherwise.
251 template<class ACCESSOR>
252 int accessAttribute(ACCESSOR& accessor, int id) const;
253
254 /// Invoke the specified `accessor` on the (non-modifiable) attribute
255 /// of this object indicated by the specified `name` of the specified
256 /// `nameLength`, supplying `accessor` with the corresponding attribute
257 /// information structure. Return the value returned from the
258 /// invocation of `accessor` if `name` identifies an attribute of this
259 /// class, and -1 otherwise.
260 template<class ACCESSOR>
261 int accessAttribute(ACCESSOR& accessor,
262 const char *name,
263 int nameLength) const;
264
265 /// Return a reference to the non-modifiable "Documentation" attribute
266 /// of this object.
268};
269
270// FREE OPERATORS
271
272/// Return `true` if the specified `lhs` and `rhs` attribute objects have
273/// the same value, and `false` otherwise. Two attribute objects have the
274/// same value if each respective attribute has the same value.
275inline
276bool operator==(const BasicSchemaAnnotationElement& lhs, const BasicSchemaAnnotationElement& rhs);
277
278/// Return `true` if the specified `lhs` and `rhs` attribute objects do not
279/// have the same value, and `false` otherwise. Two attribute objects do
280/// not have the same value if one or more respective attributes differ in
281/// values.
282inline
283bool operator!=(const BasicSchemaAnnotationElement& lhs, const BasicSchemaAnnotationElement& rhs);
284
285/// Format the specified `rhs` to the specified output `stream` and
286/// return a reference to the modifiable `stream`.
287inline
288bsl::ostream& operator<<(bsl::ostream& stream, const BasicSchemaAnnotationElement& rhs);
289
290/// Pass the specified `object` to the specified `hashAlg`. This function
291/// integrates with the `bslh` modular hashing system and effectively
292/// provides a `bsl::hash` specialization for `BasicSchemaAnnotationElement`.
293template <typename HASH_ALGORITHM>
294void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaAnnotationElement& object);
295
296} // close package namespace
297
298// TRAITS
299
301
302namespace s_baltst {
303
304 // =========================================
305 // class BasicSchemaEnumerationElementChoice
306 // =========================================
307
309
310 // INSTANCE DATA
311 union {
313 };
314
315 int d_selectionId;
316 bslma::Allocator *d_allocator_p;
317
318 public:
319 // TYPES
320
321 enum {
324 };
325
326 enum {
328 };
329
330 enum {
332 };
333
334 // CONSTANTS
335 static const char CLASS_NAME[];
336
338
339 // CLASS METHODS
340
341 /// Return selection information for the selection indicated by the
342 /// specified `id` if the selection exists, and 0 otherwise.
344
345 /// Return selection information for the selection indicated by the
346 /// specified `name` of the specified `nameLength` if the selection
347 /// exists, and 0 otherwise.
349 const char *name,
350 int nameLength);
351
352 // CREATORS
353
354 /// Create an object of type `BasicSchemaEnumerationElementChoice`
355 /// having the default value. Use the optionally specified
356 /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the
357 /// currently installed default allocator is used.
358 explicit BasicSchemaEnumerationElementChoice(bslma::Allocator *basicAllocator = 0);
359
360 /// Create an object of type `BasicSchemaEnumerationElementChoice`
361 /// having the value of the specified `original` object. Use the
362 /// optionally specified `basicAllocator` to supply memory. If
363 /// `basicAllocator` is 0, the currently installed default allocator is
364 /// used.
366 bslma::Allocator *basicAllocator = 0);
367
368#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
369 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
370 /// Create an object of type `BasicSchemaEnumerationElementChoice`
371 /// having the value of the specified `original` object. After
372 /// performing this action, the `original` object will be left in a
373 /// valid, but unspecified state.
375
376 /// Create an object of type `BasicSchemaEnumerationElementChoice`
377 /// having the value of the specified `original` object. After
378 /// performing this action, the `original` object will be left in a
379 /// valid, but unspecified state. Use the optionally specified
380 /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the
381 /// currently installed default allocator is used.
383 bslma::Allocator *basicAllocator);
384#endif
385
386 /// Destroy this object.
388
389 // MANIPULATORS
390
391 /// Assign to this object the value of the specified `rhs` object.
393
394#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
395 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
396 /// Assign to this object the value of the specified `rhs` object.
397 /// After performing this action, the `rhs` object will be left in a
398 /// valid, but unspecified state.
400#endif
401
402 /// Reset this object to the default value (i.e., its value upon default
403 /// construction).
404 void reset();
405
406 /// Set the value of this object to be the default for the selection
407 /// indicated by the specified `selectionId`. Return 0 on success, and
408 /// non-zero value otherwise (i.e., the selection is not found).
410
411 /// Set the value of this object to be the default for the selection
412 /// indicated by the specified `name` of the specified `nameLength`.
413 /// Return 0 on success, and non-zero value otherwise (i.e., the
414 /// selection is not found).
415 int makeSelection(const char *name, int nameLength);
416
419#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
420 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
422#endif
423 // Set the value of this object to be a "Annotation" value. Optionally
424 // specify the 'value' of the "Annotation". If 'value' is not
425 // specified, the default "Annotation" value is used.
426
427 /// Invoke the specified `manipulator` on the address of the modifiable
428 /// selection, supplying `manipulator` with the corresponding selection
429 /// information structure. Return the value returned from the
430 /// invocation of `manipulator` if this object has a defined selection,
431 /// and -1 otherwise.
432 template<class MANIPULATOR>
433 int manipulateSelection(MANIPULATOR& manipulator);
434
435 /// Return a reference to the modifiable "Annotation" selection of this
436 /// object if "Annotation" is the current selection.
437 ///
438 /// \pre The behavior is undefined unless "Annotation" is the selection of this object.
440
441 // ACCESSORS
442
443 /// Format this object to the specified output `stream` at the
444 /// optionally specified indentation `level` and return a reference to
445 /// the modifiable `stream`. If `level` is specified, optionally
446 /// specify `spacesPerLevel`, the number of spaces per indentation level
447 /// for this and all of its nested objects. Each line is indented by
448 /// the absolute value of `level * spacesPerLevel`. If `level` is
449 /// negative, suppress indentation of the first line. If
450 /// `spacesPerLevel` is negative, suppress line breaks and format the
451 /// entire output on one line. If `stream` is initially invalid, this operation has no effect.
452 ///
453 /// \note Note that a trailing newline is provided
454 /// in multiline mode only.
455 bsl::ostream& print(bsl::ostream& stream,
456 int level = 0,
457 int spacesPerLevel = 4) const;
458
459 /// Return the id of the current selection if the selection is defined,
460 /// and -1 otherwise.
461 int selectionId() const;
462
463 /// Invoke the specified `accessor` on the non-modifiable selection,
464 /// supplying `accessor` with the corresponding selection information
465 /// structure. Return the value returned from the invocation of
466 /// `accessor` if this object has a defined selection, and -1 otherwise.
467 template<class ACCESSOR>
468 int accessSelection(ACCESSOR& accessor) const;
469
470 /// Return a reference to the non-modifiable "Annotation" selection of
471 /// this object if "Annotation" is the current selection.
472 ///
473 /// \pre The behavior is undefined unless "Annotation" is the selection of this object.
475
476 /// Return `true` if the value of this object is a "Annotation" value,
477 /// and return `false` otherwise.
478 bool isAnnotationValue() const;
479
480 /// Return `true` if the value of this object is undefined, and `false`
481 /// otherwise.
482 bool isUndefinedValue() const;
483
484 /// Return the symbolic name of the current selection of this object.
485 const char *selectionName() const;
486};
487
488// FREE OPERATORS
489
490/// Return `true` if the specified `lhs` and `rhs` objects have the same
491/// value, and `false` otherwise. Two `BasicSchemaEnumerationElementChoice` objects have the same
492/// value if either the selections in both objects have the same ids and
493/// the same values, or both selections are undefined.
494inline
496
497/// Return `true` if the specified `lhs` and `rhs` objects do not have the
498/// same values, as determined by `operator==`, and `false` otherwise.
499inline
501
502/// Format the specified `rhs` to the specified output `stream` and
503/// return a reference to the modifiable `stream`.
504inline
505bsl::ostream& operator<<(bsl::ostream& stream, const BasicSchemaEnumerationElementChoice& rhs);
506
507/// Pass the specified `object` to the specified `hashAlg`. This function
508/// integrates with the `bslh` modular hashing system and effectively
509/// provides a `bsl::hash` specialization for `BasicSchemaEnumerationElementChoice`.
510template <typename HASH_ALGORITHM>
511void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaEnumerationElementChoice& object);
512
513} // close package namespace
514
515// TRAITS
516
518
519namespace s_baltst {
520
521 // ===================================
522 // class BasicSchemaEnumerationElement
523 // ===================================
524
526
527 // INSTANCE DATA
530
531 public:
532 // TYPES
533 enum {
536 };
537
538 enum {
540 };
541
542 enum {
545 };
546
547 // CONSTANTS
548 static const char CLASS_NAME[];
549
551
552 public:
553 // CLASS METHODS
554
555 /// Return attribute information for the attribute indicated by the
556 /// specified `id` if the attribute exists, and 0 otherwise.
558
559 /// Return attribute information for the attribute indicated by the
560 /// specified `name` of the specified `nameLength` if the attribute
561 /// exists, and 0 otherwise.
563 const char *name,
564 int nameLength);
565
566 // CREATORS
567
568 /// Create an object of type `BasicSchemaEnumerationElement` having the
569 /// default value. Use the optionally specified `basicAllocator` to
570 /// supply memory. If `basicAllocator` is 0, the currently installed
571 /// default allocator is used.
572 explicit BasicSchemaEnumerationElement(bslma::Allocator *basicAllocator = 0);
573
574 /// Create an object of type `BasicSchemaEnumerationElement` having the
575 /// value of the specified `original` object. Use the optionally
576 /// specified `basicAllocator` to supply memory. If `basicAllocator` is
577 /// 0, the currently installed default allocator is used.
579 bslma::Allocator *basicAllocator = 0);
580
581#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
582 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
583 /// Create an object of type `BasicSchemaEnumerationElement` having the
584 /// value of the specified `original` object. After performing this
585 /// action, the `original` object will be left in a valid, but
586 /// unspecified state.
588
589 /// Create an object of type `BasicSchemaEnumerationElement` having the
590 /// value of the specified `original` object. After performing this
591 /// action, the `original` object will be left in a valid, but
592 /// unspecified state. Use the optionally specified `basicAllocator` to
593 /// supply memory. If `basicAllocator` is 0, the currently installed
594 /// default allocator is used.
596 bslma::Allocator *basicAllocator);
597#endif
598
599 /// Destroy this object.
601
602 // MANIPULATORS
603
604 /// Assign to this object the value of the specified `rhs` object.
606
607#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
608 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
609 /// Assign to this object the value of the specified `rhs` object.
610 /// After performing this action, the `rhs` object will be left in a
611 /// valid, but unspecified state.
613#endif
614
615 /// Reset this object to the default value (i.e., its value upon
616 /// default construction).
617 void reset();
618
619 /// Invoke the specified `manipulator` sequentially on the address of
620 /// each (modifiable) attribute of this object, supplying `manipulator`
621 /// with the corresponding attribute information structure until such
622 /// invocation returns a non-zero value. Return the value from the
623 /// last invocation of `manipulator` (i.e., the invocation that
624 /// terminated the sequence).
625 template<class MANIPULATOR>
626 int manipulateAttributes(MANIPULATOR& manipulator);
627
628 /// Invoke the specified `manipulator` on the address of
629 /// the (modifiable) attribute indicated by the specified `id`,
630 /// supplying `manipulator` with the corresponding attribute
631 /// information structure. Return the value returned from the
632 /// invocation of `manipulator` if `id` identifies an attribute of this
633 /// class, and -1 otherwise.
634 template<class MANIPULATOR>
635 int manipulateAttribute(MANIPULATOR& manipulator, int id);
636
637 /// Invoke the specified `manipulator` on the address of
638 /// the (modifiable) attribute indicated by the specified `name` of the
639 /// specified `nameLength`, supplying `manipulator` with the
640 /// corresponding attribute information structure. Return the value
641 /// returned from the invocation of `manipulator` if `name` identifies
642 /// an attribute of this class, and -1 otherwise.
643 template<class MANIPULATOR>
644 int manipulateAttribute(MANIPULATOR& manipulator,
645 const char *name,
646 int nameLength);
647
648 /// Return a reference to the modifiable "Value" attribute of this
649 /// object.
651
652 /// Return a reference to the modifiable "Choice" attribute of this
653 /// object.
655
656 // ACCESSORS
657
658 /// Format this object to the specified output `stream` at the
659 /// optionally specified indentation `level` and return a reference to
660 /// the modifiable `stream`. If `level` is specified, optionally
661 /// specify `spacesPerLevel`, the number of spaces per indentation level
662 /// for this and all of its nested objects. Each line is indented by
663 /// the absolute value of `level * spacesPerLevel`. If `level` is
664 /// negative, suppress indentation of the first line. If
665 /// `spacesPerLevel` is negative, suppress line breaks and format the
666 /// entire output on one line. If `stream` is initially invalid, this operation has no effect.
667 ///
668 /// \note Note that a trailing newline is provided
669 /// in multiline mode only.
670 bsl::ostream& print(bsl::ostream& stream,
671 int level = 0,
672 int spacesPerLevel = 4) const;
673
674 /// Invoke the specified `accessor` sequentially on each
675 /// (non-modifiable) attribute of this object, supplying `accessor`
676 /// with the corresponding attribute information structure until such
677 /// invocation returns a non-zero value. Return the value from the
678 /// last invocation of `accessor` (i.e., the invocation that terminated
679 /// the sequence).
680 template<class ACCESSOR>
681 int accessAttributes(ACCESSOR& accessor) const;
682
683 /// Invoke the specified `accessor` on the (non-modifiable) attribute
684 /// of this object indicated by the specified `id`, supplying `accessor`
685 /// with the corresponding attribute information structure. Return the
686 /// value returned from the invocation of `accessor` if `id` identifies
687 /// an attribute of this class, and -1 otherwise.
688 template<class ACCESSOR>
689 int accessAttribute(ACCESSOR& accessor, int id) const;
690
691 /// Invoke the specified `accessor` on the (non-modifiable) attribute
692 /// of this object indicated by the specified `name` of the specified
693 /// `nameLength`, supplying `accessor` with the corresponding attribute
694 /// information structure. Return the value returned from the
695 /// invocation of `accessor` if `name` identifies an attribute of this
696 /// class, and -1 otherwise.
697 template<class ACCESSOR>
698 int accessAttribute(ACCESSOR& accessor,
699 const char *name,
700 int nameLength) const;
701
702 /// Return a reference to the non-modifiable "Value" attribute of this
703 /// object.
705
706 /// Return a reference to the non-modifiable "Choice" attribute of this
707 /// object.
709};
710
711// FREE OPERATORS
712
713/// Return `true` if the specified `lhs` and `rhs` attribute objects have
714/// the same value, and `false` otherwise. Two attribute objects have the
715/// same value if each respective attribute has the same value.
716inline
717bool operator==(const BasicSchemaEnumerationElement& lhs, const BasicSchemaEnumerationElement& rhs);
718
719/// Return `true` if the specified `lhs` and `rhs` attribute objects do not
720/// have the same value, and `false` otherwise. Two attribute objects do
721/// not have the same value if one or more respective attributes differ in
722/// values.
723inline
724bool operator!=(const BasicSchemaEnumerationElement& lhs, const BasicSchemaEnumerationElement& rhs);
725
726/// Format the specified `rhs` to the specified output `stream` and
727/// return a reference to the modifiable `stream`.
728inline
729bsl::ostream& operator<<(bsl::ostream& stream, const BasicSchemaEnumerationElement& rhs);
730
731/// Pass the specified `object` to the specified `hashAlg`. This function
732/// integrates with the `bslh` modular hashing system and effectively
733/// provides a `bsl::hash` specialization for `BasicSchemaEnumerationElement`.
734template <typename HASH_ALGORITHM>
735void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaEnumerationElement& object);
736
737} // close package namespace
738
739// TRAITS
740
742
743namespace s_baltst {
744
745 // =========================================
746 // class BasicSchemaRestrictionElementChoice
747 // =========================================
748
750
751 // INSTANCE DATA
752 union {
755 };
756
757 int d_selectionId;
758 bslma::Allocator *d_allocator_p;
759
760 public:
761 // TYPES
762
763 enum {
767 };
768
769 enum {
771 };
772
773 enum {
776 };
777
778 // CONSTANTS
779 static const char CLASS_NAME[];
780
782
783 // CLASS METHODS
784
785 /// Return selection information for the selection indicated by the
786 /// specified `id` if the selection exists, and 0 otherwise.
788
789 /// Return selection information for the selection indicated by the
790 /// specified `name` of the specified `nameLength` if the selection
791 /// exists, and 0 otherwise.
793 const char *name,
794 int nameLength);
795
796 // CREATORS
797
798 /// Create an object of type `BasicSchemaRestrictionElementChoice`
799 /// having the default value. Use the optionally specified
800 /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the
801 /// currently installed default allocator is used.
802 explicit BasicSchemaRestrictionElementChoice(bslma::Allocator *basicAllocator = 0);
803
804 /// Create an object of type `BasicSchemaRestrictionElementChoice`
805 /// having the value of the specified `original` object. Use the
806 /// optionally specified `basicAllocator` to supply memory. If
807 /// `basicAllocator` is 0, the currently installed default allocator is
808 /// used.
810 bslma::Allocator *basicAllocator = 0);
811
812#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
813 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
814 /// Create an object of type `BasicSchemaRestrictionElementChoice`
815 /// having the value of the specified `original` object. After
816 /// performing this action, the `original` object will be left in a
817 /// valid, but unspecified state.
819
820 /// Create an object of type `BasicSchemaRestrictionElementChoice`
821 /// having the value of the specified `original` object. After
822 /// performing this action, the `original` object will be left in a
823 /// valid, but unspecified state. Use the optionally specified
824 /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the
825 /// currently installed default allocator is used.
827 bslma::Allocator *basicAllocator);
828#endif
829
830 /// Destroy this object.
832
833 // MANIPULATORS
834
835 /// Assign to this object the value of the specified `rhs` object.
837
838#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
839 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
840 /// Assign to this object the value of the specified `rhs` object.
841 /// After performing this action, the `rhs` object will be left in a
842 /// valid, but unspecified state.
844#endif
845
846 /// Reset this object to the default value (i.e., its value upon default
847 /// construction).
848 void reset();
849
850 /// Set the value of this object to be the default for the selection
851 /// indicated by the specified `selectionId`. Return 0 on success, and
852 /// non-zero value otherwise (i.e., the selection is not found).
854
855 /// Set the value of this object to be the default for the selection
856 /// indicated by the specified `name` of the specified `nameLength`.
857 /// Return 0 on success, and non-zero value otherwise (i.e., the
858 /// selection is not found).
859 int makeSelection(const char *name, int nameLength);
860
863#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
864 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
866#endif
867 // Set the value of this object to be a "Annotation" value. Optionally
868 // specify the 'value' of the "Annotation". If 'value' is not
869 // specified, the default "Annotation" value is used.
870
873#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
874 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
876#endif
877 // Set the value of this object to be a "Enumeration" value.
878 // Optionally specify the 'value' of the "Enumeration". If 'value' is
879 // not specified, the default "Enumeration" value is used.
880
881 /// Invoke the specified `manipulator` on the address of the modifiable
882 /// selection, supplying `manipulator` with the corresponding selection
883 /// information structure. Return the value returned from the
884 /// invocation of `manipulator` if this object has a defined selection,
885 /// and -1 otherwise.
886 template<class MANIPULATOR>
887 int manipulateSelection(MANIPULATOR& manipulator);
888
889 /// Return a reference to the modifiable "Annotation" selection of this
890 /// object if "Annotation" is the current selection.
891 ///
892 /// \pre The behavior is undefined unless "Annotation" is the selection of this object.
894
895 /// Return a reference to the modifiable "Enumeration" selection of this
896 /// object if "Enumeration" is the current selection.
897 ///
898 /// \pre The behavior is undefined unless "Enumeration" is the selection of this object.
900
901 // ACCESSORS
902
903 /// Format this object to the specified output `stream` at the
904 /// optionally specified indentation `level` and return a reference to
905 /// the modifiable `stream`. If `level` is specified, optionally
906 /// specify `spacesPerLevel`, the number of spaces per indentation level
907 /// for this and all of its nested objects. Each line is indented by
908 /// the absolute value of `level * spacesPerLevel`. If `level` is
909 /// negative, suppress indentation of the first line. If
910 /// `spacesPerLevel` is negative, suppress line breaks and format the
911 /// entire output on one line. If `stream` is initially invalid, this operation has no effect.
912 ///
913 /// \note Note that a trailing newline is provided
914 /// in multiline mode only.
915 bsl::ostream& print(bsl::ostream& stream,
916 int level = 0,
917 int spacesPerLevel = 4) const;
918
919 /// Return the id of the current selection if the selection is defined,
920 /// and -1 otherwise.
921 int selectionId() const;
922
923 /// Invoke the specified `accessor` on the non-modifiable selection,
924 /// supplying `accessor` with the corresponding selection information
925 /// structure. Return the value returned from the invocation of
926 /// `accessor` if this object has a defined selection, and -1 otherwise.
927 template<class ACCESSOR>
928 int accessSelection(ACCESSOR& accessor) const;
929
930 /// Return a reference to the non-modifiable "Annotation" selection of
931 /// this object if "Annotation" is the current selection.
932 ///
933 /// \pre The behavior is undefined unless "Annotation" is the selection of this object.
935
936 /// Return a reference to the non-modifiable "Enumeration" selection of
937 /// this object if "Enumeration" is the current selection.
938 ///
939 /// \pre The behavior is undefined unless "Enumeration" is the selection of this object.
941
942 /// Return `true` if the value of this object is a "Annotation" value,
943 /// and return `false` otherwise.
944 bool isAnnotationValue() const;
945
946 /// Return `true` if the value of this object is a "Enumeration" value,
947 /// and return `false` otherwise.
948 bool isEnumerationValue() const;
949
950 /// Return `true` if the value of this object is undefined, and `false`
951 /// otherwise.
952 bool isUndefinedValue() const;
953
954 /// Return the symbolic name of the current selection of this object.
955 const char *selectionName() const;
956};
957
958// FREE OPERATORS
959
960/// Return `true` if the specified `lhs` and `rhs` objects have the same
961/// value, and `false` otherwise. Two `BasicSchemaRestrictionElementChoice` objects have the same
962/// value if either the selections in both objects have the same ids and
963/// the same values, or both selections are undefined.
964inline
966
967/// Return `true` if the specified `lhs` and `rhs` objects do not have the
968/// same values, as determined by `operator==`, and `false` otherwise.
969inline
971
972/// Format the specified `rhs` to the specified output `stream` and
973/// return a reference to the modifiable `stream`.
974inline
975bsl::ostream& operator<<(bsl::ostream& stream, const BasicSchemaRestrictionElementChoice& rhs);
976
977/// Pass the specified `object` to the specified `hashAlg`. This function
978/// integrates with the `bslh` modular hashing system and effectively
979/// provides a `bsl::hash` specialization for `BasicSchemaRestrictionElementChoice`.
980template <typename HASH_ALGORITHM>
981void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaRestrictionElementChoice& object);
982
983} // close package namespace
984
985// TRAITS
986
988
989namespace s_baltst {
990
991 // ===================================
992 // class BasicSchemaRestrictionElement
993 // ===================================
994
996
997 // INSTANCE DATA
1000
1001 public:
1002 // TYPES
1003 enum {
1007
1008 enum {
1009 NUM_ATTRIBUTES = 2
1011
1012 enum {
1016
1017 // CONSTANTS
1018 static const char CLASS_NAME[];
1019
1021
1022 public:
1023 // CLASS METHODS
1024
1025 /// Return attribute information for the attribute indicated by the
1026 /// specified `id` if the attribute exists, and 0 otherwise.
1028
1029 /// Return attribute information for the attribute indicated by the
1030 /// specified `name` of the specified `nameLength` if the attribute
1031 /// exists, and 0 otherwise.
1033 const char *name,
1034 int nameLength);
1035
1036 // CREATORS
1037
1038 /// Create an object of type `BasicSchemaRestrictionElement` having the
1039 /// default value. Use the optionally specified `basicAllocator` to
1040 /// supply memory. If `basicAllocator` is 0, the currently installed
1041 /// default allocator is used.
1043
1044 /// Create an object of type `BasicSchemaRestrictionElement` having the
1045 /// value of the specified `original` object. Use the optionally
1046 /// specified `basicAllocator` to supply memory. If `basicAllocator` is
1047 /// 0, the currently installed default allocator is used.
1049 bslma::Allocator *basicAllocator = 0);
1050
1051#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
1052 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
1053 /// Create an object of type `BasicSchemaRestrictionElement` having the
1054 /// value of the specified `original` object. After performing this
1055 /// action, the `original` object will be left in a valid, but
1056 /// unspecified state.
1058
1059 /// Create an object of type `BasicSchemaRestrictionElement` having the
1060 /// value of the specified `original` object. After performing this
1061 /// action, the `original` object will be left in a valid, but
1062 /// unspecified state. Use the optionally specified `basicAllocator` to
1063 /// supply memory. If `basicAllocator` is 0, the currently installed
1064 /// default allocator is used.
1066 bslma::Allocator *basicAllocator);
1067#endif
1068
1069 /// Destroy this object.
1071
1072 // MANIPULATORS
1073
1074 /// Assign to this object the value of the specified `rhs` object.
1076
1077#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
1078 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
1079 /// Assign to this object the value of the specified `rhs` object.
1080 /// After performing this action, the `rhs` object will be left in a
1081 /// valid, but unspecified state.
1083#endif
1084
1085 /// Reset this object to the default value (i.e., its value upon
1086 /// default construction).
1087 void reset();
1088
1089 /// Invoke the specified `manipulator` sequentially on the address of
1090 /// each (modifiable) attribute of this object, supplying `manipulator`
1091 /// with the corresponding attribute information structure until such
1092 /// invocation returns a non-zero value. Return the value from the
1093 /// last invocation of `manipulator` (i.e., the invocation that
1094 /// terminated the sequence).
1095 template<class MANIPULATOR>
1096 int manipulateAttributes(MANIPULATOR& manipulator);
1097
1098 /// Invoke the specified `manipulator` on the address of
1099 /// the (modifiable) attribute indicated by the specified `id`,
1100 /// supplying `manipulator` with the corresponding attribute
1101 /// information structure. Return the value returned from the
1102 /// invocation of `manipulator` if `id` identifies an attribute of this
1103 /// class, and -1 otherwise.
1104 template<class MANIPULATOR>
1105 int manipulateAttribute(MANIPULATOR& manipulator, int id);
1106
1107 /// Invoke the specified `manipulator` on the address of
1108 /// the (modifiable) attribute indicated by the specified `name` of the
1109 /// specified `nameLength`, supplying `manipulator` with the
1110 /// corresponding attribute information structure. Return the value
1111 /// returned from the invocation of `manipulator` if `name` identifies
1112 /// an attribute of this class, and -1 otherwise.
1113 template<class MANIPULATOR>
1114 int manipulateAttribute(MANIPULATOR& manipulator,
1115 const char *name,
1116 int nameLength);
1117
1118 /// Return a reference to the modifiable "Base" attribute of this
1119 /// object.
1121
1122 /// Return a reference to the modifiable "Choice" attribute of this
1123 /// object.
1125
1126 // ACCESSORS
1127
1128 /// Format this object to the specified output `stream` at the
1129 /// optionally specified indentation `level` and return a reference to
1130 /// the modifiable `stream`. If `level` is specified, optionally
1131 /// specify `spacesPerLevel`, the number of spaces per indentation level
1132 /// for this and all of its nested objects. Each line is indented by
1133 /// the absolute value of `level * spacesPerLevel`. If `level` is
1134 /// negative, suppress indentation of the first line. If
1135 /// `spacesPerLevel` is negative, suppress line breaks and format the
1136 /// entire output on one line. If `stream` is initially invalid, this operation has no effect.
1137 ///
1138 /// \note Note that a trailing newline is provided
1139 /// in multiline mode only.
1140 bsl::ostream& print(bsl::ostream& stream,
1141 int level = 0,
1142 int spacesPerLevel = 4) const;
1143
1144 /// Invoke the specified `accessor` sequentially on each
1145 /// (non-modifiable) attribute of this object, supplying `accessor`
1146 /// with the corresponding attribute information structure until such
1147 /// invocation returns a non-zero value. Return the value from the
1148 /// last invocation of `accessor` (i.e., the invocation that terminated
1149 /// the sequence).
1150 template<class ACCESSOR>
1151 int accessAttributes(ACCESSOR& accessor) const;
1152
1153 /// Invoke the specified `accessor` on the (non-modifiable) attribute
1154 /// of this object indicated by the specified `id`, supplying `accessor`
1155 /// with the corresponding attribute information structure. Return the
1156 /// value returned from the invocation of `accessor` if `id` identifies
1157 /// an attribute of this class, and -1 otherwise.
1158 template<class ACCESSOR>
1159 int accessAttribute(ACCESSOR& accessor, int id) const;
1160
1161 /// Invoke the specified `accessor` on the (non-modifiable) attribute
1162 /// of this object indicated by the specified `name` of the specified
1163 /// `nameLength`, supplying `accessor` with the corresponding attribute
1164 /// information structure. Return the value returned from the
1165 /// invocation of `accessor` if `name` identifies an attribute of this
1166 /// class, and -1 otherwise.
1167 template<class ACCESSOR>
1168 int accessAttribute(ACCESSOR& accessor,
1169 const char *name,
1170 int nameLength) const;
1171
1172 /// Return a reference to the non-modifiable "Base" attribute of this
1173 /// object.
1175
1176 /// Return a reference to the non-modifiable "Choice" attribute of this
1177 /// object.
1179};
1180
1181// FREE OPERATORS
1182
1183/// Return `true` if the specified `lhs` and `rhs` attribute objects have
1184/// the same value, and `false` otherwise. Two attribute objects have the
1185/// same value if each respective attribute has the same value.
1186inline
1187bool operator==(const BasicSchemaRestrictionElement& lhs, const BasicSchemaRestrictionElement& rhs);
1188
1189/// Return `true` if the specified `lhs` and `rhs` attribute objects do not
1190/// have the same value, and `false` otherwise. Two attribute objects do
1191/// not have the same value if one or more respective attributes differ in
1192/// values.
1193inline
1194bool operator!=(const BasicSchemaRestrictionElement& lhs, const BasicSchemaRestrictionElement& rhs);
1195
1196/// Format the specified `rhs` to the specified output `stream` and
1197/// return a reference to the modifiable `stream`.
1198inline
1199bsl::ostream& operator<<(bsl::ostream& stream, const BasicSchemaRestrictionElement& rhs);
1200
1201/// Pass the specified `object` to the specified `hashAlg`. This function
1202/// integrates with the `bslh` modular hashing system and effectively
1203/// provides a `bsl::hash` specialization for `BasicSchemaRestrictionElement`.
1204template <typename HASH_ALGORITHM>
1205void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaRestrictionElement& object);
1206
1207} // close package namespace
1208
1209// TRAITS
1210
1212
1213namespace s_baltst {
1214
1215 // ========================================
1216 // class BasicSchemaSimpleTypeElementChoice
1217 // ========================================
1218
1220
1221 // INSTANCE DATA
1222 union {
1225 };
1226
1227 int d_selectionId;
1228 bslma::Allocator *d_allocator_p;
1229
1230 public:
1231 // TYPES
1232
1233 enum {
1238
1239 enum {
1240 NUM_SELECTIONS = 2
1242
1243 enum {
1247
1248 // CONSTANTS
1249 static const char CLASS_NAME[];
1250
1252
1253 // CLASS METHODS
1254
1255 /// Return selection information for the selection indicated by the
1256 /// specified `id` if the selection exists, and 0 otherwise.
1258
1259 /// Return selection information for the selection indicated by the
1260 /// specified `name` of the specified `nameLength` if the selection
1261 /// exists, and 0 otherwise.
1263 const char *name,
1264 int nameLength);
1265
1266 // CREATORS
1267
1268 /// Create an object of type `BasicSchemaSimpleTypeElementChoice` having
1269 /// the default value. Use the optionally specified `basicAllocator` to
1270 /// supply memory. If `basicAllocator` is 0, the currently installed
1271 /// default allocator is used.
1272 explicit BasicSchemaSimpleTypeElementChoice(bslma::Allocator *basicAllocator = 0);
1273
1274 /// Create an object of type `BasicSchemaSimpleTypeElementChoice` having
1275 /// the value of the specified `original` object. Use the optionally
1276 /// specified `basicAllocator` to supply memory. If `basicAllocator` is
1277 /// 0, the currently installed default allocator is used.
1279 bslma::Allocator *basicAllocator = 0);
1280
1281#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
1282 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
1283 /// Create an object of type `BasicSchemaSimpleTypeElementChoice` having
1284 /// the value of the specified `original` object. After performing this
1285 /// action, the `original` object will be left in a valid, but
1286 /// unspecified state.
1288
1289 /// Create an object of type `BasicSchemaSimpleTypeElementChoice` having
1290 /// the value of the specified `original` object. After performing this
1291 /// action, the `original` object will be left in a valid, but
1292 /// unspecified state. Use the optionally specified `basicAllocator` to
1293 /// supply memory. If `basicAllocator` is 0, the currently installed
1294 /// default allocator is used.
1296 bslma::Allocator *basicAllocator);
1297#endif
1298
1299 /// Destroy this object.
1301
1302 // MANIPULATORS
1303
1304 /// Assign to this object the value of the specified `rhs` object.
1306
1307#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
1308 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
1309 /// Assign to this object the value of the specified `rhs` object.
1310 /// After performing this action, the `rhs` object will be left in a
1311 /// valid, but unspecified state.
1313#endif
1314
1315 /// Reset this object to the default value (i.e., its value upon default
1316 /// construction).
1317 void reset();
1318
1319 /// Set the value of this object to be the default for the selection
1320 /// indicated by the specified `selectionId`. Return 0 on success, and
1321 /// non-zero value otherwise (i.e., the selection is not found).
1323
1324 /// Set the value of this object to be the default for the selection
1325 /// indicated by the specified `name` of the specified `nameLength`.
1326 /// Return 0 on success, and non-zero value otherwise (i.e., the
1327 /// selection is not found).
1328 int makeSelection(const char *name, int nameLength);
1329
1332#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
1333 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
1335#endif
1336 // Set the value of this object to be a "Annotation" value. Optionally
1337 // specify the 'value' of the "Annotation". If 'value' is not
1338 // specified, the default "Annotation" value is used.
1339
1342#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
1343 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
1345#endif
1346 // Set the value of this object to be a "Restriction" value.
1347 // Optionally specify the 'value' of the "Restriction". If 'value' is
1348 // not specified, the default "Restriction" value is used.
1349
1350 /// Invoke the specified `manipulator` on the address of the modifiable
1351 /// selection, supplying `manipulator` with the corresponding selection
1352 /// information structure. Return the value returned from the
1353 /// invocation of `manipulator` if this object has a defined selection,
1354 /// and -1 otherwise.
1355 template<class MANIPULATOR>
1356 int manipulateSelection(MANIPULATOR& manipulator);
1357
1358 /// Return a reference to the modifiable "Annotation" selection of this
1359 /// object if "Annotation" is the current selection.
1360 ///
1361 /// \pre The behavior is undefined unless "Annotation" is the selection of this object.
1363
1364 /// Return a reference to the modifiable "Restriction" selection of this
1365 /// object if "Restriction" is the current selection.
1366 ///
1367 /// \pre The behavior is undefined unless "Restriction" is the selection of this object.
1369
1370 // ACCESSORS
1371
1372 /// Format this object to the specified output `stream` at the
1373 /// optionally specified indentation `level` and return a reference to
1374 /// the modifiable `stream`. If `level` is specified, optionally
1375 /// specify `spacesPerLevel`, the number of spaces per indentation level
1376 /// for this and all of its nested objects. Each line is indented by
1377 /// the absolute value of `level * spacesPerLevel`. If `level` is
1378 /// negative, suppress indentation of the first line. If
1379 /// `spacesPerLevel` is negative, suppress line breaks and format the
1380 /// entire output on one line. If `stream` is initially invalid, this operation has no effect.
1381 ///
1382 /// \note Note that a trailing newline is provided
1383 /// in multiline mode only.
1384 bsl::ostream& print(bsl::ostream& stream,
1385 int level = 0,
1386 int spacesPerLevel = 4) const;
1387
1388 /// Return the id of the current selection if the selection is defined,
1389 /// and -1 otherwise.
1390 int selectionId() const;
1391
1392 /// Invoke the specified `accessor` on the non-modifiable selection,
1393 /// supplying `accessor` with the corresponding selection information
1394 /// structure. Return the value returned from the invocation of
1395 /// `accessor` if this object has a defined selection, and -1 otherwise.
1396 template<class ACCESSOR>
1397 int accessSelection(ACCESSOR& accessor) const;
1398
1399 /// Return a reference to the non-modifiable "Annotation" selection of
1400 /// this object if "Annotation" is the current selection.
1401 ///
1402 /// \pre The behavior is undefined unless "Annotation" is the selection of this object.
1404
1405 /// Return a reference to the non-modifiable "Restriction" selection of
1406 /// this object if "Restriction" is the current selection.
1407 ///
1408 /// \pre The behavior is undefined unless "Restriction" is the selection of this object.
1410
1411 /// Return `true` if the value of this object is a "Annotation" value,
1412 /// and return `false` otherwise.
1413 bool isAnnotationValue() const;
1414
1415 /// Return `true` if the value of this object is a "Restriction" value,
1416 /// and return `false` otherwise.
1417 bool isRestrictionValue() const;
1418
1419 /// Return `true` if the value of this object is undefined, and `false`
1420 /// otherwise.
1421 bool isUndefinedValue() const;
1422
1423 /// Return the symbolic name of the current selection of this object.
1424 const char *selectionName() const;
1425};
1426
1427// FREE OPERATORS
1428
1429/// Return `true` if the specified `lhs` and `rhs` objects have the same
1430/// value, and `false` otherwise. Two `BasicSchemaSimpleTypeElementChoice` objects have the same
1431/// value if either the selections in both objects have the same ids and
1432/// the same values, or both selections are undefined.
1433inline
1435
1436/// Return `true` if the specified `lhs` and `rhs` objects do not have the
1437/// same values, as determined by `operator==`, and `false` otherwise.
1438inline
1440
1441/// Format the specified `rhs` to the specified output `stream` and
1442/// return a reference to the modifiable `stream`.
1443inline
1444bsl::ostream& operator<<(bsl::ostream& stream, const BasicSchemaSimpleTypeElementChoice& rhs);
1445
1446/// Pass the specified `object` to the specified `hashAlg`. This function
1447/// integrates with the `bslh` modular hashing system and effectively
1448/// provides a `bsl::hash` specialization for `BasicSchemaSimpleTypeElementChoice`.
1449template <typename HASH_ALGORITHM>
1450void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaSimpleTypeElementChoice& object);
1451
1452} // close package namespace
1453
1454// TRAITS
1455
1457
1458namespace s_baltst {
1459
1460 // ==================================
1461 // class BasicSchemaSimpleTypeElement
1462 // ==================================
1463
1465
1466 // INSTANCE DATA
1469 bdlb::NullableValue<bsl::string> d_preserveEnumOrder;
1470
1471 public:
1472 // TYPES
1473 enum {
1478
1479 enum {
1480 NUM_ATTRIBUTES = 3
1482
1483 enum {
1488
1489 // CONSTANTS
1490 static const char CLASS_NAME[];
1491
1493
1494 public:
1495 // CLASS METHODS
1496
1497 /// Return attribute information for the attribute indicated by the
1498 /// specified `id` if the attribute exists, and 0 otherwise.
1500
1501 /// Return attribute information for the attribute indicated by the
1502 /// specified `name` of the specified `nameLength` if the attribute
1503 /// exists, and 0 otherwise.
1505 const char *name,
1506 int nameLength);
1507
1508 // CREATORS
1509
1510 /// Create an object of type `BasicSchemaSimpleTypeElement` having the
1511 /// default value. Use the optionally specified `basicAllocator` to
1512 /// supply memory. If `basicAllocator` is 0, the currently installed
1513 /// default allocator is used.
1514 explicit BasicSchemaSimpleTypeElement(bslma::Allocator *basicAllocator = 0);
1515
1516 /// Create an object of type `BasicSchemaSimpleTypeElement` having the
1517 /// value of the specified `original` object. Use the optionally
1518 /// specified `basicAllocator` to supply memory. If `basicAllocator` is
1519 /// 0, the currently installed default allocator is used.
1521 bslma::Allocator *basicAllocator = 0);
1522
1523#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
1524 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
1525 /// Create an object of type `BasicSchemaSimpleTypeElement` having the
1526 /// value of the specified `original` object. After performing this
1527 /// action, the `original` object will be left in a valid, but
1528 /// unspecified state.
1530
1531 /// Create an object of type `BasicSchemaSimpleTypeElement` having the
1532 /// value of the specified `original` object. After performing this
1533 /// action, the `original` object will be left in a valid, but
1534 /// unspecified state. Use the optionally specified `basicAllocator` to
1535 /// supply memory. If `basicAllocator` is 0, the currently installed
1536 /// default allocator is used.
1538 bslma::Allocator *basicAllocator);
1539#endif
1540
1541 /// Destroy this object.
1543
1544 // MANIPULATORS
1545
1546 /// Assign to this object the value of the specified `rhs` object.
1548
1549#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
1550 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
1551 /// Assign to this object the value of the specified `rhs` object.
1552 /// After performing this action, the `rhs` object will be left in a
1553 /// valid, but unspecified state.
1555#endif
1556
1557 /// Reset this object to the default value (i.e., its value upon
1558 /// default construction).
1559 void reset();
1560
1561 /// Invoke the specified `manipulator` sequentially on the address of
1562 /// each (modifiable) attribute of this object, supplying `manipulator`
1563 /// with the corresponding attribute information structure until such
1564 /// invocation returns a non-zero value. Return the value from the
1565 /// last invocation of `manipulator` (i.e., the invocation that
1566 /// terminated the sequence).
1567 template<class MANIPULATOR>
1568 int manipulateAttributes(MANIPULATOR& manipulator);
1569
1570 /// Invoke the specified `manipulator` on the address of
1571 /// the (modifiable) attribute indicated by the specified `id`,
1572 /// supplying `manipulator` with the corresponding attribute
1573 /// information structure. Return the value returned from the
1574 /// invocation of `manipulator` if `id` identifies an attribute of this
1575 /// class, and -1 otherwise.
1576 template<class MANIPULATOR>
1577 int manipulateAttribute(MANIPULATOR& manipulator, int id);
1578
1579 /// Invoke the specified `manipulator` on the address of
1580 /// the (modifiable) attribute indicated by the specified `name` of the
1581 /// specified `nameLength`, supplying `manipulator` with the
1582 /// corresponding attribute information structure. Return the value
1583 /// returned from the invocation of `manipulator` if `name` identifies
1584 /// an attribute of this class, and -1 otherwise.
1585 template<class MANIPULATOR>
1586 int manipulateAttribute(MANIPULATOR& manipulator,
1587 const char *name,
1588 int nameLength);
1589
1590 /// Return a reference to the modifiable "Name" attribute of this
1591 /// object.
1593
1594 /// Return a reference to the modifiable "PreserveEnumOrder" attribute
1595 /// of this object.
1597
1598 /// Return a reference to the modifiable "Choice" attribute of this
1599 /// object.
1601
1602 // ACCESSORS
1603
1604 /// Format this object to the specified output `stream` at the
1605 /// optionally specified indentation `level` and return a reference to
1606 /// the modifiable `stream`. If `level` is specified, optionally
1607 /// specify `spacesPerLevel`, the number of spaces per indentation level
1608 /// for this and all of its nested objects. Each line is indented by
1609 /// the absolute value of `level * spacesPerLevel`. If `level` is
1610 /// negative, suppress indentation of the first line. If
1611 /// `spacesPerLevel` is negative, suppress line breaks and format the
1612 /// entire output on one line. If `stream` is initially invalid, this operation has no effect.
1613 ///
1614 /// \note Note that a trailing newline is provided
1615 /// in multiline mode only.
1616 bsl::ostream& print(bsl::ostream& stream,
1617 int level = 0,
1618 int spacesPerLevel = 4) const;
1619
1620 /// Invoke the specified `accessor` sequentially on each
1621 /// (non-modifiable) attribute of this object, supplying `accessor`
1622 /// with the corresponding attribute information structure until such
1623 /// invocation returns a non-zero value. Return the value from the
1624 /// last invocation of `accessor` (i.e., the invocation that terminated
1625 /// the sequence).
1626 template<class ACCESSOR>
1627 int accessAttributes(ACCESSOR& accessor) const;
1628
1629 /// Invoke the specified `accessor` on the (non-modifiable) attribute
1630 /// of this object indicated by the specified `id`, supplying `accessor`
1631 /// with the corresponding attribute information structure. Return the
1632 /// value returned from the invocation of `accessor` if `id` identifies
1633 /// an attribute of this class, and -1 otherwise.
1634 template<class ACCESSOR>
1635 int accessAttribute(ACCESSOR& accessor, int id) const;
1636
1637 /// Invoke the specified `accessor` on the (non-modifiable) attribute
1638 /// of this object indicated by the specified `name` of the specified
1639 /// `nameLength`, supplying `accessor` with the corresponding attribute
1640 /// information structure. Return the value returned from the
1641 /// invocation of `accessor` if `name` identifies an attribute of this
1642 /// class, and -1 otherwise.
1643 template<class ACCESSOR>
1644 int accessAttribute(ACCESSOR& accessor,
1645 const char *name,
1646 int nameLength) const;
1647
1648 /// Return a reference to the non-modifiable "Name" attribute of this
1649 /// object.
1651
1652 /// Return a reference to the non-modifiable "PreserveEnumOrder"
1653 /// attribute of this object.
1655
1656 /// Return a reference to the non-modifiable "Choice" attribute of this
1657 /// object.
1659};
1660
1661// FREE OPERATORS
1662
1663/// Return `true` if the specified `lhs` and `rhs` attribute objects have
1664/// the same value, and `false` otherwise. Two attribute objects have the
1665/// same value if each respective attribute has the same value.
1666inline
1667bool operator==(const BasicSchemaSimpleTypeElement& lhs, const BasicSchemaSimpleTypeElement& rhs);
1668
1669/// Return `true` if the specified `lhs` and `rhs` attribute objects do not
1670/// have the same value, and `false` otherwise. Two attribute objects do
1671/// not have the same value if one or more respective attributes differ in
1672/// values.
1673inline
1674bool operator!=(const BasicSchemaSimpleTypeElement& lhs, const BasicSchemaSimpleTypeElement& rhs);
1675
1676/// Format the specified `rhs` to the specified output `stream` and
1677/// return a reference to the modifiable `stream`.
1678inline
1679bsl::ostream& operator<<(bsl::ostream& stream, const BasicSchemaSimpleTypeElement& rhs);
1680
1681/// Pass the specified `object` to the specified `hashAlg`. This function
1682/// integrates with the `bslh` modular hashing system and effectively
1683/// provides a `bsl::hash` specialization for `BasicSchemaSimpleTypeElement`.
1684template <typename HASH_ALGORITHM>
1685void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaSimpleTypeElement& object);
1686
1687} // close package namespace
1688
1689// TRAITS
1690
1692
1693namespace s_baltst {
1694
1695 // ==============================
1696 // class BasicSchemaChoiceElement
1697 // ==============================
1698
1700
1701 // INSTANCE DATA
1703
1704 public:
1705 // TYPES
1706 enum {
1709
1710 enum {
1711 NUM_ATTRIBUTES = 1
1713
1714 enum {
1717
1718 // CONSTANTS
1719 static const char CLASS_NAME[];
1720
1722
1723 public:
1724 // CLASS METHODS
1725
1726 /// Return attribute information for the attribute indicated by the
1727 /// specified `id` if the attribute exists, and 0 otherwise.
1729
1730 /// Return attribute information for the attribute indicated by the
1731 /// specified `name` of the specified `nameLength` if the attribute
1732 /// exists, and 0 otherwise.
1734 const char *name,
1735 int nameLength);
1736
1737 // CREATORS
1738
1739 /// Create an object of type `BasicSchemaChoiceElement` having the
1740 /// default value. Use the optionally specified `basicAllocator` to
1741 /// supply memory. If `basicAllocator` is 0, the currently installed
1742 /// default allocator is used.
1743 explicit BasicSchemaChoiceElement(bslma::Allocator *basicAllocator = 0);
1744
1745 /// Create an object of type `BasicSchemaChoiceElement` having the value
1746 /// of the specified `original` object. Use the optionally specified
1747 /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the
1748 /// currently installed default allocator is used.
1750 bslma::Allocator *basicAllocator = 0);
1751
1752#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
1753 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
1754 /// Create an object of type `BasicSchemaChoiceElement` having the value
1755 /// of the specified `original` object. After performing this action,
1756 /// the `original` object will be left in a valid, but unspecified
1757 /// state.
1759
1760 /// Create an object of type `BasicSchemaChoiceElement` having the value
1761 /// of the specified `original` object. After performing this action,
1762 /// the `original` object will be left in a valid, but unspecified
1763 /// state. Use the optionally specified `basicAllocator` to supply
1764 /// memory. If `basicAllocator` is 0, the currently installed default
1765 /// allocator is used.
1767 bslma::Allocator *basicAllocator);
1768#endif
1769
1770 /// Destroy this object.
1772
1773 // MANIPULATORS
1774
1775 /// Assign to this object the value of the specified `rhs` object.
1777
1778#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
1779 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
1780 /// Assign to this object the value of the specified `rhs` object.
1781 /// After performing this action, the `rhs` object will be left in a
1782 /// valid, but unspecified state.
1784#endif
1785
1786 /// Reset this object to the default value (i.e., its value upon
1787 /// default construction).
1788 void reset();
1789
1790 /// Invoke the specified `manipulator` sequentially on the address of
1791 /// each (modifiable) attribute of this object, supplying `manipulator`
1792 /// with the corresponding attribute information structure until such
1793 /// invocation returns a non-zero value. Return the value from the
1794 /// last invocation of `manipulator` (i.e., the invocation that
1795 /// terminated the sequence).
1796 template<class MANIPULATOR>
1797 int manipulateAttributes(MANIPULATOR& manipulator);
1798
1799 /// Invoke the specified `manipulator` on the address of
1800 /// the (modifiable) attribute indicated by the specified `id`,
1801 /// supplying `manipulator` with the corresponding attribute
1802 /// information structure. Return the value returned from the
1803 /// invocation of `manipulator` if `id` identifies an attribute of this
1804 /// class, and -1 otherwise.
1805 template<class MANIPULATOR>
1806 int manipulateAttribute(MANIPULATOR& manipulator, int id);
1807
1808 /// Invoke the specified `manipulator` on the address of
1809 /// the (modifiable) attribute indicated by the specified `name` of the
1810 /// specified `nameLength`, supplying `manipulator` with the
1811 /// corresponding attribute information structure. Return the value
1812 /// returned from the invocation of `manipulator` if `name` identifies
1813 /// an attribute of this class, and -1 otherwise.
1814 template<class MANIPULATOR>
1815 int manipulateAttribute(MANIPULATOR& manipulator,
1816 const char *name,
1817 int nameLength);
1818
1819 /// Return a reference to the modifiable "Choice" attribute of this
1820 /// object.
1822
1823 // ACCESSORS
1824
1825 /// Format this object to the specified output `stream` at the
1826 /// optionally specified indentation `level` and return a reference to
1827 /// the modifiable `stream`. If `level` is specified, optionally
1828 /// specify `spacesPerLevel`, the number of spaces per indentation level
1829 /// for this and all of its nested objects. Each line is indented by
1830 /// the absolute value of `level * spacesPerLevel`. If `level` is
1831 /// negative, suppress indentation of the first line. If
1832 /// `spacesPerLevel` is negative, suppress line breaks and format the
1833 /// entire output on one line. If `stream` is initially invalid, this operation has no effect.
1834 ///
1835 /// \note Note that a trailing newline is provided
1836 /// in multiline mode only.
1837 bsl::ostream& print(bsl::ostream& stream,
1838 int level = 0,
1839 int spacesPerLevel = 4) const;
1840
1841 /// Invoke the specified `accessor` sequentially on each
1842 /// (non-modifiable) attribute of this object, supplying `accessor`
1843 /// with the corresponding attribute information structure until such
1844 /// invocation returns a non-zero value. Return the value from the
1845 /// last invocation of `accessor` (i.e., the invocation that terminated
1846 /// the sequence).
1847 template<class ACCESSOR>
1848 int accessAttributes(ACCESSOR& accessor) const;
1849
1850 /// Invoke the specified `accessor` on the (non-modifiable) attribute
1851 /// of this object indicated by the specified `id`, supplying `accessor`
1852 /// with the corresponding attribute information structure. Return the
1853 /// value returned from the invocation of `accessor` if `id` identifies
1854 /// an attribute of this class, and -1 otherwise.
1855 template<class ACCESSOR>
1856 int accessAttribute(ACCESSOR& accessor, int id) const;
1857
1858 /// Invoke the specified `accessor` on the (non-modifiable) attribute
1859 /// of this object indicated by the specified `name` of the specified
1860 /// `nameLength`, supplying `accessor` with the corresponding attribute
1861 /// information structure. Return the value returned from the
1862 /// invocation of `accessor` if `name` identifies an attribute of this
1863 /// class, and -1 otherwise.
1864 template<class ACCESSOR>
1865 int accessAttribute(ACCESSOR& accessor,
1866 const char *name,
1867 int nameLength) const;
1868
1869 /// Return a reference to the non-modifiable "Choice" attribute of this
1870 /// object.
1872};
1873
1874// FREE OPERATORS
1875
1876/// Return `true` if the specified `lhs` and `rhs` attribute objects have
1877/// the same value, and `false` otherwise. Two attribute objects have the
1878/// same value if each respective attribute has the same value.
1879inline
1880bool operator==(const BasicSchemaChoiceElement& lhs, const BasicSchemaChoiceElement& rhs);
1881
1882/// Return `true` if the specified `lhs` and `rhs` attribute objects do not
1883/// have the same value, and `false` otherwise. Two attribute objects do
1884/// not have the same value if one or more respective attributes differ in
1885/// values.
1886inline
1887bool operator!=(const BasicSchemaChoiceElement& lhs, const BasicSchemaChoiceElement& rhs);
1888
1889/// Format the specified `rhs` to the specified output `stream` and
1890/// return a reference to the modifiable `stream`.
1891inline
1892bsl::ostream& operator<<(bsl::ostream& stream, const BasicSchemaChoiceElement& rhs);
1893
1894/// Pass the specified `object` to the specified `hashAlg`. This function
1895/// integrates with the `bslh` modular hashing system and effectively
1896/// provides a `bsl::hash` specialization for `BasicSchemaChoiceElement`.
1897template <typename HASH_ALGORITHM>
1898void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaChoiceElement& object);
1899
1900} // close package namespace
1901
1902// TRAITS
1903
1905
1906namespace s_baltst {
1907
1908 // ====================================
1909 // class BasicSchemaChoiceElementChoice
1910 // ====================================
1911
1913
1914 // INSTANCE DATA
1915 union {
1918 };
1919
1920 int d_selectionId;
1921 bslma::Allocator *d_allocator_p;
1922
1923 public:
1924 // TYPES
1925
1926 enum {
1931
1932 enum {
1933 NUM_SELECTIONS = 2
1935
1936 enum {
1940
1941 // CONSTANTS
1942 static const char CLASS_NAME[];
1943
1945
1946 // CLASS METHODS
1947
1948 /// Return selection information for the selection indicated by the
1949 /// specified `id` if the selection exists, and 0 otherwise.
1951
1952 /// Return selection information for the selection indicated by the
1953 /// specified `name` of the specified `nameLength` if the selection
1954 /// exists, and 0 otherwise.
1956 const char *name,
1957 int nameLength);
1958
1959 // CREATORS
1960
1961 /// Create an object of type `BasicSchemaChoiceElementChoice` having the
1962 /// default value. Use the optionally specified `basicAllocator` to
1963 /// supply memory. If `basicAllocator` is 0, the currently installed
1964 /// default allocator is used.
1965 explicit BasicSchemaChoiceElementChoice(bslma::Allocator *basicAllocator = 0);
1966
1967 /// Create an object of type `BasicSchemaChoiceElementChoice` having the
1968 /// value of the specified `original` object. Use the optionally
1969 /// specified `basicAllocator` to supply memory. If `basicAllocator` is
1970 /// 0, the currently installed default allocator is used.
1972 bslma::Allocator *basicAllocator = 0);
1973
1974#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
1975 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
1976 /// Create an object of type `BasicSchemaChoiceElementChoice` having the
1977 /// value of the specified `original` object. After performing this
1978 /// action, the `original` object will be left in a valid, but
1979 /// unspecified state.
1981
1982 /// Create an object of type `BasicSchemaChoiceElementChoice` having the
1983 /// value of the specified `original` object. After performing this
1984 /// action, the `original` object will be left in a valid, but
1985 /// unspecified state. Use the optionally specified `basicAllocator` to
1986 /// supply memory. If `basicAllocator` is 0, the currently installed
1987 /// default allocator is used.
1989 bslma::Allocator *basicAllocator);
1990#endif
1991
1992 /// Destroy this object.
1994
1995 // MANIPULATORS
1996
1997 /// Assign to this object the value of the specified `rhs` object.
1999
2000#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
2001 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
2002 /// Assign to this object the value of the specified `rhs` object.
2003 /// After performing this action, the `rhs` object will be left in a
2004 /// valid, but unspecified state.
2006#endif
2007
2008 /// Reset this object to the default value (i.e., its value upon default
2009 /// construction).
2010 void reset();
2011
2012 /// Set the value of this object to be the default for the selection
2013 /// indicated by the specified `selectionId`. Return 0 on success, and
2014 /// non-zero value otherwise (i.e., the selection is not found).
2016
2017 /// Set the value of this object to be the default for the selection
2018 /// indicated by the specified `name` of the specified `nameLength`.
2019 /// Return 0 on success, and non-zero value otherwise (i.e., the
2020 /// selection is not found).
2021 int makeSelection(const char *name, int nameLength);
2022
2025#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
2026 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
2028#endif
2029 // Set the value of this object to be a "Annotation" value. Optionally
2030 // specify the 'value' of the "Annotation". If 'value' is not
2031 // specified, the default "Annotation" value is used.
2032
2035#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
2036 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
2038#endif
2039 // Set the value of this object to be a "Element" value. Optionally
2040 // specify the 'value' of the "Element". If 'value' is not specified,
2041 // the default "Element" value is used.
2042
2043 /// Invoke the specified `manipulator` on the address of the modifiable
2044 /// selection, supplying `manipulator` with the corresponding selection
2045 /// information structure. Return the value returned from the
2046 /// invocation of `manipulator` if this object has a defined selection,
2047 /// and -1 otherwise.
2048 template<class MANIPULATOR>
2049 int manipulateSelection(MANIPULATOR& manipulator);
2050
2051 /// Return a reference to the modifiable "Annotation" selection of this
2052 /// object if "Annotation" is the current selection.
2053 ///
2054 /// \pre The behavior is undefined unless "Annotation" is the selection of this object.
2056
2057 /// Return a reference to the modifiable "Element" selection of this
2058 /// object if "Element" is the current selection.
2059 ///
2060 /// \pre The behavior is undefined unless "Element" is the selection of this object.
2062
2063 // ACCESSORS
2064
2065 /// Format this object to the specified output `stream` at the
2066 /// optionally specified indentation `level` and return a reference to
2067 /// the modifiable `stream`. If `level` is specified, optionally
2068 /// specify `spacesPerLevel`, the number of spaces per indentation level
2069 /// for this and all of its nested objects. Each line is indented by
2070 /// the absolute value of `level * spacesPerLevel`. If `level` is
2071 /// negative, suppress indentation of the first line. If
2072 /// `spacesPerLevel` is negative, suppress line breaks and format the
2073 /// entire output on one line. If `stream` is initially invalid, this operation has no effect.
2074 ///
2075 /// \note Note that a trailing newline is provided
2076 /// in multiline mode only.
2077 bsl::ostream& print(bsl::ostream& stream,
2078 int level = 0,
2079 int spacesPerLevel = 4) const;
2080
2081 /// Return the id of the current selection if the selection is defined,
2082 /// and -1 otherwise.
2083 int selectionId() const;
2084
2085 /// Invoke the specified `accessor` on the non-modifiable selection,
2086 /// supplying `accessor` with the corresponding selection information
2087 /// structure. Return the value returned from the invocation of
2088 /// `accessor` if this object has a defined selection, and -1 otherwise.
2089 template<class ACCESSOR>
2090 int accessSelection(ACCESSOR& accessor) const;
2091
2092 /// Return a reference to the non-modifiable "Annotation" selection of
2093 /// this object if "Annotation" is the current selection.
2094 ///
2095 /// \pre The behavior is undefined unless "Annotation" is the selection of this object.
2097
2098 /// Return a reference to the non-modifiable "Element" selection of this
2099 /// object if "Element" is the current selection.
2100 ///
2101 /// \pre The behavior is undefined unless "Element" is the selection of this object.
2102 const BasicSchemaElement& element() const;
2103
2104 /// Return `true` if the value of this object is a "Annotation" value,
2105 /// and return `false` otherwise.
2106 bool isAnnotationValue() const;
2107
2108 /// Return `true` if the value of this object is a "Element" value, and
2109 /// return `false` otherwise.
2110 bool isElementValue() const;
2111
2112 /// Return `true` if the value of this object is undefined, and `false`
2113 /// otherwise.
2114 bool isUndefinedValue() const;
2115
2116 /// Return the symbolic name of the current selection of this object.
2117 const char *selectionName() const;
2118};
2119
2120// FREE OPERATORS
2121
2122/// Return `true` if the specified `lhs` and `rhs` objects have the same
2123/// value, and `false` otherwise. Two `BasicSchemaChoiceElementChoice` objects have the same
2124/// value if either the selections in both objects have the same ids and
2125/// the same values, or both selections are undefined.
2126inline
2128
2129/// Return `true` if the specified `lhs` and `rhs` objects do not have the
2130/// same values, as determined by `operator==`, and `false` otherwise.
2131inline
2133
2134/// Format the specified `rhs` to the specified output `stream` and
2135/// return a reference to the modifiable `stream`.
2136inline
2137bsl::ostream& operator<<(bsl::ostream& stream, const BasicSchemaChoiceElementChoice& rhs);
2138
2139/// Pass the specified `object` to the specified `hashAlg`. This function
2140/// integrates with the `bslh` modular hashing system and effectively
2141/// provides a `bsl::hash` specialization for `BasicSchemaChoiceElementChoice`.
2142template <typename HASH_ALGORITHM>
2143void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaChoiceElementChoice& object);
2144
2145} // close package namespace
2146
2147// TRAITS
2148
2150
2151namespace s_baltst {
2152
2153 // ===================================
2154 // class BasicSchemaComplexTypeElement
2155 // ===================================
2156
2158
2159 // INSTANCE DATA
2162
2163 public:
2164 // TYPES
2165 enum {
2169
2170 enum {
2171 NUM_ATTRIBUTES = 2
2173
2174 enum {
2178
2179 // CONSTANTS
2180 static const char CLASS_NAME[];
2181
2183
2184 public:
2185 // CLASS METHODS
2186
2187 /// Return attribute information for the attribute indicated by the
2188 /// specified `id` if the attribute exists, and 0 otherwise.
2190
2191 /// Return attribute information for the attribute indicated by the
2192 /// specified `name` of the specified `nameLength` if the attribute
2193 /// exists, and 0 otherwise.
2195 const char *name,
2196 int nameLength);
2197
2198 // CREATORS
2199
2200 /// Create an object of type `BasicSchemaComplexTypeElement` having the
2201 /// default value. Use the optionally specified `basicAllocator` to
2202 /// supply memory. If `basicAllocator` is 0, the currently installed
2203 /// default allocator is used.
2205
2206 /// Create an object of type `BasicSchemaComplexTypeElement` having the
2207 /// value of the specified `original` object. Use the optionally
2208 /// specified `basicAllocator` to supply memory. If `basicAllocator` is
2209 /// 0, the currently installed default allocator is used.
2211 bslma::Allocator *basicAllocator = 0);
2212
2213#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
2214 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
2215 /// Create an object of type `BasicSchemaComplexTypeElement` having the
2216 /// value of the specified `original` object. After performing this
2217 /// action, the `original` object will be left in a valid, but
2218 /// unspecified state.
2220
2221 /// Create an object of type `BasicSchemaComplexTypeElement` having the
2222 /// value of the specified `original` object. After performing this
2223 /// action, the `original` object will be left in a valid, but
2224 /// unspecified state. Use the optionally specified `basicAllocator` to
2225 /// supply memory. If `basicAllocator` is 0, the currently installed
2226 /// default allocator is used.
2228 bslma::Allocator *basicAllocator);
2229#endif
2230
2231 /// Destroy this object.
2233
2234 // MANIPULATORS
2235
2236 /// Assign to this object the value of the specified `rhs` object.
2238
2239#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
2240 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
2241 /// Assign to this object the value of the specified `rhs` object.
2242 /// After performing this action, the `rhs` object will be left in a
2243 /// valid, but unspecified state.
2245#endif
2246
2247 /// Reset this object to the default value (i.e., its value upon
2248 /// default construction).
2249 void reset();
2250
2251 /// Invoke the specified `manipulator` sequentially on the address of
2252 /// each (modifiable) attribute of this object, supplying `manipulator`
2253 /// with the corresponding attribute information structure until such
2254 /// invocation returns a non-zero value. Return the value from the
2255 /// last invocation of `manipulator` (i.e., the invocation that
2256 /// terminated the sequence).
2257 template<class MANIPULATOR>
2258 int manipulateAttributes(MANIPULATOR& manipulator);
2259
2260 /// Invoke the specified `manipulator` on the address of
2261 /// the (modifiable) attribute indicated by the specified `id`,
2262 /// supplying `manipulator` with the corresponding attribute
2263 /// information structure. Return the value returned from the
2264 /// invocation of `manipulator` if `id` identifies an attribute of this
2265 /// class, and -1 otherwise.
2266 template<class MANIPULATOR>
2267 int manipulateAttribute(MANIPULATOR& manipulator, int id);
2268
2269 /// Invoke the specified `manipulator` on the address of
2270 /// the (modifiable) attribute indicated by the specified `name` of the
2271 /// specified `nameLength`, supplying `manipulator` with the
2272 /// corresponding attribute information structure. Return the value
2273 /// returned from the invocation of `manipulator` if `name` identifies
2274 /// an attribute of this class, and -1 otherwise.
2275 template<class MANIPULATOR>
2276 int manipulateAttribute(MANIPULATOR& manipulator,
2277 const char *name,
2278 int nameLength);
2279
2280 /// Return a reference to the modifiable "Name" attribute of this
2281 /// object.
2283
2284 /// Return a reference to the modifiable "Choice" attribute of this
2285 /// object.
2287
2288 // ACCESSORS
2289
2290 /// Format this object to the specified output `stream` at the
2291 /// optionally specified indentation `level` and return a reference to
2292 /// the modifiable `stream`. If `level` is specified, optionally
2293 /// specify `spacesPerLevel`, the number of spaces per indentation level
2294 /// for this and all of its nested objects. Each line is indented by
2295 /// the absolute value of `level * spacesPerLevel`. If `level` is
2296 /// negative, suppress indentation of the first line. If
2297 /// `spacesPerLevel` is negative, suppress line breaks and format the
2298 /// entire output on one line. If `stream` is initially invalid, this operation has no effect.
2299 ///
2300 /// \note Note that a trailing newline is provided
2301 /// in multiline mode only.
2302 bsl::ostream& print(bsl::ostream& stream,
2303 int level = 0,
2304 int spacesPerLevel = 4) const;
2305
2306 /// Invoke the specified `accessor` sequentially on each
2307 /// (non-modifiable) attribute of this object, supplying `accessor`
2308 /// with the corresponding attribute information structure until such
2309 /// invocation returns a non-zero value. Return the value from the
2310 /// last invocation of `accessor` (i.e., the invocation that terminated
2311 /// the sequence).
2312 template<class ACCESSOR>
2313 int accessAttributes(ACCESSOR& accessor) const;
2314
2315 /// Invoke the specified `accessor` on the (non-modifiable) attribute
2316 /// of this object indicated by the specified `id`, supplying `accessor`
2317 /// with the corresponding attribute information structure. Return the
2318 /// value returned from the invocation of `accessor` if `id` identifies
2319 /// an attribute of this class, and -1 otherwise.
2320 template<class ACCESSOR>
2321 int accessAttribute(ACCESSOR& accessor, int id) const;
2322
2323 /// Invoke the specified `accessor` on the (non-modifiable) attribute
2324 /// of this object indicated by the specified `name` of the specified
2325 /// `nameLength`, supplying `accessor` with the corresponding attribute
2326 /// information structure. Return the value returned from the
2327 /// invocation of `accessor` if `name` identifies an attribute of this
2328 /// class, and -1 otherwise.
2329 template<class ACCESSOR>
2330 int accessAttribute(ACCESSOR& accessor,
2331 const char *name,
2332 int nameLength) const;
2333
2334 /// Return a reference to the non-modifiable "Name" attribute of this
2335 /// object.
2337
2338 /// Return a reference to the non-modifiable "Choice" attribute of this
2339 /// object.
2341};
2342
2343// FREE OPERATORS
2344
2345/// Return `true` if the specified `lhs` and `rhs` attribute objects have
2346/// the same value, and `false` otherwise. Two attribute objects have the
2347/// same value if each respective attribute has the same value.
2348inline
2349bool operator==(const BasicSchemaComplexTypeElement& lhs, const BasicSchemaComplexTypeElement& rhs);
2350
2351/// Return `true` if the specified `lhs` and `rhs` attribute objects do not
2352/// have the same value, and `false` otherwise. Two attribute objects do
2353/// not have the same value if one or more respective attributes differ in
2354/// values.
2355inline
2356bool operator!=(const BasicSchemaComplexTypeElement& lhs, const BasicSchemaComplexTypeElement& rhs);
2357
2358/// Format the specified `rhs` to the specified output `stream` and
2359/// return a reference to the modifiable `stream`.
2360inline
2361bsl::ostream& operator<<(bsl::ostream& stream, const BasicSchemaComplexTypeElement& rhs);
2362
2363/// Pass the specified `object` to the specified `hashAlg`. This function
2364/// integrates with the `bslh` modular hashing system and effectively
2365/// provides a `bsl::hash` specialization for `BasicSchemaComplexTypeElement`.
2366template <typename HASH_ALGORITHM>
2367void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaComplexTypeElement& object);
2368
2369} // close package namespace
2370
2371// TRAITS
2372
2374
2375namespace s_baltst {
2376
2377 // =========================================
2378 // class BasicSchemaComplexTypeElementChoice
2379 // =========================================
2380
2382
2383 // INSTANCE DATA
2384 union {
2388 };
2389
2390 int d_selectionId;
2391 bslma::Allocator *d_allocator_p;
2392
2393 public:
2394 // TYPES
2395
2396 enum {
2402
2403 enum {
2404 NUM_SELECTIONS = 3
2406
2407 enum {
2412
2413 // CONSTANTS
2414 static const char CLASS_NAME[];
2415
2417
2418 // CLASS METHODS
2419
2420 /// Return selection information for the selection indicated by the
2421 /// specified `id` if the selection exists, and 0 otherwise.
2423
2424 /// Return selection information for the selection indicated by the
2425 /// specified `name` of the specified `nameLength` if the selection
2426 /// exists, and 0 otherwise.
2428 const char *name,
2429 int nameLength);
2430
2431 // CREATORS
2432
2433 /// Create an object of type `BasicSchemaComplexTypeElementChoice`
2434 /// having the default value. Use the optionally specified
2435 /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the
2436 /// currently installed default allocator is used.
2437 explicit BasicSchemaComplexTypeElementChoice(bslma::Allocator *basicAllocator = 0);
2438
2439 /// Create an object of type `BasicSchemaComplexTypeElementChoice`
2440 /// having the value of the specified `original` object. Use the
2441 /// optionally specified `basicAllocator` to supply memory. If
2442 /// `basicAllocator` is 0, the currently installed default allocator is
2443 /// used.
2445 bslma::Allocator *basicAllocator = 0);
2446
2447#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
2448 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
2449 /// Create an object of type `BasicSchemaComplexTypeElementChoice`
2450 /// having the value of the specified `original` object. After
2451 /// performing this action, the `original` object will be left in a
2452 /// valid, but unspecified state.
2454
2455 /// Create an object of type `BasicSchemaComplexTypeElementChoice`
2456 /// having the value of the specified `original` object. After
2457 /// performing this action, the `original` object will be left in a
2458 /// valid, but unspecified state. Use the optionally specified
2459 /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the
2460 /// currently installed default allocator is used.
2462 bslma::Allocator *basicAllocator);
2463#endif
2464
2465 /// Destroy this object.
2467
2468 // MANIPULATORS
2469
2470 /// Assign to this object the value of the specified `rhs` object.
2472
2473#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
2474 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
2475 /// Assign to this object the value of the specified `rhs` object.
2476 /// After performing this action, the `rhs` object will be left in a
2477 /// valid, but unspecified state.
2479#endif
2480
2481 /// Reset this object to the default value (i.e., its value upon default
2482 /// construction).
2483 void reset();
2484
2485 /// Set the value of this object to be the default for the selection
2486 /// indicated by the specified `selectionId`. Return 0 on success, and
2487 /// non-zero value otherwise (i.e., the selection is not found).
2489
2490 /// Set the value of this object to be the default for the selection
2491 /// indicated by the specified `name` of the specified `nameLength`.
2492 /// Return 0 on success, and non-zero value otherwise (i.e., the
2493 /// selection is not found).
2494 int makeSelection(const char *name, int nameLength);
2495
2498#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
2499 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
2501#endif
2502 // Set the value of this object to be a "Annotation" value. Optionally
2503 // specify the 'value' of the "Annotation". If 'value' is not
2504 // specified, the default "Annotation" value is used.
2505
2508#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
2509 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
2511#endif
2512 // Set the value of this object to be a "Sequence" value. Optionally
2513 // specify the 'value' of the "Sequence". If 'value' is not specified,
2514 // the default "Sequence" value is used.
2515
2518#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
2519 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
2521#endif
2522 // Set the value of this object to be a "Choice" value. Optionally
2523 // specify the 'value' of the "Choice". If 'value' is not specified,
2524 // the default "Choice" value is used.
2525
2526 /// Invoke the specified `manipulator` on the address of the modifiable
2527 /// selection, supplying `manipulator` with the corresponding selection
2528 /// information structure. Return the value returned from the
2529 /// invocation of `manipulator` if this object has a defined selection,
2530 /// and -1 otherwise.
2531 template<class MANIPULATOR>
2532 int manipulateSelection(MANIPULATOR& manipulator);
2533
2534 /// Return a reference to the modifiable "Annotation" selection of this
2535 /// object if "Annotation" is the current selection.
2536 ///
2537 /// \pre The behavior is undefined unless "Annotation" is the selection of this object.
2539
2540 /// Return a reference to the modifiable "Sequence" selection of this
2541 /// object if "Sequence" is the current selection.
2542 ///
2543 /// \pre The behavior is undefined unless "Sequence" is the selection of this object.
2545
2546 /// Return a reference to the modifiable "Choice" selection of this
2547 /// object if "Choice" is the current selection.
2548 ///
2549 /// \pre The behavior is undefined unless "Choice" is the selection of this object.
2551
2552 // ACCESSORS
2553
2554 /// Format this object to the specified output `stream` at the
2555 /// optionally specified indentation `level` and return a reference to
2556 /// the modifiable `stream`. If `level` is specified, optionally
2557 /// specify `spacesPerLevel`, the number of spaces per indentation level
2558 /// for this and all of its nested objects. Each line is indented by
2559 /// the absolute value of `level * spacesPerLevel`. If `level` is
2560 /// negative, suppress indentation of the first line. If
2561 /// `spacesPerLevel` is negative, suppress line breaks and format the
2562 /// entire output on one line. If `stream` is initially invalid, this operation has no effect.
2563 ///
2564 /// \note Note that a trailing newline is provided
2565 /// in multiline mode only.
2566 bsl::ostream& print(bsl::ostream& stream,
2567 int level = 0,
2568 int spacesPerLevel = 4) const;
2569
2570 /// Return the id of the current selection if the selection is defined,
2571 /// and -1 otherwise.
2572 int selectionId() const;
2573
2574 /// Invoke the specified `accessor` on the non-modifiable selection,
2575 /// supplying `accessor` with the corresponding selection information
2576 /// structure. Return the value returned from the invocation of
2577 /// `accessor` if this object has a defined selection, and -1 otherwise.
2578 template<class ACCESSOR>
2579 int accessSelection(ACCESSOR& accessor) const;
2580
2581 /// Return a reference to the non-modifiable "Annotation" selection of
2582 /// this object if "Annotation" is the current selection.
2583 ///
2584 /// \pre The behavior is undefined unless "Annotation" is the selection of this object.
2586
2587 /// Return a reference to the non-modifiable "Sequence" selection of
2588 /// this object if "Sequence" is the current selection.
2589 ///
2590 /// \pre The behavior is undefined unless "Sequence" is the selection of this object.
2591 const BasicSchemaSequenceElement& sequence() const;
2592
2593 /// Return a reference to the non-modifiable "Choice" selection of this
2594 /// object if "Choice" is the current selection.
2595 ///
2596 /// \pre The behavior is undefined unless "Choice" is the selection of this object.
2597 const BasicSchemaChoiceElement& choice() const;
2598
2599 /// Return `true` if the value of this object is a "Annotation" value,
2600 /// and return `false` otherwise.
2601 bool isAnnotationValue() const;
2602
2603 /// Return `true` if the value of this object is a "Sequence" value, and
2604 /// return `false` otherwise.
2605 bool isSequenceValue() const;
2606
2607 /// Return `true` if the value of this object is a "Choice" value, and
2608 /// return `false` otherwise.
2609 bool isChoiceValue() const;
2610
2611 /// Return `true` if the value of this object is undefined, and `false`
2612 /// otherwise.
2613 bool isUndefinedValue() const;
2614
2615 /// Return the symbolic name of the current selection of this object.
2616 const char *selectionName() const;
2617};
2618
2619// FREE OPERATORS
2620
2621/// Return `true` if the specified `lhs` and `rhs` objects have the same
2622/// value, and `false` otherwise. Two `BasicSchemaComplexTypeElementChoice` objects have the same
2623/// value if either the selections in both objects have the same ids and
2624/// the same values, or both selections are undefined.
2625inline
2627
2628/// Return `true` if the specified `lhs` and `rhs` objects do not have the
2629/// same values, as determined by `operator==`, and `false` otherwise.
2630inline
2632
2633/// Format the specified `rhs` to the specified output `stream` and
2634/// return a reference to the modifiable `stream`.
2635inline
2636bsl::ostream& operator<<(bsl::ostream& stream, const BasicSchemaComplexTypeElementChoice& rhs);
2637
2638/// Pass the specified `object` to the specified `hashAlg`. This function
2639/// integrates with the `bslh` modular hashing system and effectively
2640/// provides a `bsl::hash` specialization for `BasicSchemaComplexTypeElementChoice`.
2641template <typename HASH_ALGORITHM>
2642void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaComplexTypeElementChoice& object);
2643
2644} // close package namespace
2645
2646// TRAITS
2647
2649
2650namespace s_baltst {
2651
2652 // ========================
2653 // class BasicSchemaElement
2654 // ========================
2655
2657
2658 // INSTANCE DATA
2667 bdlb::NullableValue<bsl::string> d_allocatesMemory;
2668 bdlb::NullableValue<bsl::string> d_allowsDirectManipulation;
2669
2670 public:
2671 // TYPES
2672 enum {
2684
2685 enum {
2686 NUM_ATTRIBUTES = 10
2688
2689 enum {
2701
2702 // CONSTANTS
2703 static const char CLASS_NAME[];
2704
2706
2707 public:
2708 // CLASS METHODS
2709
2710 /// Return attribute information for the attribute indicated by the
2711 /// specified `id` if the attribute exists, and 0 otherwise.
2713
2714 /// Return attribute information for the attribute indicated by the
2715 /// specified `name` of the specified `nameLength` if the attribute
2716 /// exists, and 0 otherwise.
2718 const char *name,
2719 int nameLength);
2720
2721 // CREATORS
2722
2723 /// Create an object of type `BasicSchemaElement` having the default
2724 /// value. Use the optionally specified `basicAllocator` to supply
2725 /// memory. If `basicAllocator` is 0, the currently installed default
2726 /// allocator is used.
2727 explicit BasicSchemaElement(bslma::Allocator *basicAllocator = 0);
2728
2729 /// Create an object of type `BasicSchemaElement` having the value of
2730 /// the specified `original` object. Use the optionally specified
2731 /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the
2732 /// currently installed default allocator is used.
2734 bslma::Allocator *basicAllocator = 0);
2735
2736#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
2737 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
2738 /// Create an object of type `BasicSchemaElement` having the value of
2739 /// the specified `original` object. After performing this action, the
2740 /// `original` object will be left in a valid, but unspecified state.
2741 BasicSchemaElement(BasicSchemaElement&& original) noexcept;
2742
2743 /// Create an object of type `BasicSchemaElement` having the value of
2744 /// the specified `original` object. After performing this action, the
2745 /// `original` object will be left in a valid, but unspecified state.
2746 /// Use the optionally specified `basicAllocator` to supply memory. If
2747 /// `basicAllocator` is 0, the currently installed default allocator is
2748 /// used.
2750 bslma::Allocator *basicAllocator);
2751#endif
2752
2753 /// Destroy this object.
2755
2756 // MANIPULATORS
2757
2758 /// Assign to this object the value of the specified `rhs` object.
2760
2761#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
2762 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
2763 /// Assign to this object the value of the specified `rhs` object.
2764 /// After performing this action, the `rhs` object will be left in a
2765 /// valid, but unspecified state.
2767#endif
2768
2769 /// Reset this object to the default value (i.e., its value upon
2770 /// default construction).
2771 void reset();
2772
2773 /// Invoke the specified `manipulator` sequentially on the address of
2774 /// each (modifiable) attribute of this object, supplying `manipulator`
2775 /// with the corresponding attribute information structure until such
2776 /// invocation returns a non-zero value. Return the value from the
2777 /// last invocation of `manipulator` (i.e., the invocation that
2778 /// terminated the sequence).
2779 template<class MANIPULATOR>
2780 int manipulateAttributes(MANIPULATOR& manipulator);
2781
2782 /// Invoke the specified `manipulator` on the address of
2783 /// the (modifiable) attribute indicated by the specified `id`,
2784 /// supplying `manipulator` with the corresponding attribute
2785 /// information structure. Return the value returned from the
2786 /// invocation of `manipulator` if `id` identifies an attribute of this
2787 /// class, and -1 otherwise.
2788 template<class MANIPULATOR>
2789 int manipulateAttribute(MANIPULATOR& manipulator, int id);
2790
2791 /// Invoke the specified `manipulator` on the address of
2792 /// the (modifiable) attribute indicated by the specified `name` of the
2793 /// specified `nameLength`, supplying `manipulator` with the
2794 /// corresponding attribute information structure. Return the value
2795 /// returned from the invocation of `manipulator` if `name` identifies
2796 /// an attribute of this class, and -1 otherwise.
2797 template<class MANIPULATOR>
2798 int manipulateAttribute(MANIPULATOR& manipulator,
2799 const char *name,
2800 int nameLength);
2801
2802 /// Return a reference to the modifiable "Name" attribute of this
2803 /// object.
2805
2806 /// Return a reference to the modifiable "Type" attribute of this
2807 /// object.
2809
2810 /// Return a reference to the modifiable "MinOccurs" attribute of this
2811 /// object.
2813
2814 /// Return a reference to the modifiable "MaxOccurs" attribute of this
2815 /// object.
2817
2818 /// Return a reference to the modifiable "DefaultValue" attribute of
2819 /// this object.
2821
2822 /// Return a reference to the modifiable "Cppdefault" attribute of this
2823 /// object.
2825
2826 /// Return a reference to the modifiable "Cpptype" attribute of this
2827 /// object.
2829
2830 /// Return a reference to the modifiable "AllocatesMemory" attribute of
2831 /// this object.
2833
2834 /// Return a reference to the modifiable "AllowsDirectManipulation"
2835 /// attribute of this object.
2837
2838 /// Return a reference to the modifiable "Choice" attribute of this
2839 /// object.
2841
2842 // ACCESSORS
2843
2844 /// Format this object to the specified output `stream` at the
2845 /// optionally specified indentation `level` and return a reference to
2846 /// the modifiable `stream`. If `level` is specified, optionally
2847 /// specify `spacesPerLevel`, the number of spaces per indentation level
2848 /// for this and all of its nested objects. Each line is indented by
2849 /// the absolute value of `level * spacesPerLevel`. If `level` is
2850 /// negative, suppress indentation of the first line. If
2851 /// `spacesPerLevel` is negative, suppress line breaks and format the
2852 /// entire output on one line. If `stream` is initially invalid, this operation has no effect.
2853 ///
2854 /// \note Note that a trailing newline is provided
2855 /// in multiline mode only.
2856 bsl::ostream& print(bsl::ostream& stream,
2857 int level = 0,
2858 int spacesPerLevel = 4) const;
2859
2860 /// Invoke the specified `accessor` sequentially on each
2861 /// (non-modifiable) attribute of this object, supplying `accessor`
2862 /// with the corresponding attribute information structure until such
2863 /// invocation returns a non-zero value. Return the value from the
2864 /// last invocation of `accessor` (i.e., the invocation that terminated
2865 /// the sequence).
2866 template<class ACCESSOR>
2867 int accessAttributes(ACCESSOR& accessor) const;
2868
2869 /// Invoke the specified `accessor` on the (non-modifiable) attribute
2870 /// of this object indicated by the specified `id`, supplying `accessor`
2871 /// with the corresponding attribute information structure. Return the
2872 /// value returned from the invocation of `accessor` if `id` identifies
2873 /// an attribute of this class, and -1 otherwise.
2874 template<class ACCESSOR>
2875 int accessAttribute(ACCESSOR& accessor, int id) const;
2876
2877 /// Invoke the specified `accessor` on the (non-modifiable) attribute
2878 /// of this object indicated by the specified `name` of the specified
2879 /// `nameLength`, supplying `accessor` with the corresponding attribute
2880 /// information structure. Return the value returned from the
2881 /// invocation of `accessor` if `name` identifies an attribute of this
2882 /// class, and -1 otherwise.
2883 template<class ACCESSOR>
2884 int accessAttribute(ACCESSOR& accessor,
2885 const char *name,
2886 int nameLength) const;
2887
2888 /// Return a reference to the non-modifiable "Name" attribute of this
2889 /// object.
2891
2892 /// Return a reference to the non-modifiable "Type" attribute of this
2893 /// object.
2895
2896 /// Return a reference to the non-modifiable "MinOccurs" attribute of
2897 /// this object.
2899
2900 /// Return a reference to the non-modifiable "MaxOccurs" attribute of
2901 /// this object.
2903
2904 /// Return a reference to the non-modifiable "DefaultValue" attribute of
2905 /// this object.
2907
2908 /// Return a reference to the non-modifiable "Cppdefault" attribute of
2909 /// this object.
2911
2912 /// Return a reference to the non-modifiable "Cpptype" attribute of this
2913 /// object.
2915
2916 /// Return a reference to the non-modifiable "AllocatesMemory" attribute
2917 /// of this object.
2919
2920 /// Return a reference to the non-modifiable "AllowsDirectManipulation"
2921 /// attribute of this object.
2923
2924 /// Return a reference to the non-modifiable "Choice" attribute of this
2925 /// object.
2927};
2928
2929// FREE OPERATORS
2930
2931/// Return `true` if the specified `lhs` and `rhs` attribute objects have
2932/// the same value, and `false` otherwise. Two attribute objects have the
2933/// same value if each respective attribute has the same value.
2934inline
2935bool operator==(const BasicSchemaElement& lhs, const BasicSchemaElement& rhs);
2936
2937/// Return `true` if the specified `lhs` and `rhs` attribute objects do not
2938/// have the same value, and `false` otherwise. Two attribute objects do
2939/// not have the same value if one or more respective attributes differ in
2940/// values.
2941inline
2942bool operator!=(const BasicSchemaElement& lhs, const BasicSchemaElement& rhs);
2943
2944/// Format the specified `rhs` to the specified output `stream` and
2945/// return a reference to the modifiable `stream`.
2946inline
2947bsl::ostream& operator<<(bsl::ostream& stream, const BasicSchemaElement& rhs);
2948
2949/// Pass the specified `object` to the specified `hashAlg`. This function
2950/// integrates with the `bslh` modular hashing system and effectively
2951/// provides a `bsl::hash` specialization for `BasicSchemaElement`.
2952template <typename HASH_ALGORITHM>
2953void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaElement& object);
2954
2955} // close package namespace
2956
2957// TRAITS
2958
2960
2961namespace s_baltst {
2962
2963 // ==============================
2964 // class BasicSchemaElementChoice
2965 // ==============================
2966
2968
2969 // INSTANCE DATA
2970 union {
2974 };
2975
2976 int d_selectionId;
2977 bslma::Allocator *d_allocator_p;
2978
2979 public:
2980 // TYPES
2981
2982 enum {
2988
2989 enum {
2990 NUM_SELECTIONS = 3
2992
2993 enum {
2998
2999 // CONSTANTS
3000 static const char CLASS_NAME[];
3001
3003
3004 // CLASS METHODS
3005
3006 /// Return selection information for the selection indicated by the
3007 /// specified `id` if the selection exists, and 0 otherwise.
3009
3010 /// Return selection information for the selection indicated by the
3011 /// specified `name` of the specified `nameLength` if the selection
3012 /// exists, and 0 otherwise.
3014 const char *name,
3015 int nameLength);
3016
3017 // CREATORS
3018
3019 /// Create an object of type `BasicSchemaElementChoice` having the
3020 /// default value. Use the optionally specified `basicAllocator` to
3021 /// supply memory. If `basicAllocator` is 0, the currently installed
3022 /// default allocator is used.
3023 explicit BasicSchemaElementChoice(bslma::Allocator *basicAllocator = 0);
3024
3025 /// Create an object of type `BasicSchemaElementChoice` having the value
3026 /// of the specified `original` object. Use the optionally specified
3027 /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the
3028 /// currently installed default allocator is used.
3030 bslma::Allocator *basicAllocator = 0);
3031
3032#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
3033 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
3034 /// Create an object of type `BasicSchemaElementChoice` having the value
3035 /// of the specified `original` object. After performing this action,
3036 /// the `original` object will be left in a valid, but unspecified
3037 /// state.
3039
3040 /// Create an object of type `BasicSchemaElementChoice` having the value
3041 /// of the specified `original` object. After performing this action,
3042 /// the `original` object will be left in a valid, but unspecified
3043 /// state. Use the optionally specified `basicAllocator` to supply
3044 /// memory. If `basicAllocator` is 0, the currently installed default
3045 /// allocator is used.
3047 bslma::Allocator *basicAllocator);
3048#endif
3049
3050 /// Destroy this object.
3052
3053 // MANIPULATORS
3054
3055 /// Assign to this object the value of the specified `rhs` object.
3057
3058#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
3059 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
3060 /// Assign to this object the value of the specified `rhs` object.
3061 /// After performing this action, the `rhs` object will be left in a
3062 /// valid, but unspecified state.
3064#endif
3065
3066 /// Reset this object to the default value (i.e., its value upon default
3067 /// construction).
3068 void reset();
3069
3070 /// Set the value of this object to be the default for the selection
3071 /// indicated by the specified `selectionId`. Return 0 on success, and
3072 /// non-zero value otherwise (i.e., the selection is not found).
3074
3075 /// Set the value of this object to be the default for the selection
3076 /// indicated by the specified `name` of the specified `nameLength`.
3077 /// Return 0 on success, and non-zero value otherwise (i.e., the
3078 /// selection is not found).
3079 int makeSelection(const char *name, int nameLength);
3080
3083#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
3084 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
3086#endif
3087 // Set the value of this object to be a "Annotation" value. Optionally
3088 // specify the 'value' of the "Annotation". If 'value' is not
3089 // specified, the default "Annotation" value is used.
3090
3093#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
3094 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
3096#endif
3097 // Set the value of this object to be a "SimpleType" value. Optionally
3098 // specify the 'value' of the "SimpleType". If 'value' is not
3099 // specified, the default "SimpleType" value is used.
3100
3103#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
3104 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
3106#endif
3107 // Set the value of this object to be a "ComplexType" value.
3108 // Optionally specify the 'value' of the "ComplexType". If 'value' is
3109 // not specified, the default "ComplexType" value is used.
3110
3111 /// Invoke the specified `manipulator` on the address of the modifiable
3112 /// selection, supplying `manipulator` with the corresponding selection
3113 /// information structure. Return the value returned from the
3114 /// invocation of `manipulator` if this object has a defined selection,
3115 /// and -1 otherwise.
3116 template<class MANIPULATOR>
3117 int manipulateSelection(MANIPULATOR& manipulator);
3118
3119 /// Return a reference to the modifiable "Annotation" selection of this
3120 /// object if "Annotation" is the current selection.
3121 ///
3122 /// \pre The behavior is undefined unless "Annotation" is the selection of this object.
3124
3125 /// Return a reference to the modifiable "SimpleType" selection of this
3126 /// object if "SimpleType" is the current selection.
3127 ///
3128 /// \pre The behavior is undefined unless "SimpleType" is the selection of this object.
3130
3131 /// Return a reference to the modifiable "ComplexType" selection of this
3132 /// object if "ComplexType" is the current selection.
3133 ///
3134 /// \pre The behavior is undefined unless "ComplexType" is the selection of this object.
3136
3137 // ACCESSORS
3138
3139 /// Format this object to the specified output `stream` at the
3140 /// optionally specified indentation `level` and return a reference to
3141 /// the modifiable `stream`. If `level` is specified, optionally
3142 /// specify `spacesPerLevel`, the number of spaces per indentation level
3143 /// for this and all of its nested objects. Each line is indented by
3144 /// the absolute value of `level * spacesPerLevel`. If `level` is
3145 /// negative, suppress indentation of the first line. If
3146 /// `spacesPerLevel` is negative, suppress line breaks and format the
3147 /// entire output on one line. If `stream` is initially invalid, this operation has no effect.
3148 ///
3149 /// \note Note that a trailing newline is provided
3150 /// in multiline mode only.
3151 bsl::ostream& print(bsl::ostream& stream,
3152 int level = 0,
3153 int spacesPerLevel = 4) const;
3154
3155 /// Return the id of the current selection if the selection is defined,
3156 /// and -1 otherwise.
3157 int selectionId() const;
3158
3159 /// Invoke the specified `accessor` on the non-modifiable selection,
3160 /// supplying `accessor` with the corresponding selection information
3161 /// structure. Return the value returned from the invocation of
3162 /// `accessor` if this object has a defined selection, and -1 otherwise.
3163 template<class ACCESSOR>
3164 int accessSelection(ACCESSOR& accessor) const;
3165
3166 /// Return a reference to the non-modifiable "Annotation" selection of
3167 /// this object if "Annotation" is the current selection.
3168 ///
3169 /// \pre The behavior is undefined unless "Annotation" is the selection of this object.
3171
3172 /// Return a reference to the non-modifiable "SimpleType" selection of
3173 /// this object if "SimpleType" is the current selection.
3174 ///
3175 /// \pre The behavior is undefined unless "SimpleType" is the selection of this object.
3177
3178 /// Return a reference to the non-modifiable "ComplexType" selection of
3179 /// this object if "ComplexType" is the current selection.
3180 ///
3181 /// \pre The behavior is undefined unless "ComplexType" is the selection of this object.
3183
3184 /// Return `true` if the value of this object is a "Annotation" value,
3185 /// and return `false` otherwise.
3186 bool isAnnotationValue() const;
3187
3188 /// Return `true` if the value of this object is a "SimpleType" value,
3189 /// and return `false` otherwise.
3190 bool isSimpleTypeValue() const;
3191
3192 /// Return `true` if the value of this object is a "ComplexType" value,
3193 /// and return `false` otherwise.
3194 bool isComplexTypeValue() const;
3195
3196 /// Return `true` if the value of this object is undefined, and `false`
3197 /// otherwise.
3198 bool isUndefinedValue() const;
3199
3200 /// Return the symbolic name of the current selection of this object.
3201 const char *selectionName() const;
3202};
3203
3204// FREE OPERATORS
3205
3206/// Return `true` if the specified `lhs` and `rhs` objects have the same
3207/// value, and `false` otherwise. Two `BasicSchemaElementChoice` objects have the same
3208/// value if either the selections in both objects have the same ids and
3209/// the same values, or both selections are undefined.
3210inline
3211bool operator==(const BasicSchemaElementChoice& lhs, const BasicSchemaElementChoice& rhs);
3212
3213/// Return `true` if the specified `lhs` and `rhs` objects do not have the
3214/// same values, as determined by `operator==`, and `false` otherwise.
3215inline
3216bool operator!=(const BasicSchemaElementChoice& lhs, const BasicSchemaElementChoice& rhs);
3217
3218/// Format the specified `rhs` to the specified output `stream` and
3219/// return a reference to the modifiable `stream`.
3220inline
3221bsl::ostream& operator<<(bsl::ostream& stream, const BasicSchemaElementChoice& rhs);
3222
3223/// Pass the specified `object` to the specified `hashAlg`. This function
3224/// integrates with the `bslh` modular hashing system and effectively
3225/// provides a `bsl::hash` specialization for `BasicSchemaElementChoice`.
3226template <typename HASH_ALGORITHM>
3227void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaElementChoice& object);
3228
3229} // close package namespace
3230
3231// TRAITS
3232
3234
3235namespace s_baltst {
3236
3237 // ================================
3238 // class BasicSchemaSequenceElement
3239 // ================================
3240
3242
3243 // INSTANCE DATA
3245
3246 public:
3247 // TYPES
3248 enum {
3251
3252 enum {
3253 NUM_ATTRIBUTES = 1
3255
3256 enum {
3259
3260 // CONSTANTS
3261 static const char CLASS_NAME[];
3262
3264
3265 public:
3266 // CLASS METHODS
3267
3268 /// Return attribute information for the attribute indicated by the
3269 /// specified `id` if the attribute exists, and 0 otherwise.
3271
3272 /// Return attribute information for the attribute indicated by the
3273 /// specified `name` of the specified `nameLength` if the attribute
3274 /// exists, and 0 otherwise.
3276 const char *name,
3277 int nameLength);
3278
3279 // CREATORS
3280
3281 /// Create an object of type `BasicSchemaSequenceElement` having the
3282 /// default value. Use the optionally specified `basicAllocator` to
3283 /// supply memory. If `basicAllocator` is 0, the currently installed
3284 /// default allocator is used.
3285 explicit BasicSchemaSequenceElement(bslma::Allocator *basicAllocator = 0);
3286
3287 /// Create an object of type `BasicSchemaSequenceElement` having the
3288 /// value of the specified `original` object. Use the optionally
3289 /// specified `basicAllocator` to supply memory. If `basicAllocator` is
3290 /// 0, the currently installed default allocator is used.
3292 bslma::Allocator *basicAllocator = 0);
3293
3294#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
3295 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
3296 /// Create an object of type `BasicSchemaSequenceElement` having the
3297 /// value of the specified `original` object. After performing this
3298 /// action, the `original` object will be left in a valid, but
3299 /// unspecified state.
3301
3302 /// Create an object of type `BasicSchemaSequenceElement` having the
3303 /// value of the specified `original` object. After performing this
3304 /// action, the `original` object will be left in a valid, but
3305 /// unspecified state. Use the optionally specified `basicAllocator` to
3306 /// supply memory. If `basicAllocator` is 0, the currently installed
3307 /// default allocator is used.
3309 bslma::Allocator *basicAllocator);
3310#endif
3311
3312 /// Destroy this object.
3314
3315 // MANIPULATORS
3316
3317 /// Assign to this object the value of the specified `rhs` object.
3319
3320#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
3321 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
3322 /// Assign to this object the value of the specified `rhs` object.
3323 /// After performing this action, the `rhs` object will be left in a
3324 /// valid, but unspecified state.
3326#endif
3327
3328 /// Reset this object to the default value (i.e., its value upon
3329 /// default construction).
3330 void reset();
3331
3332 /// Invoke the specified `manipulator` sequentially on the address of
3333 /// each (modifiable) attribute of this object, supplying `manipulator`
3334 /// with the corresponding attribute information structure until such
3335 /// invocation returns a non-zero value. Return the value from the
3336 /// last invocation of `manipulator` (i.e., the invocation that
3337 /// terminated the sequence).
3338 template<class MANIPULATOR>
3339 int manipulateAttributes(MANIPULATOR& manipulator);
3340
3341 /// Invoke the specified `manipulator` on the address of
3342 /// the (modifiable) attribute indicated by the specified `id`,
3343 /// supplying `manipulator` with the corresponding attribute
3344 /// information structure. Return the value returned from the
3345 /// invocation of `manipulator` if `id` identifies an attribute of this
3346 /// class, and -1 otherwise.
3347 template<class MANIPULATOR>
3348 int manipulateAttribute(MANIPULATOR& manipulator, int id);
3349
3350 /// Invoke the specified `manipulator` on the address of
3351 /// the (modifiable) attribute indicated by the specified `name` of the
3352 /// specified `nameLength`, supplying `manipulator` with the
3353 /// corresponding attribute information structure. Return the value
3354 /// returned from the invocation of `manipulator` if `name` identifies
3355 /// an attribute of this class, and -1 otherwise.
3356 template<class MANIPULATOR>
3357 int manipulateAttribute(MANIPULATOR& manipulator,
3358 const char *name,
3359 int nameLength);
3360
3361 /// Return a reference to the modifiable "Choice" attribute of this
3362 /// object.
3364
3365 // ACCESSORS
3366
3367 /// Format this object to the specified output `stream` at the
3368 /// optionally specified indentation `level` and return a reference to
3369 /// the modifiable `stream`. If `level` is specified, optionally
3370 /// specify `spacesPerLevel`, the number of spaces per indentation level
3371 /// for this and all of its nested objects. Each line is indented by
3372 /// the absolute value of `level * spacesPerLevel`. If `level` is
3373 /// negative, suppress indentation of the first line. If
3374 /// `spacesPerLevel` is negative, suppress line breaks and format the
3375 /// entire output on one line. If `stream` is initially invalid, this operation has no effect.
3376 ///
3377 /// \note Note that a trailing newline is provided
3378 /// in multiline mode only.
3379 bsl::ostream& print(bsl::ostream& stream,
3380 int level = 0,
3381 int spacesPerLevel = 4) const;
3382
3383 /// Invoke the specified `accessor` sequentially on each
3384 /// (non-modifiable) attribute of this object, supplying `accessor`
3385 /// with the corresponding attribute information structure until such
3386 /// invocation returns a non-zero value. Return the value from the
3387 /// last invocation of `accessor` (i.e., the invocation that terminated
3388 /// the sequence).
3389 template<class ACCESSOR>
3390 int accessAttributes(ACCESSOR& accessor) const;
3391
3392 /// Invoke the specified `accessor` on the (non-modifiable) attribute
3393 /// of this object indicated by the specified `id`, supplying `accessor`
3394 /// with the corresponding attribute information structure. Return the
3395 /// value returned from the invocation of `accessor` if `id` identifies
3396 /// an attribute of this class, and -1 otherwise.
3397 template<class ACCESSOR>
3398 int accessAttribute(ACCESSOR& accessor, int id) const;
3399
3400 /// Invoke the specified `accessor` on the (non-modifiable) attribute
3401 /// of this object indicated by the specified `name` of the specified
3402 /// `nameLength`, supplying `accessor` with the corresponding attribute
3403 /// information structure. Return the value returned from the
3404 /// invocation of `accessor` if `name` identifies an attribute of this
3405 /// class, and -1 otherwise.
3406 template<class ACCESSOR>
3407 int accessAttribute(ACCESSOR& accessor,
3408 const char *name,
3409 int nameLength) const;
3410
3411 /// Return a reference to the non-modifiable "Choice" attribute of this
3412 /// object.
3414};
3415
3416// FREE OPERATORS
3417
3418/// Return `true` if the specified `lhs` and `rhs` attribute objects have
3419/// the same value, and `false` otherwise. Two attribute objects have the
3420/// same value if each respective attribute has the same value.
3421inline
3422bool operator==(const BasicSchemaSequenceElement& lhs, const BasicSchemaSequenceElement& rhs);
3423
3424/// Return `true` if the specified `lhs` and `rhs` attribute objects do not
3425/// have the same value, and `false` otherwise. Two attribute objects do
3426/// not have the same value if one or more respective attributes differ in
3427/// values.
3428inline
3429bool operator!=(const BasicSchemaSequenceElement& lhs, const BasicSchemaSequenceElement& rhs);
3430
3431/// Format the specified `rhs` to the specified output `stream` and
3432/// return a reference to the modifiable `stream`.
3433inline
3434bsl::ostream& operator<<(bsl::ostream& stream, const BasicSchemaSequenceElement& rhs);
3435
3436/// Pass the specified `object` to the specified `hashAlg`. This function
3437/// integrates with the `bslh` modular hashing system and effectively
3438/// provides a `bsl::hash` specialization for `BasicSchemaSequenceElement`.
3439template <typename HASH_ALGORITHM>
3440void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaSequenceElement& object);
3441
3442} // close package namespace
3443
3444// TRAITS
3445
3447
3448namespace s_baltst {
3449
3450 // ======================================
3451 // class BasicSchemaSequenceElementChoice
3452 // ======================================
3453
3455
3456 // INSTANCE DATA
3457 union {
3460 };
3461
3462 int d_selectionId;
3463 bslma::Allocator *d_allocator_p;
3464
3465 public:
3466 // TYPES
3467
3468 enum {
3473
3474 enum {
3475 NUM_SELECTIONS = 2
3477
3478 enum {
3482
3483 // CONSTANTS
3484 static const char CLASS_NAME[];
3485
3487
3488 // CLASS METHODS
3489
3490 /// Return selection information for the selection indicated by the
3491 /// specified `id` if the selection exists, and 0 otherwise.
3493
3494 /// Return selection information for the selection indicated by the
3495 /// specified `name` of the specified `nameLength` if the selection
3496 /// exists, and 0 otherwise.
3498 const char *name,
3499 int nameLength);
3500
3501 // CREATORS
3502
3503 /// Create an object of type `BasicSchemaSequenceElementChoice` having
3504 /// the default value. Use the optionally specified `basicAllocator` to
3505 /// supply memory. If `basicAllocator` is 0, the currently installed
3506 /// default allocator is used.
3507 explicit BasicSchemaSequenceElementChoice(bslma::Allocator *basicAllocator = 0);
3508
3509 /// Create an object of type `BasicSchemaSequenceElementChoice` having
3510 /// the value of the specified `original` object. Use the optionally
3511 /// specified `basicAllocator` to supply memory. If `basicAllocator` is
3512 /// 0, the currently installed default allocator is used.
3514 bslma::Allocator *basicAllocator = 0);
3515
3516#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
3517 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
3518 /// Create an object of type `BasicSchemaSequenceElementChoice` having
3519 /// the value of the specified `original` object. After performing this
3520 /// action, the `original` object will be left in a valid, but
3521 /// unspecified state.
3523
3524 /// Create an object of type `BasicSchemaSequenceElementChoice` having
3525 /// the value of the specified `original` object. After performing this
3526 /// action, the `original` object will be left in a valid, but
3527 /// unspecified state. Use the optionally specified `basicAllocator` to
3528 /// supply memory. If `basicAllocator` is 0, the currently installed
3529 /// default allocator is used.
3531 bslma::Allocator *basicAllocator);
3532#endif
3533
3534 /// Destroy this object.
3536
3537 // MANIPULATORS
3538
3539 /// Assign to this object the value of the specified `rhs` object.
3541
3542#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
3543 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
3544 /// Assign to this object the value of the specified `rhs` object.
3545 /// After performing this action, the `rhs` object will be left in a
3546 /// valid, but unspecified state.
3548#endif
3549
3550 /// Reset this object to the default value (i.e., its value upon default
3551 /// construction).
3552 void reset();
3553
3554 /// Set the value of this object to be the default for the selection
3555 /// indicated by the specified `selectionId`. Return 0 on success, and
3556 /// non-zero value otherwise (i.e., the selection is not found).
3558
3559 /// Set the value of this object to be the default for the selection
3560 /// indicated by the specified `name` of the specified `nameLength`.
3561 /// Return 0 on success, and non-zero value otherwise (i.e., the
3562 /// selection is not found).
3563 int makeSelection(const char *name, int nameLength);
3564
3567#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
3568 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
3570#endif
3571 // Set the value of this object to be a "Annotation" value. Optionally
3572 // specify the 'value' of the "Annotation". If 'value' is not
3573 // specified, the default "Annotation" value is used.
3574
3577#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
3578 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
3580#endif
3581 // Set the value of this object to be a "Element" value. Optionally
3582 // specify the 'value' of the "Element". If 'value' is not specified,
3583 // the default "Element" value is used.
3584
3585 /// Invoke the specified `manipulator` on the address of the modifiable
3586 /// selection, supplying `manipulator` with the corresponding selection
3587 /// information structure. Return the value returned from the
3588 /// invocation of `manipulator` if this object has a defined selection,
3589 /// and -1 otherwise.
3590 template<class MANIPULATOR>
3591 int manipulateSelection(MANIPULATOR& manipulator);
3592
3593 /// Return a reference to the modifiable "Annotation" selection of this
3594 /// object if "Annotation" is the current selection.
3595 ///
3596 /// \pre The behavior is undefined unless "Annotation" is the selection of this object.
3598
3599 /// Return a reference to the modifiable "Element" selection of this
3600 /// object if "Element" is the current selection.
3601 ///
3602 /// \pre The behavior is undefined unless "Element" is the selection of this object.
3604
3605 // ACCESSORS
3606
3607 /// Format this object to the specified output `stream` at the
3608 /// optionally specified indentation `level` and return a reference to
3609 /// the modifiable `stream`. If `level` is specified, optionally
3610 /// specify `spacesPerLevel`, the number of spaces per indentation level
3611 /// for this and all of its nested objects. Each line is indented by
3612 /// the absolute value of `level * spacesPerLevel`. If `level` is
3613 /// negative, suppress indentation of the first line. If
3614 /// `spacesPerLevel` is negative, suppress line breaks and format the
3615 /// entire output on one line. If `stream` is initially invalid, this operation has no effect.
3616 ///
3617 /// \note Note that a trailing newline is provided
3618 /// in multiline mode only.
3619 bsl::ostream& print(bsl::ostream& stream,
3620 int level = 0,
3621 int spacesPerLevel = 4) const;
3622
3623 /// Return the id of the current selection if the selection is defined,
3624 /// and -1 otherwise.
3625 int selectionId() const;
3626
3627 /// Invoke the specified `accessor` on the non-modifiable selection,
3628 /// supplying `accessor` with the corresponding selection information
3629 /// structure. Return the value returned from the invocation of
3630 /// `accessor` if this object has a defined selection, and -1 otherwise.
3631 template<class ACCESSOR>
3632 int accessSelection(ACCESSOR& accessor) const;
3633
3634 /// Return a reference to the non-modifiable "Annotation" selection of
3635 /// this object if "Annotation" is the current selection.
3636 ///
3637 /// \pre The behavior is undefined unless "Annotation" is the selection of this object.
3639
3640 /// Return a reference to the non-modifiable "Element" selection of this
3641 /// object if "Element" is the current selection.
3642 ///
3643 /// \pre The behavior is undefined unless "Element" is the selection of this object.
3644 const BasicSchemaElement& element() const;
3645
3646 /// Return `true` if the value of this object is a "Annotation" value,
3647 /// and return `false` otherwise.
3648 bool isAnnotationValue() const;
3649
3650 /// Return `true` if the value of this object is a "Element" value, and
3651 /// return `false` otherwise.
3652 bool isElementValue() const;
3653
3654 /// Return `true` if the value of this object is undefined, and `false`
3655 /// otherwise.
3656 bool isUndefinedValue() const;
3657
3658 /// Return the symbolic name of the current selection of this object.
3659 const char *selectionName() const;
3660};
3661
3662// FREE OPERATORS
3663
3664/// Return `true` if the specified `lhs` and `rhs` objects have the same
3665/// value, and `false` otherwise. Two `BasicSchemaSequenceElementChoice` objects have the same
3666/// value if either the selections in both objects have the same ids and
3667/// the same values, or both selections are undefined.
3668inline
3670
3671/// Return `true` if the specified `lhs` and `rhs` objects do not have the
3672/// same values, as determined by `operator==`, and `false` otherwise.
3673inline
3675
3676/// Format the specified `rhs` to the specified output `stream` and
3677/// return a reference to the modifiable `stream`.
3678inline
3679bsl::ostream& operator<<(bsl::ostream& stream, const BasicSchemaSequenceElementChoice& rhs);
3680
3681/// Pass the specified `object` to the specified `hashAlg`. This function
3682/// integrates with the `bslh` modular hashing system and effectively
3683/// provides a `bsl::hash` specialization for `BasicSchemaSequenceElementChoice`.
3684template <typename HASH_ALGORITHM>
3685void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaSequenceElementChoice& object);
3686
3687} // close package namespace
3688
3689// TRAITS
3690
3692
3693namespace s_baltst {
3694
3695 // =======================
3696 // class BasicSchemaChoice
3697 // =======================
3698
3700
3701 // INSTANCE DATA
3702 union {
3706 };
3707
3708 int d_selectionId;
3709 bslma::Allocator *d_allocator_p;
3710
3711 public:
3712 // TYPES
3713
3714 enum {
3720
3721 enum {
3722 NUM_SELECTIONS = 3
3724
3725 enum {
3730
3731 // CONSTANTS
3732 static const char CLASS_NAME[];
3733
3735
3736 // CLASS METHODS
3737
3738 /// Return selection information for the selection indicated by the
3739 /// specified `id` if the selection exists, and 0 otherwise.
3741
3742 /// Return selection information for the selection indicated by the
3743 /// specified `name` of the specified `nameLength` if the selection
3744 /// exists, and 0 otherwise.
3746 const char *name,
3747 int nameLength);
3748
3749 // CREATORS
3750
3751 /// Create an object of type `BasicSchemaChoice` having the default
3752 /// value. Use the optionally specified `basicAllocator` to supply
3753 /// memory. If `basicAllocator` is 0, the currently installed default
3754 /// allocator is used.
3755 explicit BasicSchemaChoice(bslma::Allocator *basicAllocator = 0);
3756
3757 /// Create an object of type `BasicSchemaChoice` having the value of the
3758 /// specified `original` object. Use the optionally specified
3759 /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the
3760 /// currently installed default allocator is used.
3762 bslma::Allocator *basicAllocator = 0);
3763
3764#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
3765 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
3766 /// Create an object of type `BasicSchemaChoice` having the value of the
3767 /// specified `original` object. After performing this action, the
3768 /// `original` object will be left in a valid, but unspecified state.
3769 BasicSchemaChoice(BasicSchemaChoice&& original) noexcept;
3770
3771 /// Create an object of type `BasicSchemaChoice` having the value of the
3772 /// specified `original` object. After performing this action, the
3773 /// `original` object will be left in a valid, but unspecified state.
3774 /// Use the optionally specified `basicAllocator` to supply memory. If
3775 /// `basicAllocator` is 0, the currently installed default allocator is
3776 /// used.
3778 bslma::Allocator *basicAllocator);
3779#endif
3780
3781 /// Destroy this object.
3783
3784 // MANIPULATORS
3785
3786 /// Assign to this object the value of the specified `rhs` object.
3788
3789#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
3790 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
3791 /// Assign to this object the value of the specified `rhs` object.
3792 /// After performing this action, the `rhs` object will be left in a
3793 /// valid, but unspecified state.
3795#endif
3796
3797 /// Reset this object to the default value (i.e., its value upon default
3798 /// construction).
3799 void reset();
3800
3801 /// Set the value of this object to be the default for the selection
3802 /// indicated by the specified `selectionId`. Return 0 on success, and
3803 /// non-zero value otherwise (i.e., the selection is not found).
3805
3806 /// Set the value of this object to be the default for the selection
3807 /// indicated by the specified `name` of the specified `nameLength`.
3808 /// Return 0 on success, and non-zero value otherwise (i.e., the
3809 /// selection is not found).
3810 int makeSelection(const char *name, int nameLength);
3811
3814#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
3815 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
3817#endif
3818 // Set the value of this object to be a "Annotation" value. Optionally
3819 // specify the 'value' of the "Annotation". If 'value' is not
3820 // specified, the default "Annotation" value is used.
3821
3824#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
3825 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
3827#endif
3828 // Set the value of this object to be a "SimpleType" value. Optionally
3829 // specify the 'value' of the "SimpleType". If 'value' is not
3830 // specified, the default "SimpleType" value is used.
3831
3834#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
3835 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
3837#endif
3838 // Set the value of this object to be a "ComplexType" value.
3839 // Optionally specify the 'value' of the "ComplexType". If 'value' is
3840 // not specified, the default "ComplexType" value is used.
3841
3842 /// Invoke the specified `manipulator` on the address of the modifiable
3843 /// selection, supplying `manipulator` with the corresponding selection
3844 /// information structure. Return the value returned from the
3845 /// invocation of `manipulator` if this object has a defined selection,
3846 /// and -1 otherwise.
3847 template<class MANIPULATOR>
3848 int manipulateSelection(MANIPULATOR& manipulator);
3849
3850 /// Return a reference to the modifiable "Annotation" selection of this
3851 /// object if "Annotation" is the current selection.
3852 ///
3853 /// \pre The behavior is undefined unless "Annotation" is the selection of this object.
3855
3856 /// Return a reference to the modifiable "SimpleType" selection of this
3857 /// object if "SimpleType" is the current selection.
3858 ///
3859 /// \pre The behavior is undefined unless "SimpleType" is the selection of this object.
3861
3862 /// Return a reference to the modifiable "ComplexType" selection of this
3863 /// object if "ComplexType" is the current selection.
3864 ///
3865 /// \pre The behavior is undefined unless "ComplexType" is the selection of this object.
3867
3868 // ACCESSORS
3869
3870 /// Format this object to the specified output `stream` at the
3871 /// optionally specified indentation `level` and return a reference to
3872 /// the modifiable `stream`. If `level` is specified, optionally
3873 /// specify `spacesPerLevel`, the number of spaces per indentation level
3874 /// for this and all of its nested objects. Each line is indented by
3875 /// the absolute value of `level * spacesPerLevel`. If `level` is
3876 /// negative, suppress indentation of the first line. If
3877 /// `spacesPerLevel` is negative, suppress line breaks and format the
3878 /// entire output on one line. If `stream` is initially invalid, this operation has no effect.
3879 ///
3880 /// \note Note that a trailing newline is provided
3881 /// in multiline mode only.
3882 bsl::ostream& print(bsl::ostream& stream,
3883 int level = 0,
3884 int spacesPerLevel = 4) const;
3885
3886 /// Return the id of the current selection if the selection is defined,
3887 /// and -1 otherwise.
3888 int selectionId() const;
3889
3890 /// Invoke the specified `accessor` on the non-modifiable selection,
3891 /// supplying `accessor` with the corresponding selection information
3892 /// structure. Return the value returned from the invocation of
3893 /// `accessor` if this object has a defined selection, and -1 otherwise.
3894 template<class ACCESSOR>
3895 int accessSelection(ACCESSOR& accessor) const;
3896
3897 /// Return a reference to the non-modifiable "Annotation" selection of
3898 /// this object if "Annotation" is the current selection.
3899 ///
3900 /// \pre The behavior is undefined unless "Annotation" is the selection of this object.
3902
3903 /// Return a reference to the non-modifiable "SimpleType" selection of
3904 /// this object if "SimpleType" is the current selection.
3905 ///
3906 /// \pre The behavior is undefined unless "SimpleType" is the selection of this object.
3908
3909 /// Return a reference to the non-modifiable "ComplexType" selection of
3910 /// this object if "ComplexType" is the current selection.
3911 ///
3912 /// \pre The behavior is undefined unless "ComplexType" is the selection of this object.
3914
3915 /// Return `true` if the value of this object is a "Annotation" value,
3916 /// and return `false` otherwise.
3917 bool isAnnotationValue() const;
3918
3919 /// Return `true` if the value of this object is a "SimpleType" value,
3920 /// and return `false` otherwise.
3921 bool isSimpleTypeValue() const;
3922
3923 /// Return `true` if the value of this object is a "ComplexType" value,
3924 /// and return `false` otherwise.
3925 bool isComplexTypeValue() const;
3926
3927 /// Return `true` if the value of this object is undefined, and `false`
3928 /// otherwise.
3929 bool isUndefinedValue() const;
3930
3931 /// Return the symbolic name of the current selection of this object.
3932 const char *selectionName() const;
3933};
3934
3935// FREE OPERATORS
3936
3937/// Return `true` if the specified `lhs` and `rhs` objects have the same
3938/// value, and `false` otherwise. Two `BasicSchemaChoice` objects have the same
3939/// value if either the selections in both objects have the same ids and
3940/// the same values, or both selections are undefined.
3941inline
3942bool operator==(const BasicSchemaChoice& lhs, const BasicSchemaChoice& rhs);
3943
3944/// Return `true` if the specified `lhs` and `rhs` objects do not have the
3945/// same values, as determined by `operator==`, and `false` otherwise.
3946inline
3947bool operator!=(const BasicSchemaChoice& lhs, const BasicSchemaChoice& rhs);
3948
3949/// Format the specified `rhs` to the specified output `stream` and
3950/// return a reference to the modifiable `stream`.
3951inline
3952bsl::ostream& operator<<(bsl::ostream& stream, const BasicSchemaChoice& rhs);
3953
3954/// Pass the specified `object` to the specified `hashAlg`. This function
3955/// integrates with the `bslh` modular hashing system and effectively
3956/// provides a `bsl::hash` specialization for `BasicSchemaChoice`.
3957template <typename HASH_ALGORITHM>
3958void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaChoice& object);
3959
3960} // close package namespace
3961
3962// TRAITS
3963
3965
3966namespace s_baltst {
3967
3968 // =================
3969 // class BasicSchema
3970 // =================
3971
3973
3974 // INSTANCE DATA
3979 bdlb::NullableValue<bsl::string> d_elementFormDefault;
3980
3981 public:
3982 // TYPES
3983 enum {
3984 ATTRIBUTE_ID_XS = 0
3990
3991 enum {
3992 NUM_ATTRIBUTES = 5
3994
3995 enum {
4002
4003 // CONSTANTS
4004 static const char CLASS_NAME[];
4005
4007
4008 public:
4009 // CLASS METHODS
4010
4011 /// Return attribute information for the attribute indicated by the
4012 /// specified `id` if the attribute exists, and 0 otherwise.
4014
4015 /// Return attribute information for the attribute indicated by the
4016 /// specified `name` of the specified `nameLength` if the attribute
4017 /// exists, and 0 otherwise.
4019 const char *name,
4020 int nameLength);
4021
4022 // CREATORS
4023
4024 /// Create an object of type `BasicSchema` having the default value.
4025 /// Use the optionally specified `basicAllocator` to supply memory. If
4026 /// `basicAllocator` is 0, the currently installed default allocator is
4027 /// used.
4028 explicit BasicSchema(bslma::Allocator *basicAllocator = 0);
4029
4030 /// Create an object of type `BasicSchema` having the value of the
4031 /// specified `original` object. Use the optionally specified
4032 /// `basicAllocator` to supply memory. If `basicAllocator` is 0, the
4033 /// currently installed default allocator is used.
4034 BasicSchema(const BasicSchema& original,
4035 bslma::Allocator *basicAllocator = 0);
4036
4037#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
4038 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
4039 /// Create an object of type `BasicSchema` having the value of the
4040 /// specified `original` object. After performing this action, the
4041 /// `original` object will be left in a valid, but unspecified state.
4042 BasicSchema(BasicSchema&& original) noexcept;
4043
4044 /// Create an object of type `BasicSchema` having the value of the
4045 /// specified `original` object. After performing this action, the
4046 /// `original` object will be left in a valid, but unspecified state.
4047 /// Use the optionally specified `basicAllocator` to supply memory. If
4048 /// `basicAllocator` is 0, the currently installed default allocator is
4049 /// used.
4050 BasicSchema(BasicSchema&& original,
4051 bslma::Allocator *basicAllocator);
4052#endif
4053
4054 /// Destroy this object.
4056
4057 // MANIPULATORS
4058
4059 /// Assign to this object the value of the specified `rhs` object.
4061
4062#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
4063 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
4064 /// Assign to this object the value of the specified `rhs` object.
4065 /// After performing this action, the `rhs` object will be left in a
4066 /// valid, but unspecified state.
4068#endif
4069
4070 /// Reset this object to the default value (i.e., its value upon
4071 /// default construction).
4072 void reset();
4073
4074 /// Invoke the specified `manipulator` sequentially on the address of
4075 /// each (modifiable) attribute of this object, supplying `manipulator`
4076 /// with the corresponding attribute information structure until such
4077 /// invocation returns a non-zero value. Return the value from the
4078 /// last invocation of `manipulator` (i.e., the invocation that
4079 /// terminated the sequence).
4080 template<class MANIPULATOR>
4081 int manipulateAttributes(MANIPULATOR& manipulator);
4082
4083 /// Invoke the specified `manipulator` on the address of
4084 /// the (modifiable) attribute indicated by the specified `id`,
4085 /// supplying `manipulator` with the corresponding attribute
4086 /// information structure. Return the value returned from the
4087 /// invocation of `manipulator` if `id` identifies an attribute of this
4088 /// class, and -1 otherwise.
4089 template<class MANIPULATOR>
4090 int manipulateAttribute(MANIPULATOR& manipulator, int id);
4091
4092 /// Invoke the specified `manipulator` on the address of
4093 /// the (modifiable) attribute indicated by the specified `name` of the
4094 /// specified `nameLength`, supplying `manipulator` with the
4095 /// corresponding attribute information structure. Return the value
4096 /// returned from the invocation of `manipulator` if `name` identifies
4097 /// an attribute of this class, and -1 otherwise.
4098 template<class MANIPULATOR>
4099 int manipulateAttribute(MANIPULATOR& manipulator,
4100 const char *name,
4101 int nameLength);
4102
4103 /// Return a reference to the modifiable "Xs" attribute of this object.
4105
4106 /// Return a reference to the modifiable "Bdem" attribute of this
4107 /// object.
4109
4110 /// Return a reference to the modifiable "Package" attribute of this
4111 /// object.
4113
4114 /// Return a reference to the modifiable "ElementFormDefault" attribute
4115 /// of this object.
4117
4118 /// Return a reference to the modifiable "Choice" attribute of this
4119 /// object.
4121
4122 // ACCESSORS
4123
4124 /// Format this object to the specified output `stream` at the
4125 /// optionally specified indentation `level` and return a reference to
4126 /// the modifiable `stream`. If `level` is specified, optionally
4127 /// specify `spacesPerLevel`, the number of spaces per indentation level
4128 /// for this and all of its nested objects. Each line is indented by
4129 /// the absolute value of `level * spacesPerLevel`. If `level` is
4130 /// negative, suppress indentation of the first line. If
4131 /// `spacesPerLevel` is negative, suppress line breaks and format the
4132 /// entire output on one line. If `stream` is initially invalid, this operation has no effect.
4133 ///
4134 /// \note Note that a trailing newline is provided
4135 /// in multiline mode only.
4136 bsl::ostream& print(bsl::ostream& stream,
4137 int level = 0,
4138 int spacesPerLevel = 4) const;
4139
4140 /// Invoke the specified `accessor` sequentially on each
4141 /// (non-modifiable) attribute of this object, supplying `accessor`
4142 /// with the corresponding attribute information structure until such
4143 /// invocation returns a non-zero value. Return the value from the
4144 /// last invocation of `accessor` (i.e., the invocation that terminated
4145 /// the sequence).
4146 template<class ACCESSOR>
4147 int accessAttributes(ACCESSOR& accessor) const;
4148
4149 /// Invoke the specified `accessor` on the (non-modifiable) attribute
4150 /// of this object indicated by the specified `id`, supplying `accessor`
4151 /// with the corresponding attribute information structure. Return the
4152 /// value returned from the invocation of `accessor` if `id` identifies
4153 /// an attribute of this class, and -1 otherwise.
4154 template<class ACCESSOR>
4155 int accessAttribute(ACCESSOR& accessor, int id) const;
4156
4157 /// Invoke the specified `accessor` on the (non-modifiable) attribute
4158 /// of this object indicated by the specified `name` of the specified
4159 /// `nameLength`, supplying `accessor` with the corresponding attribute
4160 /// information structure. Return the value returned from the
4161 /// invocation of `accessor` if `name` identifies an attribute of this
4162 /// class, and -1 otherwise.
4163 template<class ACCESSOR>
4164 int accessAttribute(ACCESSOR& accessor,
4165 const char *name,
4166 int nameLength) const;
4167
4168 /// Return a reference to the non-modifiable "Xs" attribute of this
4169 /// object.
4170 const bdlb::NullableValue<bsl::string>& xs() const;
4171
4172 /// Return a reference to the non-modifiable "Bdem" attribute of this
4173 /// object.
4175
4176 /// Return a reference to the non-modifiable "Package" attribute of this
4177 /// object.
4179
4180 /// Return a reference to the non-modifiable "ElementFormDefault"
4181 /// attribute of this object.
4183
4184 /// Return a reference to the non-modifiable "Choice" attribute of this
4185 /// object.
4187};
4188
4189// FREE OPERATORS
4190
4191/// Return `true` if the specified `lhs` and `rhs` attribute objects have
4192/// the same value, and `false` otherwise. Two attribute objects have the
4193/// same value if each respective attribute has the same value.
4194inline
4195bool operator==(const BasicSchema& lhs, const BasicSchema& rhs);
4196
4197/// Return `true` if the specified `lhs` and `rhs` attribute objects do not
4198/// have the same value, and `false` otherwise. Two attribute objects do
4199/// not have the same value if one or more respective attributes differ in
4200/// values.
4201inline
4202bool operator!=(const BasicSchema& lhs, const BasicSchema& rhs);
4203
4204/// Format the specified `rhs` to the specified output `stream` and
4205/// return a reference to the modifiable `stream`.
4206inline
4207bsl::ostream& operator<<(bsl::ostream& stream, const BasicSchema& rhs);
4208
4209/// Pass the specified `object` to the specified `hashAlg`. This function
4210/// integrates with the `bslh` modular hashing system and effectively
4211/// provides a `bsl::hash` specialization for `BasicSchema`.
4212template <typename HASH_ALGORITHM>
4213void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchema& object);
4214
4215} // close package namespace
4216
4217// TRAITS
4218
4220
4221// ============================================================================
4222// INLINE FUNCTION DEFINITIONS
4223// ============================================================================
4224
4225namespace s_baltst {
4226
4227 // ----------------------------------
4228 // class BasicSchemaAnnotationElement
4229 // ----------------------------------
4230
4231// CLASS METHODS
4232// MANIPULATORS
4233template <class MANIPULATOR>
4235{
4236 int ret;
4237
4238 ret = manipulator(&d_documentation, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_DOCUMENTATION]);
4239 if (ret) {
4240 return ret;
4241 }
4242
4243 return ret;
4244}
4245
4246template <class MANIPULATOR>
4247int BasicSchemaAnnotationElement::manipulateAttribute(MANIPULATOR& manipulator, int id)
4248{
4249 enum { NOT_FOUND = -1 };
4250
4251 switch (id) {
4253 return manipulator(&d_documentation, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_DOCUMENTATION]);
4254 }
4255 default:
4256 return NOT_FOUND;
4257 }
4258}
4259
4260template <class MANIPULATOR>
4262 MANIPULATOR& manipulator,
4263 const char *name,
4264 int nameLength)
4265{
4266 enum { NOT_FOUND = -1 };
4267
4268 const bdlat_AttributeInfo *attributeInfo =
4269 lookupAttributeInfo(name, nameLength);
4270 if (0 == attributeInfo) {
4271 return NOT_FOUND;
4272 }
4273
4274 return manipulateAttribute(manipulator, attributeInfo->d_id);
4275}
4276
4277inline
4282
4283// ACCESSORS
4284template <class ACCESSOR>
4286{
4287 int ret;
4288
4289 ret = accessor(d_documentation, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_DOCUMENTATION]);
4290 if (ret) {
4291 return ret;
4292 }
4293
4294 return ret;
4295}
4296
4297template <class ACCESSOR>
4298int BasicSchemaAnnotationElement::accessAttribute(ACCESSOR& accessor, int id) const
4299{
4300 enum { NOT_FOUND = -1 };
4301
4302 switch (id) {
4304 return accessor(d_documentation, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_DOCUMENTATION]);
4305 }
4306 default:
4307 return NOT_FOUND;
4308 }
4309}
4310
4311template <class ACCESSOR>
4313 ACCESSOR& accessor,
4314 const char *name,
4315 int nameLength) const
4316{
4317 enum { NOT_FOUND = -1 };
4318
4319 const bdlat_AttributeInfo *attributeInfo =
4320 lookupAttributeInfo(name, nameLength);
4321 if (0 == attributeInfo) {
4322 return NOT_FOUND;
4323 }
4324
4325 return accessAttribute(accessor, attributeInfo->d_id);
4326}
4327
4328inline
4330{
4331 return d_documentation;
4332}
4333
4334template <typename HASH_ALGORITHM>
4335void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaAnnotationElement& object)
4336{
4337 (void)hashAlg;
4338 (void)object;
4339 using bslh::hashAppend;
4340 hashAppend(hashAlg, object.documentation());
4341}
4342
4343
4344
4345 // -----------------------------------------
4346 // class BasicSchemaEnumerationElementChoice
4347 // -----------------------------------------
4348
4349// CLASS METHODS
4350// CREATORS
4351inline
4353: d_selectionId(SELECTION_ID_UNDEFINED)
4354, d_allocator_p(bslma::Default::allocator(basicAllocator))
4355{
4356}
4357
4358inline
4363
4364// MANIPULATORS
4365template <class MANIPULATOR>
4367{
4368 switch (d_selectionId) {
4370 return manipulator(&d_annotation.object(),
4372 default:
4374 return -1;
4375 }
4376}
4377
4378inline
4384
4385// ACCESSORS
4386inline
4388{
4389 return d_selectionId;
4390}
4391
4392template <class ACCESSOR>
4394{
4395 switch (d_selectionId) {
4397 return accessor(d_annotation.object(),
4399 default:
4400 BSLS_ASSERT(SELECTION_ID_UNDEFINED == d_selectionId);
4401 return -1;
4402 }
4403}
4404
4405inline
4411
4412inline
4414{
4415 return SELECTION_ID_ANNOTATION == d_selectionId;
4416}
4417
4418inline
4420{
4421 return SELECTION_ID_UNDEFINED == d_selectionId;
4422}
4423
4424template <typename HASH_ALGORITHM>
4425void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaEnumerationElementChoice& object)
4426{
4428 using bslh::hashAppend;
4429 hashAppend(hashAlg, object.selectionId());
4430 switch (object.selectionId()) {
4431 case Class::SELECTION_ID_ANNOTATION:
4432 hashAppend(hashAlg, object.annotation());
4433 break;
4434 default:
4435 BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == object.selectionId());
4436 }
4437}
4438
4439
4440 // -----------------------------------
4441 // class BasicSchemaEnumerationElement
4442 // -----------------------------------
4443
4444// CLASS METHODS
4445// MANIPULATORS
4446template <class MANIPULATOR>
4448{
4449 int ret;
4450
4451 ret = manipulator(&d_value, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_VALUE]);
4452 if (ret) {
4453 return ret;
4454 }
4455
4456 ret = manipulator(&d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
4457 if (ret) {
4458 return ret;
4459 }
4460
4461 return ret;
4462}
4463
4464template <class MANIPULATOR>
4465int BasicSchemaEnumerationElement::manipulateAttribute(MANIPULATOR& manipulator, int id)
4466{
4467 enum { NOT_FOUND = -1 };
4468
4469 switch (id) {
4470 case ATTRIBUTE_ID_VALUE: {
4471 return manipulator(&d_value, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_VALUE]);
4472 }
4473 case ATTRIBUTE_ID_CHOICE: {
4474 return manipulator(&d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
4475 }
4476 default:
4477 return NOT_FOUND;
4478 }
4479}
4480
4481template <class MANIPULATOR>
4483 MANIPULATOR& manipulator,
4484 const char *name,
4485 int nameLength)
4486{
4487 enum { NOT_FOUND = -1 };
4488
4489 const bdlat_AttributeInfo *attributeInfo =
4490 lookupAttributeInfo(name, nameLength);
4491 if (0 == attributeInfo) {
4492 return NOT_FOUND;
4493 }
4494
4495 return manipulateAttribute(manipulator, attributeInfo->d_id);
4496}
4497
4498inline
4503
4504inline
4509
4510// ACCESSORS
4511template <class ACCESSOR>
4513{
4514 int ret;
4515
4516 ret = accessor(d_value, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_VALUE]);
4517 if (ret) {
4518 return ret;
4519 }
4520
4521 ret = accessor(d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
4522 if (ret) {
4523 return ret;
4524 }
4525
4526 return ret;
4527}
4528
4529template <class ACCESSOR>
4530int BasicSchemaEnumerationElement::accessAttribute(ACCESSOR& accessor, int id) const
4531{
4532 enum { NOT_FOUND = -1 };
4533
4534 switch (id) {
4535 case ATTRIBUTE_ID_VALUE: {
4536 return accessor(d_value, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_VALUE]);
4537 }
4538 case ATTRIBUTE_ID_CHOICE: {
4539 return accessor(d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
4540 }
4541 default:
4542 return NOT_FOUND;
4543 }
4544}
4545
4546template <class ACCESSOR>
4548 ACCESSOR& accessor,
4549 const char *name,
4550 int nameLength) const
4551{
4552 enum { NOT_FOUND = -1 };
4553
4554 const bdlat_AttributeInfo *attributeInfo =
4555 lookupAttributeInfo(name, nameLength);
4556 if (0 == attributeInfo) {
4557 return NOT_FOUND;
4558 }
4559
4560 return accessAttribute(accessor, attributeInfo->d_id);
4561}
4562
4563inline
4565{
4566 return d_value;
4567}
4568
4569inline
4574
4575template <typename HASH_ALGORITHM>
4576void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaEnumerationElement& object)
4577{
4578 (void)hashAlg;
4579 (void)object;
4580 using bslh::hashAppend;
4581 hashAppend(hashAlg, object.value());
4582 hashAppend(hashAlg, object.choice());
4583}
4584
4585
4586
4587 // -----------------------------------------
4588 // class BasicSchemaRestrictionElementChoice
4589 // -----------------------------------------
4590
4591// CLASS METHODS
4592// CREATORS
4593inline
4595: d_selectionId(SELECTION_ID_UNDEFINED)
4596, d_allocator_p(bslma::Default::allocator(basicAllocator))
4597{
4598}
4599
4600inline
4605
4606// MANIPULATORS
4607template <class MANIPULATOR>
4609{
4610 switch (d_selectionId) {
4612 return manipulator(&d_annotation.object(),
4615 return manipulator(&d_enumeration.object(),
4617 default:
4619 return -1;
4620 }
4621}
4622
4623inline
4629
4630inline
4636
4637// ACCESSORS
4638inline
4640{
4641 return d_selectionId;
4642}
4643
4644template <class ACCESSOR>
4646{
4647 switch (d_selectionId) {
4649 return accessor(d_annotation.object(),
4652 return accessor(d_enumeration.object(),
4654 default:
4655 BSLS_ASSERT(SELECTION_ID_UNDEFINED == d_selectionId);
4656 return -1;
4657 }
4658}
4659
4660inline
4666
4667inline
4673
4674inline
4676{
4677 return SELECTION_ID_ANNOTATION == d_selectionId;
4678}
4679
4680inline
4682{
4683 return SELECTION_ID_ENUMERATION == d_selectionId;
4684}
4685
4686inline
4688{
4689 return SELECTION_ID_UNDEFINED == d_selectionId;
4690}
4691
4692template <typename HASH_ALGORITHM>
4693void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaRestrictionElementChoice& object)
4694{
4696 using bslh::hashAppend;
4697 hashAppend(hashAlg, object.selectionId());
4698 switch (object.selectionId()) {
4699 case Class::SELECTION_ID_ANNOTATION:
4700 hashAppend(hashAlg, object.annotation());
4701 break;
4702 case Class::SELECTION_ID_ENUMERATION:
4703 hashAppend(hashAlg, object.enumeration());
4704 break;
4705 default:
4706 BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == object.selectionId());
4707 }
4708}
4709
4710
4711 // -----------------------------------
4712 // class BasicSchemaRestrictionElement
4713 // -----------------------------------
4714
4715// CLASS METHODS
4716// MANIPULATORS
4717template <class MANIPULATOR>
4719{
4720 int ret;
4721
4722 ret = manipulator(&d_base, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_BASE]);
4723 if (ret) {
4724 return ret;
4725 }
4726
4727 ret = manipulator(&d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
4728 if (ret) {
4729 return ret;
4730 }
4731
4732 return ret;
4733}
4734
4735template <class MANIPULATOR>
4736int BasicSchemaRestrictionElement::manipulateAttribute(MANIPULATOR& manipulator, int id)
4737{
4738 enum { NOT_FOUND = -1 };
4739
4740 switch (id) {
4741 case ATTRIBUTE_ID_BASE: {
4742 return manipulator(&d_base, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_BASE]);
4743 }
4744 case ATTRIBUTE_ID_CHOICE: {
4745 return manipulator(&d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
4746 }
4747 default:
4748 return NOT_FOUND;
4749 }
4750}
4751
4752template <class MANIPULATOR>
4754 MANIPULATOR& manipulator,
4755 const char *name,
4756 int nameLength)
4757{
4758 enum { NOT_FOUND = -1 };
4759
4760 const bdlat_AttributeInfo *attributeInfo =
4761 lookupAttributeInfo(name, nameLength);
4762 if (0 == attributeInfo) {
4763 return NOT_FOUND;
4764 }
4765
4766 return manipulateAttribute(manipulator, attributeInfo->d_id);
4767}
4768
4769inline
4774
4775inline
4780
4781// ACCESSORS
4782template <class ACCESSOR>
4784{
4785 int ret;
4786
4787 ret = accessor(d_base, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_BASE]);
4788 if (ret) {
4789 return ret;
4790 }
4791
4792 ret = accessor(d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
4793 if (ret) {
4794 return ret;
4795 }
4796
4797 return ret;
4798}
4799
4800template <class ACCESSOR>
4801int BasicSchemaRestrictionElement::accessAttribute(ACCESSOR& accessor, int id) const
4802{
4803 enum { NOT_FOUND = -1 };
4804
4805 switch (id) {
4806 case ATTRIBUTE_ID_BASE: {
4807 return accessor(d_base, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_BASE]);
4808 }
4809 case ATTRIBUTE_ID_CHOICE: {
4810 return accessor(d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
4811 }
4812 default:
4813 return NOT_FOUND;
4814 }
4815}
4816
4817template <class ACCESSOR>
4819 ACCESSOR& accessor,
4820 const char *name,
4821 int nameLength) const
4822{
4823 enum { NOT_FOUND = -1 };
4824
4825 const bdlat_AttributeInfo *attributeInfo =
4826 lookupAttributeInfo(name, nameLength);
4827 if (0 == attributeInfo) {
4828 return NOT_FOUND;
4829 }
4830
4831 return accessAttribute(accessor, attributeInfo->d_id);
4832}
4833
4834inline
4836{
4837 return d_base;
4838}
4839
4840inline
4845
4846template <typename HASH_ALGORITHM>
4847void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaRestrictionElement& object)
4848{
4849 (void)hashAlg;
4850 (void)object;
4851 using bslh::hashAppend;
4852 hashAppend(hashAlg, object.base());
4853 hashAppend(hashAlg, object.choice());
4854}
4855
4856
4857
4858 // ----------------------------------------
4859 // class BasicSchemaSimpleTypeElementChoice
4860 // ----------------------------------------
4861
4862// CLASS METHODS
4863// CREATORS
4864inline
4866: d_selectionId(SELECTION_ID_UNDEFINED)
4867, d_allocator_p(bslma::Default::allocator(basicAllocator))
4868{
4869}
4870
4871inline
4876
4877// MANIPULATORS
4878template <class MANIPULATOR>
4880{
4881 switch (d_selectionId) {
4883 return manipulator(&d_annotation.object(),
4886 return manipulator(&d_restriction.object(),
4888 default:
4890 return -1;
4891 }
4892}
4893
4894inline
4900
4901inline
4907
4908// ACCESSORS
4909inline
4911{
4912 return d_selectionId;
4913}
4914
4915template <class ACCESSOR>
4917{
4918 switch (d_selectionId) {
4920 return accessor(d_annotation.object(),
4923 return accessor(d_restriction.object(),
4925 default:
4926 BSLS_ASSERT(SELECTION_ID_UNDEFINED == d_selectionId);
4927 return -1;
4928 }
4929}
4930
4931inline
4937
4938inline
4944
4945inline
4947{
4948 return SELECTION_ID_ANNOTATION == d_selectionId;
4949}
4950
4951inline
4953{
4954 return SELECTION_ID_RESTRICTION == d_selectionId;
4955}
4956
4957inline
4959{
4960 return SELECTION_ID_UNDEFINED == d_selectionId;
4961}
4962
4963template <typename HASH_ALGORITHM>
4964void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaSimpleTypeElementChoice& object)
4965{
4967 using bslh::hashAppend;
4968 hashAppend(hashAlg, object.selectionId());
4969 switch (object.selectionId()) {
4970 case Class::SELECTION_ID_ANNOTATION:
4971 hashAppend(hashAlg, object.annotation());
4972 break;
4973 case Class::SELECTION_ID_RESTRICTION:
4974 hashAppend(hashAlg, object.restriction());
4975 break;
4976 default:
4977 BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == object.selectionId());
4978 }
4979}
4980
4981
4982 // ----------------------------------
4983 // class BasicSchemaSimpleTypeElement
4984 // ----------------------------------
4985
4986// CLASS METHODS
4987// MANIPULATORS
4988template <class MANIPULATOR>
4990{
4991 int ret;
4992
4993 ret = manipulator(&d_name, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_NAME]);
4994 if (ret) {
4995 return ret;
4996 }
4997
4998 ret = manipulator(&d_preserveEnumOrder, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_PRESERVE_ENUM_ORDER]);
4999 if (ret) {
5000 return ret;
5001 }
5002
5003 ret = manipulator(&d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
5004 if (ret) {
5005 return ret;
5006 }
5007
5008 return ret;
5009}
5010
5011template <class MANIPULATOR>
5012int BasicSchemaSimpleTypeElement::manipulateAttribute(MANIPULATOR& manipulator, int id)
5013{
5014 enum { NOT_FOUND = -1 };
5015
5016 switch (id) {
5017 case ATTRIBUTE_ID_NAME: {
5018 return manipulator(&d_name, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_NAME]);
5019 }
5021 return manipulator(&d_preserveEnumOrder, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_PRESERVE_ENUM_ORDER]);
5022 }
5023 case ATTRIBUTE_ID_CHOICE: {
5024 return manipulator(&d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
5025 }
5026 default:
5027 return NOT_FOUND;
5028 }
5029}
5030
5031template <class MANIPULATOR>
5033 MANIPULATOR& manipulator,
5034 const char *name,
5035 int nameLength)
5036{
5037 enum { NOT_FOUND = -1 };
5038
5039 const bdlat_AttributeInfo *attributeInfo =
5040 lookupAttributeInfo(name, nameLength);
5041 if (0 == attributeInfo) {
5042 return NOT_FOUND;
5043 }
5044
5045 return manipulateAttribute(manipulator, attributeInfo->d_id);
5046}
5047
5048inline
5053
5054inline
5059
5060inline
5065
5066// ACCESSORS
5067template <class ACCESSOR>
5069{
5070 int ret;
5071
5072 ret = accessor(d_name, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_NAME]);
5073 if (ret) {
5074 return ret;
5075 }
5076
5077 ret = accessor(d_preserveEnumOrder, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_PRESERVE_ENUM_ORDER]);
5078 if (ret) {
5079 return ret;
5080 }
5081
5082 ret = accessor(d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
5083 if (ret) {
5084 return ret;
5085 }
5086
5087 return ret;
5088}
5089
5090template <class ACCESSOR>
5091int BasicSchemaSimpleTypeElement::accessAttribute(ACCESSOR& accessor, int id) const
5092{
5093 enum { NOT_FOUND = -1 };
5094
5095 switch (id) {
5096 case ATTRIBUTE_ID_NAME: {
5097 return accessor(d_name, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_NAME]);
5098 }
5100 return accessor(d_preserveEnumOrder, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_PRESERVE_ENUM_ORDER]);
5101 }
5102 case ATTRIBUTE_ID_CHOICE: {
5103 return accessor(d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
5104 }
5105 default:
5106 return NOT_FOUND;
5107 }
5108}
5109
5110template <class ACCESSOR>
5112 ACCESSOR& accessor,
5113 const char *name,
5114 int nameLength) const
5115{
5116 enum { NOT_FOUND = -1 };
5117
5118 const bdlat_AttributeInfo *attributeInfo =
5119 lookupAttributeInfo(name, nameLength);
5120 if (0 == attributeInfo) {
5121 return NOT_FOUND;
5122 }
5123
5124 return accessAttribute(accessor, attributeInfo->d_id);
5125}
5126
5127inline
5129{
5130 return d_name;
5131}
5132
5133inline
5135{
5136 return d_preserveEnumOrder;
5137}
5138
5139inline
5144
5145template <typename HASH_ALGORITHM>
5146void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaSimpleTypeElement& object)
5147{
5148 (void)hashAlg;
5149 (void)object;
5150 using bslh::hashAppend;
5151 hashAppend(hashAlg, object.name());
5152 hashAppend(hashAlg, object.preserveEnumOrder());
5153 hashAppend(hashAlg, object.choice());
5154}
5155
5156
5157
5158 // ------------------------------
5159 // class BasicSchemaChoiceElement
5160 // ------------------------------
5161
5162// CLASS METHODS
5163// MANIPULATORS
5164template <class MANIPULATOR>
5166{
5167 int ret;
5168
5169 ret = manipulator(&d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
5170 if (ret) {
5171 return ret;
5172 }
5173
5174 return ret;
5175}
5176
5177template <class MANIPULATOR>
5178int BasicSchemaChoiceElement::manipulateAttribute(MANIPULATOR& manipulator, int id)
5179{
5180 enum { NOT_FOUND = -1 };
5181
5182 switch (id) {
5183 case ATTRIBUTE_ID_CHOICE: {
5184 return manipulator(&d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
5185 }
5186 default:
5187 return NOT_FOUND;
5188 }
5189}
5190
5191template <class MANIPULATOR>
5193 MANIPULATOR& manipulator,
5194 const char *name,
5195 int nameLength)
5196{
5197 enum { NOT_FOUND = -1 };
5198
5199 const bdlat_AttributeInfo *attributeInfo =
5200 lookupAttributeInfo(name, nameLength);
5201 if (0 == attributeInfo) {
5202 return NOT_FOUND;
5203 }
5204
5205 return manipulateAttribute(manipulator, attributeInfo->d_id);
5206}
5207
5208inline
5213
5214// ACCESSORS
5215template <class ACCESSOR>
5217{
5218 int ret;
5219
5220 ret = accessor(d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
5221 if (ret) {
5222 return ret;
5223 }
5224
5225 return ret;
5226}
5227
5228template <class ACCESSOR>
5229int BasicSchemaChoiceElement::accessAttribute(ACCESSOR& accessor, int id) const
5230{
5231 enum { NOT_FOUND = -1 };
5232
5233 switch (id) {
5234 case ATTRIBUTE_ID_CHOICE: {
5235 return accessor(d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
5236 }
5237 default:
5238 return NOT_FOUND;
5239 }
5240}
5241
5242template <class ACCESSOR>
5244 ACCESSOR& accessor,
5245 const char *name,
5246 int nameLength) const
5247{
5248 enum { NOT_FOUND = -1 };
5249
5250 const bdlat_AttributeInfo *attributeInfo =
5251 lookupAttributeInfo(name, nameLength);
5252 if (0 == attributeInfo) {
5253 return NOT_FOUND;
5254 }
5255
5256 return accessAttribute(accessor, attributeInfo->d_id);
5257}
5258
5259inline
5264
5265template <typename HASH_ALGORITHM>
5266void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaChoiceElement& object)
5267{
5268 (void)hashAlg;
5269 (void)object;
5270 using bslh::hashAppend;
5271 hashAppend(hashAlg, object.choice());
5272}
5273
5274
5275
5276 // ------------------------------------
5277 // class BasicSchemaChoiceElementChoice
5278 // ------------------------------------
5279
5280// CLASS METHODS
5281// CREATORS
5282inline
5284: d_selectionId(SELECTION_ID_UNDEFINED)
5285, d_allocator_p(bslma::Default::allocator(basicAllocator))
5286{
5287}
5288
5289inline
5294
5295// MANIPULATORS
5296template <class MANIPULATOR>
5298{
5299 switch (d_selectionId) {
5301 return manipulator(&d_annotation.object(),
5304 return manipulator(d_element,
5306 default:
5308 return -1;
5309 }
5310}
5311
5312inline
5318
5319inline
5325
5326// ACCESSORS
5327inline
5329{
5330 return d_selectionId;
5331}
5332
5333template <class ACCESSOR>
5335{
5336 switch (d_selectionId) {
5338 return accessor(d_annotation.object(),
5341 return accessor(*d_element,
5343 default:
5344 BSLS_ASSERT(SELECTION_ID_UNDEFINED == d_selectionId);
5345 return -1;
5346 }
5347}
5348
5349inline
5355
5356inline
5358{
5359 BSLS_ASSERT(SELECTION_ID_ELEMENT == d_selectionId);
5360 return *d_element;
5361}
5362
5363inline
5365{
5366 return SELECTION_ID_ANNOTATION == d_selectionId;
5367}
5368
5369inline
5371{
5372 return SELECTION_ID_ELEMENT == d_selectionId;
5373}
5374
5375inline
5377{
5378 return SELECTION_ID_UNDEFINED == d_selectionId;
5379}
5380
5381template <typename HASH_ALGORITHM>
5382void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaChoiceElementChoice& object)
5383{
5385 using bslh::hashAppend;
5386 hashAppend(hashAlg, object.selectionId());
5387 switch (object.selectionId()) {
5388 case Class::SELECTION_ID_ANNOTATION:
5389 hashAppend(hashAlg, object.annotation());
5390 break;
5391 case Class::SELECTION_ID_ELEMENT:
5392 hashAppend(hashAlg, object.element());
5393 break;
5394 default:
5395 BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == object.selectionId());
5396 }
5397}
5398
5399
5400 // -----------------------------------
5401 // class BasicSchemaComplexTypeElement
5402 // -----------------------------------
5403
5404// CLASS METHODS
5405// MANIPULATORS
5406template <class MANIPULATOR>
5408{
5409 int ret;
5410
5411 ret = manipulator(&d_name, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_NAME]);
5412 if (ret) {
5413 return ret;
5414 }
5415
5416 ret = manipulator(&d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
5417 if (ret) {
5418 return ret;
5419 }
5420
5421 return ret;
5422}
5423
5424template <class MANIPULATOR>
5425int BasicSchemaComplexTypeElement::manipulateAttribute(MANIPULATOR& manipulator, int id)
5426{
5427 enum { NOT_FOUND = -1 };
5428
5429 switch (id) {
5430 case ATTRIBUTE_ID_NAME: {
5431 return manipulator(&d_name, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_NAME]);
5432 }
5433 case ATTRIBUTE_ID_CHOICE: {
5434 return manipulator(&d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
5435 }
5436 default:
5437 return NOT_FOUND;
5438 }
5439}
5440
5441template <class MANIPULATOR>
5443 MANIPULATOR& manipulator,
5444 const char *name,
5445 int nameLength)
5446{
5447 enum { NOT_FOUND = -1 };
5448
5449 const bdlat_AttributeInfo *attributeInfo =
5450 lookupAttributeInfo(name, nameLength);
5451 if (0 == attributeInfo) {
5452 return NOT_FOUND;
5453 }
5454
5455 return manipulateAttribute(manipulator, attributeInfo->d_id);
5456}
5457
5458inline
5463
5464inline
5469
5470// ACCESSORS
5471template <class ACCESSOR>
5473{
5474 int ret;
5475
5476 ret = accessor(d_name, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_NAME]);
5477 if (ret) {
5478 return ret;
5479 }
5480
5481 ret = accessor(d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
5482 if (ret) {
5483 return ret;
5484 }
5485
5486 return ret;
5487}
5488
5489template <class ACCESSOR>
5490int BasicSchemaComplexTypeElement::accessAttribute(ACCESSOR& accessor, int id) const
5491{
5492 enum { NOT_FOUND = -1 };
5493
5494 switch (id) {
5495 case ATTRIBUTE_ID_NAME: {
5496 return accessor(d_name, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_NAME]);
5497 }
5498 case ATTRIBUTE_ID_CHOICE: {
5499 return accessor(d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
5500 }
5501 default:
5502 return NOT_FOUND;
5503 }
5504}
5505
5506template <class ACCESSOR>
5508 ACCESSOR& accessor,
5509 const char *name,
5510 int nameLength) const
5511{
5512 enum { NOT_FOUND = -1 };
5513
5514 const bdlat_AttributeInfo *attributeInfo =
5515 lookupAttributeInfo(name, nameLength);
5516 if (0 == attributeInfo) {
5517 return NOT_FOUND;
5518 }
5519
5520 return accessAttribute(accessor, attributeInfo->d_id);
5521}
5522
5523inline
5525{
5526 return d_name;
5527}
5528
5529inline
5534
5535template <typename HASH_ALGORITHM>
5536void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaComplexTypeElement& object)
5537{
5538 (void)hashAlg;
5539 (void)object;
5540 using bslh::hashAppend;
5541 hashAppend(hashAlg, object.name());
5542 hashAppend(hashAlg, object.choice());
5543}
5544
5545
5546
5547 // -----------------------------------------
5548 // class BasicSchemaComplexTypeElementChoice
5549 // -----------------------------------------
5550
5551// CLASS METHODS
5552// CREATORS
5553inline
5555: d_selectionId(SELECTION_ID_UNDEFINED)
5556, d_allocator_p(bslma::Default::allocator(basicAllocator))
5557{
5558}
5559
5560inline
5565
5566// MANIPULATORS
5567template <class MANIPULATOR>
5585
5586inline
5592
5593inline
5599
5600inline
5606
5607// ACCESSORS
5608inline
5610{
5611 return d_selectionId;
5612}
5613
5614template <class ACCESSOR>
5616{
5617 switch (d_selectionId) {
5619 return accessor(d_annotation.object(),
5622 return accessor(*d_sequence,
5625 return accessor(*d_choice,
5627 default:
5628 BSLS_ASSERT(SELECTION_ID_UNDEFINED == d_selectionId);
5629 return -1;
5630 }
5631}
5632
5633inline
5639
5640inline
5646
5647inline
5653
5654inline
5656{
5657 return SELECTION_ID_ANNOTATION == d_selectionId;
5658}
5659
5660inline
5662{
5663 return SELECTION_ID_SEQUENCE == d_selectionId;
5664}
5665
5666inline
5668{
5669 return SELECTION_ID_CHOICE == d_selectionId;
5670}
5671
5672inline
5674{
5675 return SELECTION_ID_UNDEFINED == d_selectionId;
5676}
5677
5678template <typename HASH_ALGORITHM>
5679void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaComplexTypeElementChoice& object)
5680{
5682 using bslh::hashAppend;
5683 hashAppend(hashAlg, object.selectionId());
5684 switch (object.selectionId()) {
5685 case Class::SELECTION_ID_ANNOTATION:
5686 hashAppend(hashAlg, object.annotation());
5687 break;
5688 case Class::SELECTION_ID_SEQUENCE:
5689 hashAppend(hashAlg, object.sequence());
5690 break;
5691 case Class::SELECTION_ID_CHOICE:
5692 hashAppend(hashAlg, object.choice());
5693 break;
5694 default:
5695 BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == object.selectionId());
5696 }
5697}
5698
5699
5700 // ------------------------
5701 // class BasicSchemaElement
5702 // ------------------------
5703
5704// CLASS METHODS
5705// MANIPULATORS
5706template <class MANIPULATOR>
5707int BasicSchemaElement::manipulateAttributes(MANIPULATOR& manipulator)
5708{
5709 int ret;
5710
5711 ret = manipulator(&d_name, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_NAME]);
5712 if (ret) {
5713 return ret;
5714 }
5715
5716 ret = manipulator(&d_type, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_TYPE]);
5717 if (ret) {
5718 return ret;
5719 }
5720
5721 ret = manipulator(&d_minOccurs, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_MIN_OCCURS]);
5722 if (ret) {
5723 return ret;
5724 }
5725
5726 ret = manipulator(&d_maxOccurs, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_MAX_OCCURS]);
5727 if (ret) {
5728 return ret;
5729 }
5730
5731 ret = manipulator(&d_default, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_DEFAULT_VALUE]);
5732 if (ret) {
5733 return ret;
5734 }
5735
5736 ret = manipulator(&d_cppdefault, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CPPDEFAULT]);
5737 if (ret) {
5738 return ret;
5739 }
5740
5741 ret = manipulator(&d_cpptype, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CPPTYPE]);
5742 if (ret) {
5743 return ret;
5744 }
5745
5746 ret = manipulator(&d_allocatesMemory, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ALLOCATES_MEMORY]);
5747 if (ret) {
5748 return ret;
5749 }
5750
5751 ret = manipulator(&d_allowsDirectManipulation, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ALLOWS_DIRECT_MANIPULATION]);
5752 if (ret) {
5753 return ret;
5754 }
5755
5756 ret = manipulator(&d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
5757 if (ret) {
5758 return ret;
5759 }
5760
5761 return ret;
5762}
5763
5764template <class MANIPULATOR>
5765int BasicSchemaElement::manipulateAttribute(MANIPULATOR& manipulator, int id)
5766{
5767 enum { NOT_FOUND = -1 };
5768
5769 switch (id) {
5770 case ATTRIBUTE_ID_NAME: {
5771 return manipulator(&d_name, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_NAME]);
5772 }
5773 case ATTRIBUTE_ID_TYPE: {
5774 return manipulator(&d_type, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_TYPE]);
5775 }
5777 return manipulator(&d_minOccurs, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_MIN_OCCURS]);
5778 }
5780 return manipulator(&d_maxOccurs, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_MAX_OCCURS]);
5781 }
5783 return manipulator(&d_default, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_DEFAULT_VALUE]);
5784 }
5786 return manipulator(&d_cppdefault, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CPPDEFAULT]);
5787 }
5788 case ATTRIBUTE_ID_CPPTYPE: {
5789 return manipulator(&d_cpptype, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CPPTYPE]);
5790 }
5792 return manipulator(&d_allocatesMemory, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ALLOCATES_MEMORY]);
5793 }
5795 return manipulator(&d_allowsDirectManipulation, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ALLOWS_DIRECT_MANIPULATION]);
5796 }
5797 case ATTRIBUTE_ID_CHOICE: {
5798 return manipulator(&d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
5799 }
5800 default:
5801 return NOT_FOUND;
5802 }
5803}
5804
5805template <class MANIPULATOR>
5807 MANIPULATOR& manipulator,
5808 const char *name,
5809 int nameLength)
5810{
5811 enum { NOT_FOUND = -1 };
5812
5813 const bdlat_AttributeInfo *attributeInfo =
5814 lookupAttributeInfo(name, nameLength);
5815 if (0 == attributeInfo) {
5816 return NOT_FOUND;
5817 }
5818
5819 return manipulateAttribute(manipulator, attributeInfo->d_id);
5820}
5821
5822inline
5827
5828inline
5833
5834inline
5839
5840inline
5845
5846inline
5851
5852inline
5857
5858inline
5863
5864inline
5866{
5867 return d_allocatesMemory;
5868}
5869
5870inline
5872{
5873 return d_allowsDirectManipulation;
5874}
5875
5876inline
5881
5882// ACCESSORS
5883template <class ACCESSOR>
5884int BasicSchemaElement::accessAttributes(ACCESSOR& accessor) const
5885{
5886 int ret;
5887
5888 ret = accessor(d_name, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_NAME]);
5889 if (ret) {
5890 return ret;
5891 }
5892
5893 ret = accessor(d_type, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_TYPE]);
5894 if (ret) {
5895 return ret;
5896 }
5897
5898 ret = accessor(d_minOccurs, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_MIN_OCCURS]);
5899 if (ret) {
5900 return ret;
5901 }
5902
5903 ret = accessor(d_maxOccurs, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_MAX_OCCURS]);
5904 if (ret) {
5905 return ret;
5906 }
5907
5908 ret = accessor(d_default, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_DEFAULT_VALUE]);
5909 if (ret) {
5910 return ret;
5911 }
5912
5913 ret = accessor(d_cppdefault, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CPPDEFAULT]);
5914 if (ret) {
5915 return ret;
5916 }
5917
5918 ret = accessor(d_cpptype, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CPPTYPE]);
5919 if (ret) {
5920 return ret;
5921 }
5922
5923 ret = accessor(d_allocatesMemory, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ALLOCATES_MEMORY]);
5924 if (ret) {
5925 return ret;
5926 }
5927
5928 ret = accessor(d_allowsDirectManipulation, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ALLOWS_DIRECT_MANIPULATION]);
5929 if (ret) {
5930 return ret;
5931 }
5932
5933 ret = accessor(d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
5934 if (ret) {
5935 return ret;
5936 }
5937
5938 return ret;
5939}
5940
5941template <class ACCESSOR>
5942int BasicSchemaElement::accessAttribute(ACCESSOR& accessor, int id) const
5943{
5944 enum { NOT_FOUND = -1 };
5945
5946 switch (id) {
5947 case ATTRIBUTE_ID_NAME: {
5948 return accessor(d_name, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_NAME]);
5949 }
5950 case ATTRIBUTE_ID_TYPE: {
5951 return accessor(d_type, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_TYPE]);
5952 }
5954 return accessor(d_minOccurs, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_MIN_OCCURS]);
5955 }
5957 return accessor(d_maxOccurs, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_MAX_OCCURS]);
5958 }
5960 return accessor(d_default, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_DEFAULT_VALUE]);
5961 }
5963 return accessor(d_cppdefault, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CPPDEFAULT]);
5964 }
5965 case ATTRIBUTE_ID_CPPTYPE: {
5966 return accessor(d_cpptype, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CPPTYPE]);
5967 }
5969 return accessor(d_allocatesMemory, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ALLOCATES_MEMORY]);
5970 }
5972 return accessor(d_allowsDirectManipulation, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ALLOWS_DIRECT_MANIPULATION]);
5973 }
5974 case ATTRIBUTE_ID_CHOICE: {
5975 return accessor(d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
5976 }
5977 default:
5978 return NOT_FOUND;
5979 }
5980}
5981
5982template <class ACCESSOR>
5984 ACCESSOR& accessor,
5985 const char *name,
5986 int nameLength) const
5987{
5988 enum { NOT_FOUND = -1 };
5989
5990 const bdlat_AttributeInfo *attributeInfo =
5991 lookupAttributeInfo(name, nameLength);
5992 if (0 == attributeInfo) {
5993 return NOT_FOUND;
5994 }
5995
5996 return accessAttribute(accessor, attributeInfo->d_id);
5997}
5998
5999inline
6001{
6002 return d_name;
6003}
6004
6005inline
6007{
6008 return d_type;
6009}
6010
6011inline
6013{
6014 return d_minOccurs;
6015}
6016
6017inline
6019{
6020 return d_maxOccurs;
6021}
6022
6023inline
6025{
6026 return d_default;
6027}
6028
6029inline
6031{
6032 return d_cppdefault;
6033}
6034
6035inline
6037{
6038 return d_cpptype;
6039}
6040
6041inline
6043{
6044 return d_allocatesMemory;
6045}
6046
6047inline
6049{
6050 return d_allowsDirectManipulation;
6051}
6052
6053inline
6055{
6056 return d_choice;
6057}
6058
6059template <typename HASH_ALGORITHM>
6060void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaElement& object)
6061{
6062 (void)hashAlg;
6063 (void)object;
6064 using bslh::hashAppend;
6065 hashAppend(hashAlg, object.name());
6066 hashAppend(hashAlg, object.type());
6067 hashAppend(hashAlg, object.minOccurs());
6068 hashAppend(hashAlg, object.maxOccurs());
6069 hashAppend(hashAlg, object.defaultValue());
6070 hashAppend(hashAlg, object.cppdefault());
6071 hashAppend(hashAlg, object.cpptype());
6072 hashAppend(hashAlg, object.allocatesMemory());
6073 hashAppend(hashAlg, object.allowsDirectManipulation());
6074 hashAppend(hashAlg, object.choice());
6075}
6076
6077
6078
6079 // ------------------------------
6080 // class BasicSchemaElementChoice
6081 // ------------------------------
6082
6083// CLASS METHODS
6084// CREATORS
6085inline
6087: d_selectionId(SELECTION_ID_UNDEFINED)
6088, d_allocator_p(bslma::Default::allocator(basicAllocator))
6089{
6090}
6091
6092inline
6097
6098// MANIPULATORS
6099template <class MANIPULATOR>
6101{
6102 switch (d_selectionId) {
6104 return manipulator(&d_annotation.object(),
6107 return manipulator(&d_simpleType.object(),
6110 return manipulator(d_complexType,
6112 default:
6114 return -1;
6115 }
6116}
6117
6118inline
6124
6125inline
6131
6132inline
6138
6139// ACCESSORS
6140inline
6142{
6143 return d_selectionId;
6144}
6145
6146template <class ACCESSOR>
6148{
6149 switch (d_selectionId) {
6151 return accessor(d_annotation.object(),
6154 return accessor(d_simpleType.object(),
6157 return accessor(*d_complexType,
6159 default:
6160 BSLS_ASSERT(SELECTION_ID_UNDEFINED == d_selectionId);
6161 return -1;
6162 }
6163}
6164
6165inline
6167{
6168 BSLS_ASSERT(SELECTION_ID_ANNOTATION == d_selectionId);
6169 return d_annotation.object();
6170}
6171
6172inline
6174{
6175 BSLS_ASSERT(SELECTION_ID_SIMPLE_TYPE == d_selectionId);
6176 return d_simpleType.object();
6177}
6178
6179inline
6185
6186inline
6188{
6189 return SELECTION_ID_ANNOTATION == d_selectionId;
6190}
6191
6192inline
6194{
6195 return SELECTION_ID_SIMPLE_TYPE == d_selectionId;
6196}
6197
6198inline
6200{
6201 return SELECTION_ID_COMPLEX_TYPE == d_selectionId;
6202}
6203
6204inline
6206{
6207 return SELECTION_ID_UNDEFINED == d_selectionId;
6208}
6209
6210template <typename HASH_ALGORITHM>
6211void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaElementChoice& object)
6212{
6214 using bslh::hashAppend;
6215 hashAppend(hashAlg, object.selectionId());
6216 switch (object.selectionId()) {
6217 case Class::SELECTION_ID_ANNOTATION:
6218 hashAppend(hashAlg, object.annotation());
6219 break;
6220 case Class::SELECTION_ID_SIMPLE_TYPE:
6221 hashAppend(hashAlg, object.simpleType());
6222 break;
6223 case Class::SELECTION_ID_COMPLEX_TYPE:
6224 hashAppend(hashAlg, object.complexType());
6225 break;
6226 default:
6227 BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == object.selectionId());
6228 }
6229}
6230
6231
6232 // --------------------------------
6233 // class BasicSchemaSequenceElement
6234 // --------------------------------
6235
6236// CLASS METHODS
6237// MANIPULATORS
6238template <class MANIPULATOR>
6240{
6241 int ret;
6242
6243 ret = manipulator(&d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
6244 if (ret) {
6245 return ret;
6246 }
6247
6248 return ret;
6249}
6250
6251template <class MANIPULATOR>
6252int BasicSchemaSequenceElement::manipulateAttribute(MANIPULATOR& manipulator, int id)
6253{
6254 enum { NOT_FOUND = -1 };
6255
6256 switch (id) {
6257 case ATTRIBUTE_ID_CHOICE: {
6258 return manipulator(&d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
6259 }
6260 default:
6261 return NOT_FOUND;
6262 }
6263}
6264
6265template <class MANIPULATOR>
6267 MANIPULATOR& manipulator,
6268 const char *name,
6269 int nameLength)
6270{
6271 enum { NOT_FOUND = -1 };
6272
6273 const bdlat_AttributeInfo *attributeInfo =
6274 lookupAttributeInfo(name, nameLength);
6275 if (0 == attributeInfo) {
6276 return NOT_FOUND;
6277 }
6278
6279 return manipulateAttribute(manipulator, attributeInfo->d_id);
6280}
6281
6282inline
6287
6288// ACCESSORS
6289template <class ACCESSOR>
6291{
6292 int ret;
6293
6294 ret = accessor(d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
6295 if (ret) {
6296 return ret;
6297 }
6298
6299 return ret;
6300}
6301
6302template <class ACCESSOR>
6303int BasicSchemaSequenceElement::accessAttribute(ACCESSOR& accessor, int id) const
6304{
6305 enum { NOT_FOUND = -1 };
6306
6307 switch (id) {
6308 case ATTRIBUTE_ID_CHOICE: {
6309 return accessor(d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
6310 }
6311 default:
6312 return NOT_FOUND;
6313 }
6314}
6315
6316template <class ACCESSOR>
6318 ACCESSOR& accessor,
6319 const char *name,
6320 int nameLength) const
6321{
6322 enum { NOT_FOUND = -1 };
6323
6324 const bdlat_AttributeInfo *attributeInfo =
6325 lookupAttributeInfo(name, nameLength);
6326 if (0 == attributeInfo) {
6327 return NOT_FOUND;
6328 }
6329
6330 return accessAttribute(accessor, attributeInfo->d_id);
6331}
6332
6333inline
6338
6339template <typename HASH_ALGORITHM>
6340void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaSequenceElement& object)
6341{
6342 (void)hashAlg;
6343 (void)object;
6344 using bslh::hashAppend;
6345 hashAppend(hashAlg, object.choice());
6346}
6347
6348
6349
6350 // --------------------------------------
6351 // class BasicSchemaSequenceElementChoice
6352 // --------------------------------------
6353
6354// CLASS METHODS
6355// CREATORS
6356inline
6358: d_selectionId(SELECTION_ID_UNDEFINED)
6359, d_allocator_p(bslma::Default::allocator(basicAllocator))
6360{
6361}
6362
6363inline
6368
6369// MANIPULATORS
6370template <class MANIPULATOR>
6372{
6373 switch (d_selectionId) {
6375 return manipulator(&d_annotation.object(),
6378 return manipulator(d_element,
6380 default:
6382 return -1;
6383 }
6384}
6385
6386inline
6392
6393inline
6399
6400// ACCESSORS
6401inline
6403{
6404 return d_selectionId;
6405}
6406
6407template <class ACCESSOR>
6409{
6410 switch (d_selectionId) {
6412 return accessor(d_annotation.object(),
6415 return accessor(*d_element,
6417 default:
6418 BSLS_ASSERT(SELECTION_ID_UNDEFINED == d_selectionId);
6419 return -1;
6420 }
6421}
6422
6423inline
6429
6430inline
6432{
6433 BSLS_ASSERT(SELECTION_ID_ELEMENT == d_selectionId);
6434 return *d_element;
6435}
6436
6437inline
6439{
6440 return SELECTION_ID_ANNOTATION == d_selectionId;
6441}
6442
6443inline
6445{
6446 return SELECTION_ID_ELEMENT == d_selectionId;
6447}
6448
6449inline
6451{
6452 return SELECTION_ID_UNDEFINED == d_selectionId;
6453}
6454
6455template <typename HASH_ALGORITHM>
6456void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaSequenceElementChoice& object)
6457{
6459 using bslh::hashAppend;
6460 hashAppend(hashAlg, object.selectionId());
6461 switch (object.selectionId()) {
6462 case Class::SELECTION_ID_ANNOTATION:
6463 hashAppend(hashAlg, object.annotation());
6464 break;
6465 case Class::SELECTION_ID_ELEMENT:
6466 hashAppend(hashAlg, object.element());
6467 break;
6468 default:
6469 BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == object.selectionId());
6470 }
6471}
6472
6473
6474 // -----------------------
6475 // class BasicSchemaChoice
6476 // -----------------------
6477
6478// CLASS METHODS
6479// CREATORS
6480inline
6482: d_selectionId(SELECTION_ID_UNDEFINED)
6483, d_allocator_p(bslma::Default::allocator(basicAllocator))
6484{
6485}
6486
6487inline
6492
6493// MANIPULATORS
6494template <class MANIPULATOR>
6495int BasicSchemaChoice::manipulateSelection(MANIPULATOR& manipulator)
6496{
6497 switch (d_selectionId) {
6499 return manipulator(&d_annotation.object(),
6502 return manipulator(&d_simpleType.object(),
6505 return manipulator(d_complexType,
6507 default:
6509 return -1;
6510 }
6511}
6512
6513inline
6519
6520inline
6526
6527inline
6533
6534// ACCESSORS
6535inline
6537{
6538 return d_selectionId;
6539}
6540
6541template <class ACCESSOR>
6542int BasicSchemaChoice::accessSelection(ACCESSOR& accessor) const
6543{
6544 switch (d_selectionId) {
6546 return accessor(d_annotation.object(),
6549 return accessor(d_simpleType.object(),
6552 return accessor(*d_complexType,
6554 default:
6555 BSLS_ASSERT(SELECTION_ID_UNDEFINED == d_selectionId);
6556 return -1;
6557 }
6558}
6559
6560inline
6562{
6563 BSLS_ASSERT(SELECTION_ID_ANNOTATION == d_selectionId);
6564 return d_annotation.object();
6565}
6566
6567inline
6569{
6570 BSLS_ASSERT(SELECTION_ID_SIMPLE_TYPE == d_selectionId);
6571 return d_simpleType.object();
6572}
6573
6574inline
6580
6581inline
6583{
6584 return SELECTION_ID_ANNOTATION == d_selectionId;
6585}
6586
6587inline
6589{
6590 return SELECTION_ID_SIMPLE_TYPE == d_selectionId;
6591}
6592
6593inline
6595{
6596 return SELECTION_ID_COMPLEX_TYPE == d_selectionId;
6597}
6598
6599inline
6601{
6602 return SELECTION_ID_UNDEFINED == d_selectionId;
6603}
6604
6605template <typename HASH_ALGORITHM>
6606void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchemaChoice& object)
6607{
6608 typedef s_baltst::BasicSchemaChoice Class;
6609 using bslh::hashAppend;
6610 hashAppend(hashAlg, object.selectionId());
6611 switch (object.selectionId()) {
6612 case Class::SELECTION_ID_ANNOTATION:
6613 hashAppend(hashAlg, object.annotation());
6614 break;
6615 case Class::SELECTION_ID_SIMPLE_TYPE:
6616 hashAppend(hashAlg, object.simpleType());
6617 break;
6618 case Class::SELECTION_ID_COMPLEX_TYPE:
6619 hashAppend(hashAlg, object.complexType());
6620 break;
6621 default:
6622 BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == object.selectionId());
6623 }
6624}
6625
6626
6627 // -----------------
6628 // class BasicSchema
6629 // -----------------
6630
6631// CLASS METHODS
6632// MANIPULATORS
6633template <class MANIPULATOR>
6634int BasicSchema::manipulateAttributes(MANIPULATOR& manipulator)
6635{
6636 int ret;
6637
6638 ret = manipulator(&d_xs, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_XS]);
6639 if (ret) {
6640 return ret;
6641 }
6642
6643 ret = manipulator(&d_bdem, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_BDEM]);
6644 if (ret) {
6645 return ret;
6646 }
6647
6648 ret = manipulator(&d_package, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_PACKAGE]);
6649 if (ret) {
6650 return ret;
6651 }
6652
6653 ret = manipulator(&d_elementFormDefault, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ELEMENT_FORM_DEFAULT]);
6654 if (ret) {
6655 return ret;
6656 }
6657
6658 ret = manipulator(&d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
6659 if (ret) {
6660 return ret;
6661 }
6662
6663 return ret;
6664}
6665
6666template <class MANIPULATOR>
6667int BasicSchema::manipulateAttribute(MANIPULATOR& manipulator, int id)
6668{
6669 enum { NOT_FOUND = -1 };
6670
6671 switch (id) {
6672 case ATTRIBUTE_ID_XS: {
6673 return manipulator(&d_xs, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_XS]);
6674 }
6675 case ATTRIBUTE_ID_BDEM: {
6676 return manipulator(&d_bdem, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_BDEM]);
6677 }
6678 case ATTRIBUTE_ID_PACKAGE: {
6679 return manipulator(&d_package, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_PACKAGE]);
6680 }
6682 return manipulator(&d_elementFormDefault, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ELEMENT_FORM_DEFAULT]);
6683 }
6684 case ATTRIBUTE_ID_CHOICE: {
6685 return manipulator(&d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
6686 }
6687 default:
6688 return NOT_FOUND;
6689 }
6690}
6691
6692template <class MANIPULATOR>
6694 MANIPULATOR& manipulator,
6695 const char *name,
6696 int nameLength)
6697{
6698 enum { NOT_FOUND = -1 };
6699
6700 const bdlat_AttributeInfo *attributeInfo =
6701 lookupAttributeInfo(name, nameLength);
6702 if (0 == attributeInfo) {
6703 return NOT_FOUND;
6704 }
6705
6706 return manipulateAttribute(manipulator, attributeInfo->d_id);
6707}
6708
6709inline
6711{
6712 return d_xs;
6713}
6714
6715inline
6717{
6718 return d_bdem;
6719}
6720
6721inline
6723{
6724 return d_package;
6725}
6726
6727inline
6729{
6730 return d_elementFormDefault;
6731}
6732
6733inline
6735{
6736 return d_choice;
6737}
6738
6739// ACCESSORS
6740template <class ACCESSOR>
6741int BasicSchema::accessAttributes(ACCESSOR& accessor) const
6742{
6743 int ret;
6744
6745 ret = accessor(d_xs, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_XS]);
6746 if (ret) {
6747 return ret;
6748 }
6749
6750 ret = accessor(d_bdem, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_BDEM]);
6751 if (ret) {
6752 return ret;
6753 }
6754
6755 ret = accessor(d_package, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_PACKAGE]);
6756 if (ret) {
6757 return ret;
6758 }
6759
6760 ret = accessor(d_elementFormDefault, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ELEMENT_FORM_DEFAULT]);
6761 if (ret) {
6762 return ret;
6763 }
6764
6765 ret = accessor(d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
6766 if (ret) {
6767 return ret;
6768 }
6769
6770 return ret;
6771}
6772
6773template <class ACCESSOR>
6774int BasicSchema::accessAttribute(ACCESSOR& accessor, int id) const
6775{
6776 enum { NOT_FOUND = -1 };
6777
6778 switch (id) {
6779 case ATTRIBUTE_ID_XS: {
6780 return accessor(d_xs, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_XS]);
6781 }
6782 case ATTRIBUTE_ID_BDEM: {
6783 return accessor(d_bdem, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_BDEM]);
6784 }
6785 case ATTRIBUTE_ID_PACKAGE: {
6786 return accessor(d_package, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_PACKAGE]);
6787 }
6789 return accessor(d_elementFormDefault, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_ELEMENT_FORM_DEFAULT]);
6790 }
6791 case ATTRIBUTE_ID_CHOICE: {
6792 return accessor(d_choice, ATTRIBUTE_INFO_ARRAY[ATTRIBUTE_INDEX_CHOICE]);
6793 }
6794 default:
6795 return NOT_FOUND;
6796 }
6797}
6798
6799template <class ACCESSOR>
6801 ACCESSOR& accessor,
6802 const char *name,
6803 int nameLength) const
6804{
6805 enum { NOT_FOUND = -1 };
6806
6807 const bdlat_AttributeInfo *attributeInfo =
6808 lookupAttributeInfo(name, nameLength);
6809 if (0 == attributeInfo) {
6810 return NOT_FOUND;
6811 }
6812
6813 return accessAttribute(accessor, attributeInfo->d_id);
6814}
6815
6816inline
6818{
6819 return d_xs;
6820}
6821
6822inline
6824{
6825 return d_bdem;
6826}
6827
6828inline
6830{
6831 return d_package;
6832}
6833
6834inline
6836{
6837 return d_elementFormDefault;
6838}
6839
6840inline
6842{
6843 return d_choice;
6844}
6845
6846template <typename HASH_ALGORITHM>
6847void hashAppend(HASH_ALGORITHM& hashAlg, const s_baltst::BasicSchema& object)
6848{
6849 (void)hashAlg;
6850 (void)object;
6851 using bslh::hashAppend;
6852 hashAppend(hashAlg, object.xs());
6853 hashAppend(hashAlg, object.bdem());
6854 hashAppend(hashAlg, object.package());
6855 hashAppend(hashAlg, object.elementFormDefault());
6856 hashAppend(hashAlg, object.choice());
6857}
6858
6859} // close package namespace
6860
6861// FREE FUNCTIONS
6862
6863inline
6867{
6868 return lhs.documentation() == rhs.documentation();
6869}
6870
6871inline
6875{
6876 return !(lhs == rhs);
6877}
6878
6879inline
6880bsl::ostream& s_baltst::operator<<(
6881 bsl::ostream& stream,
6883{
6884 return rhs.print(stream, 0, -1);
6885}
6886
6887
6888inline
6892{
6894 if (lhs.selectionId() == rhs.selectionId()) {
6895 switch (rhs.selectionId()) {
6896 case Class::SELECTION_ID_ANNOTATION:
6897 return lhs.annotation() == rhs.annotation();
6898 default:
6899 BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId());
6900 return true;
6901 }
6902 }
6903 else {
6904 return false;
6905 }
6906}
6907
6908inline
6912{
6913 return !(lhs == rhs);
6914}
6915
6916inline
6917bsl::ostream& s_baltst::operator<<(
6918 bsl::ostream& stream,
6920{
6921 return rhs.print(stream, 0, -1);
6922}
6923
6924
6925inline
6929{
6930 return lhs.value() == rhs.value()
6931 && lhs.choice() == rhs.choice();
6932}
6933
6934inline
6938{
6939 return !(lhs == rhs);
6940}
6941
6942inline
6943bsl::ostream& s_baltst::operator<<(
6944 bsl::ostream& stream,
6946{
6947 return rhs.print(stream, 0, -1);
6948}
6949
6950
6951inline
6955{
6957 if (lhs.selectionId() == rhs.selectionId()) {
6958 switch (rhs.selectionId()) {
6959 case Class::SELECTION_ID_ANNOTATION:
6960 return lhs.annotation() == rhs.annotation();
6961 case Class::SELECTION_ID_ENUMERATION:
6962 return lhs.enumeration() == rhs.enumeration();
6963 default:
6964 BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId());
6965 return true;
6966 }
6967 }
6968 else {
6969 return false;
6970 }
6971}
6972
6973inline
6977{
6978 return !(lhs == rhs);
6979}
6980
6981inline
6982bsl::ostream& s_baltst::operator<<(
6983 bsl::ostream& stream,
6985{
6986 return rhs.print(stream, 0, -1);
6987}
6988
6989
6990inline
6994{
6995 return lhs.base() == rhs.base()
6996 && lhs.choice() == rhs.choice();
6997}
6998
6999inline
7003{
7004 return !(lhs == rhs);
7005}
7006
7007inline
7008bsl::ostream& s_baltst::operator<<(
7009 bsl::ostream& stream,
7011{
7012 return rhs.print(stream, 0, -1);
7013}
7014
7015
7016inline
7020{
7022 if (lhs.selectionId() == rhs.selectionId()) {
7023 switch (rhs.selectionId()) {
7024 case Class::SELECTION_ID_ANNOTATION:
7025 return lhs.annotation() == rhs.annotation();
7026 case Class::SELECTION_ID_RESTRICTION:
7027 return lhs.restriction() == rhs.restriction();
7028 default:
7029 BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId());
7030 return true;
7031 }
7032 }
7033 else {
7034 return false;
7035 }
7036}
7037
7038inline
7042{
7043 return !(lhs == rhs);
7044}
7045
7046inline
7047bsl::ostream& s_baltst::operator<<(
7048 bsl::ostream& stream,
7050{
7051 return rhs.print(stream, 0, -1);
7052}
7053
7054
7055inline
7059{
7060 return lhs.name() == rhs.name()
7061 && lhs.preserveEnumOrder() == rhs.preserveEnumOrder()
7062 && lhs.choice() == rhs.choice();
7063}
7064
7065inline
7069{
7070 return !(lhs == rhs);
7071}
7072
7073inline
7074bsl::ostream& s_baltst::operator<<(
7075 bsl::ostream& stream,
7077{
7078 return rhs.print(stream, 0, -1);
7079}
7080
7081
7082inline
7086{
7087 return lhs.choice() == rhs.choice();
7088}
7089
7090inline
7094{
7095 return !(lhs == rhs);
7096}
7097
7098inline
7099bsl::ostream& s_baltst::operator<<(
7100 bsl::ostream& stream,
7102{
7103 return rhs.print(stream, 0, -1);
7104}
7105
7106
7107inline
7111{
7113 if (lhs.selectionId() == rhs.selectionId()) {
7114 switch (rhs.selectionId()) {
7115 case Class::SELECTION_ID_ANNOTATION:
7116 return lhs.annotation() == rhs.annotation();
7117 case Class::SELECTION_ID_ELEMENT:
7118 return lhs.element() == rhs.element();
7119 default:
7120 BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId());
7121 return true;
7122 }
7123 }
7124 else {
7125 return false;
7126 }
7127}
7128
7129inline
7133{
7134 return !(lhs == rhs);
7135}
7136
7137inline
7138bsl::ostream& s_baltst::operator<<(
7139 bsl::ostream& stream,
7141{
7142 return rhs.print(stream, 0, -1);
7143}
7144
7145
7146inline
7150{
7151 return lhs.name() == rhs.name()
7152 && lhs.choice() == rhs.choice();
7153}
7154
7155inline
7159{
7160 return !(lhs == rhs);
7161}
7162
7163inline
7164bsl::ostream& s_baltst::operator<<(
7165 bsl::ostream& stream,
7167{
7168 return rhs.print(stream, 0, -1);
7169}
7170
7171
7172inline
7176{
7178 if (lhs.selectionId() == rhs.selectionId()) {
7179 switch (rhs.selectionId()) {
7180 case Class::SELECTION_ID_ANNOTATION:
7181 return lhs.annotation() == rhs.annotation();
7182 case Class::SELECTION_ID_SEQUENCE:
7183 return lhs.sequence() == rhs.sequence();
7184 case Class::SELECTION_ID_CHOICE:
7185 return lhs.choice() == rhs.choice();
7186 default:
7187 BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId());
7188 return true;
7189 }
7190 }
7191 else {
7192 return false;
7193 }
7194}
7195
7196inline
7200{
7201 return !(lhs == rhs);
7202}
7203
7204inline
7205bsl::ostream& s_baltst::operator<<(
7206 bsl::ostream& stream,
7208{
7209 return rhs.print(stream, 0, -1);
7210}
7211
7212
7213inline
7217{
7218 return lhs.name() == rhs.name()
7219 && lhs.type() == rhs.type()
7220 && lhs.minOccurs() == rhs.minOccurs()
7221 && lhs.maxOccurs() == rhs.maxOccurs()
7222 && lhs.defaultValue() == rhs.defaultValue()
7223 && lhs.cppdefault() == rhs.cppdefault()
7224 && lhs.cpptype() == rhs.cpptype()
7225 && lhs.allocatesMemory() == rhs.allocatesMemory()
7226 && lhs.allowsDirectManipulation() == rhs.allowsDirectManipulation()
7227 && lhs.choice() == rhs.choice();
7228}
7229
7230inline
7234{
7235 return !(lhs == rhs);
7236}
7237
7238inline
7239bsl::ostream& s_baltst::operator<<(
7240 bsl::ostream& stream,
7242{
7243 return rhs.print(stream, 0, -1);
7244}
7245
7246
7247inline
7251{
7253 if (lhs.selectionId() == rhs.selectionId()) {
7254 switch (rhs.selectionId()) {
7255 case Class::SELECTION_ID_ANNOTATION:
7256 return lhs.annotation() == rhs.annotation();
7257 case Class::SELECTION_ID_SIMPLE_TYPE:
7258 return lhs.simpleType() == rhs.simpleType();
7259 case Class::SELECTION_ID_COMPLEX_TYPE:
7260 return lhs.complexType() == rhs.complexType();
7261 default:
7262 BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId());
7263 return true;
7264 }
7265 }
7266 else {
7267 return false;
7268 }
7269}
7270
7271inline
7275{
7276 return !(lhs == rhs);
7277}
7278
7279inline
7280bsl::ostream& s_baltst::operator<<(
7281 bsl::ostream& stream,
7283{
7284 return rhs.print(stream, 0, -1);
7285}
7286
7287
7288inline
7292{
7293 return lhs.choice() == rhs.choice();
7294}
7295
7296inline
7300{
7301 return !(lhs == rhs);
7302}
7303
7304inline
7305bsl::ostream& s_baltst::operator<<(
7306 bsl::ostream& stream,
7308{
7309 return rhs.print(stream, 0, -1);
7310}
7311
7312
7313inline
7317{
7319 if (lhs.selectionId() == rhs.selectionId()) {
7320 switch (rhs.selectionId()) {
7321 case Class::SELECTION_ID_ANNOTATION:
7322 return lhs.annotation() == rhs.annotation();
7323 case Class::SELECTION_ID_ELEMENT:
7324 return lhs.element() == rhs.element();
7325 default:
7326 BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId());
7327 return true;
7328 }
7329 }
7330 else {
7331 return false;
7332 }
7333}
7334
7335inline
7339{
7340 return !(lhs == rhs);
7341}
7342
7343inline
7344bsl::ostream& s_baltst::operator<<(
7345 bsl::ostream& stream,
7347{
7348 return rhs.print(stream, 0, -1);
7349}
7350
7351
7352inline
7354 const s_baltst::BasicSchemaChoice& lhs,
7355 const s_baltst::BasicSchemaChoice& rhs)
7356{
7357 typedef s_baltst::BasicSchemaChoice Class;
7358 if (lhs.selectionId() == rhs.selectionId()) {
7359 switch (rhs.selectionId()) {
7360 case Class::SELECTION_ID_ANNOTATION:
7361 return lhs.annotation() == rhs.annotation();
7362 case Class::SELECTION_ID_SIMPLE_TYPE:
7363 return lhs.simpleType() == rhs.simpleType();
7364 case Class::SELECTION_ID_COMPLEX_TYPE:
7365 return lhs.complexType() == rhs.complexType();
7366 default:
7367 BSLS_ASSERT(Class::SELECTION_ID_UNDEFINED == rhs.selectionId());
7368 return true;
7369 }
7370 }
7371 else {
7372 return false;
7373 }
7374}
7375
7376inline
7378 const s_baltst::BasicSchemaChoice& lhs,
7379 const s_baltst::BasicSchemaChoice& rhs)
7380{
7381 return !(lhs == rhs);
7382}
7383
7384inline
7385bsl::ostream& s_baltst::operator<<(
7386 bsl::ostream& stream,
7387 const s_baltst::BasicSchemaChoice& rhs)
7388{
7389 return rhs.print(stream, 0, -1);
7390}
7391
7392
7393inline
7395 const s_baltst::BasicSchema& lhs,
7396 const s_baltst::BasicSchema& rhs)
7397{
7398 return lhs.xs() == rhs.xs()
7399 && lhs.bdem() == rhs.bdem()
7400 && lhs.package() == rhs.package()
7401 && lhs.elementFormDefault() == rhs.elementFormDefault()
7402 && lhs.choice() == rhs.choice();
7403}
7404
7405inline
7407 const s_baltst::BasicSchema& lhs,
7408 const s_baltst::BasicSchema& rhs)
7409{
7410 return !(lhs == rhs);
7411}
7412
7413inline
7414bsl::ostream& s_baltst::operator<<(
7415 bsl::ostream& stream,
7416 const s_baltst::BasicSchema& rhs)
7417{
7418 return rhs.print(stream, 0, -1);
7419}
7420
7421
7422#endif
7423
7424// GENERATED BY BLP_BAS_CODEGEN_VERSION
7425// USING bas_codegen.pl --mode msg --noExternalization --noAggregateConversion --package s_baltst --msgComponent basicschema s_baltst_basicschema.xsd
7426// ----------------------------------------------------------------------------
7427// NOTICE:
7428// Copyright 2020 Bloomberg Finance L.P. All rights reserved.
7429// Property of Bloomberg Finance L.P. (BFLP)
7430// This software is made available solely pursuant to the
7431// terms of a BFLP license agreement which governs its use.
7432// ------------------------------- END-OF-FILE --------------------------------
7433
7434/** @} */
7435/** @} */
7436/** @} */
Definition bdlb_nullablevalue.h:262
Definition bslstl_vector.h:1120
Definition bslma_allocator.h:545
Definition s_baltst_basicschema.h:95
static const bdlat_AttributeInfo * lookupAttributeInfo(int id)
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
static const char CLASS_NAME[]
Definition s_baltst_basicschema.h:115
@ ATTRIBUTE_ID_DOCUMENTATION
Definition s_baltst_basicschema.h:103
bdlb::NullableValue< bsl::string > & documentation()
Definition s_baltst_basicschema.h:4278
~BasicSchemaAnnotationElement()
Destroy this object.
@ NUM_ATTRIBUTES
Definition s_baltst_basicschema.h:107
BasicSchemaAnnotationElement(bslma::Allocator *basicAllocator=0)
int manipulateAttribute(MANIPULATOR &manipulator, int id)
Definition s_baltst_basicschema.h:4247
int manipulateAttributes(MANIPULATOR &manipulator)
Definition s_baltst_basicschema.h:4234
BasicSchemaAnnotationElement & operator=(const BasicSchemaAnnotationElement &rhs)
Assign to this object the value of the specified rhs object.
@ ATTRIBUTE_INDEX_DOCUMENTATION
Definition s_baltst_basicschema.h:111
int accessAttributes(ACCESSOR &accessor) const
Definition s_baltst_basicschema.h:4285
BasicSchemaAnnotationElement(const BasicSchemaAnnotationElement &original, bslma::Allocator *basicAllocator=0)
int accessAttribute(ACCESSOR &accessor, int id) const
Definition s_baltst_basicschema.h:4298
static const bdlat_AttributeInfo * lookupAttributeInfo(const char *name, int nameLength)
static const bdlat_AttributeInfo ATTRIBUTE_INFO_ARRAY[]
Definition s_baltst_basicschema.h:117
Definition s_baltst_basicschema.h:1912
~BasicSchemaChoiceElementChoice()
Destroy this object.
Definition s_baltst_basicschema.h:5290
bsls::ObjectBuffer< BasicSchemaAnnotationElement > d_annotation
Definition s_baltst_basicschema.h:1916
const char * selectionName() const
Return the symbolic name of the current selection of this object.
int makeSelection(const char *name, int nameLength)
bool isUndefinedValue() const
Definition s_baltst_basicschema.h:5376
bool isElementValue() const
Definition s_baltst_basicschema.h:5370
BasicSchemaElement & makeElement(const BasicSchemaElement &value)
@ NUM_SELECTIONS
Definition s_baltst_basicschema.h:1933
BasicSchemaAnnotationElement & makeAnnotation()
BasicSchemaChoiceElementChoice(const BasicSchemaChoiceElementChoice &original, bslma::Allocator *basicAllocator=0)
bool isAnnotationValue() const
Definition s_baltst_basicschema.h:5364
int manipulateSelection(MANIPULATOR &manipulator)
Definition s_baltst_basicschema.h:5297
@ SELECTION_INDEX_ANNOTATION
Definition s_baltst_basicschema.h:1937
@ SELECTION_INDEX_ELEMENT
Definition s_baltst_basicschema.h:1938
BasicSchemaAnnotationElement & annotation()
Definition s_baltst_basicschema.h:5313
BasicSchemaAnnotationElement & makeAnnotation(const BasicSchemaAnnotationElement &value)
static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]
Definition s_baltst_basicschema.h:1944
BasicSchemaElement * d_element
Definition s_baltst_basicschema.h:1917
static const char CLASS_NAME[]
Definition s_baltst_basicschema.h:1942
BasicSchemaElement & element()
Definition s_baltst_basicschema.h:5320
int accessSelection(ACCESSOR &accessor) const
Definition s_baltst_basicschema.h:5334
int selectionId() const
Definition s_baltst_basicschema.h:5328
@ SELECTION_ID_ELEMENT
Definition s_baltst_basicschema.h:1929
@ SELECTION_ID_UNDEFINED
Definition s_baltst_basicschema.h:1927
@ SELECTION_ID_ANNOTATION
Definition s_baltst_basicschema.h:1928
static const bdlat_SelectionInfo * lookupSelectionInfo(int id)
BasicSchemaChoiceElementChoice & operator=(const BasicSchemaChoiceElementChoice &rhs)
Assign to this object the value of the specified rhs object.
BasicSchemaChoiceElementChoice(bslma::Allocator *basicAllocator=0)
Definition s_baltst_basicschema.h:5283
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
static const bdlat_SelectionInfo * lookupSelectionInfo(const char *name, int nameLength)
Definition s_baltst_basicschema.h:1699
bsl::vector< BasicSchemaChoiceElementChoice > & choice()
Definition s_baltst_basicschema.h:5209
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
static const bdlat_AttributeInfo * lookupAttributeInfo(int id)
@ ATTRIBUTE_ID_CHOICE
Definition s_baltst_basicschema.h:1707
BasicSchemaChoiceElement(const BasicSchemaChoiceElement &original, bslma::Allocator *basicAllocator=0)
@ NUM_ATTRIBUTES
Definition s_baltst_basicschema.h:1711
@ ATTRIBUTE_INDEX_CHOICE
Definition s_baltst_basicschema.h:1715
~BasicSchemaChoiceElement()
Destroy this object.
int manipulateAttribute(MANIPULATOR &manipulator, int id)
Definition s_baltst_basicschema.h:5178
int accessAttributes(ACCESSOR &accessor) const
Definition s_baltst_basicschema.h:5216
static const bdlat_AttributeInfo * lookupAttributeInfo(const char *name, int nameLength)
static const char CLASS_NAME[]
Definition s_baltst_basicschema.h:1719
static const bdlat_AttributeInfo ATTRIBUTE_INFO_ARRAY[]
Definition s_baltst_basicschema.h:1721
int manipulateAttributes(MANIPULATOR &manipulator)
Definition s_baltst_basicschema.h:5165
BasicSchemaChoiceElement(bslma::Allocator *basicAllocator=0)
BasicSchemaChoiceElement & operator=(const BasicSchemaChoiceElement &rhs)
Assign to this object the value of the specified rhs object.
int accessAttribute(ACCESSOR &accessor, int id) const
Definition s_baltst_basicschema.h:5229
Definition s_baltst_basicschema.h:3699
static const char CLASS_NAME[]
Definition s_baltst_basicschema.h:3732
~BasicSchemaChoice()
Destroy this object.
Definition s_baltst_basicschema.h:6488
int accessSelection(ACCESSOR &accessor) const
Definition s_baltst_basicschema.h:6542
bool isAnnotationValue() const
Definition s_baltst_basicschema.h:6582
BasicSchemaSimpleTypeElement & makeSimpleType()
static const bdlat_SelectionInfo * lookupSelectionInfo(const char *name, int nameLength)
BasicSchemaSimpleTypeElement & makeSimpleType(const BasicSchemaSimpleTypeElement &value)
BasicSchemaComplexTypeElement * d_complexType
Definition s_baltst_basicschema.h:3705
BasicSchemaChoice & operator=(const BasicSchemaChoice &rhs)
Assign to this object the value of the specified rhs object.
static const bdlat_SelectionInfo * lookupSelectionInfo(int id)
int manipulateSelection(MANIPULATOR &manipulator)
Definition s_baltst_basicschema.h:6495
BasicSchemaComplexTypeElement & makeComplexType()
BasicSchemaAnnotationElement & annotation()
Definition s_baltst_basicschema.h:6514
static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]
Definition s_baltst_basicschema.h:3734
BasicSchemaComplexTypeElement & makeComplexType(const BasicSchemaComplexTypeElement &value)
BasicSchemaSimpleTypeElement & simpleType()
Definition s_baltst_basicschema.h:6521
BasicSchemaChoice(bslma::Allocator *basicAllocator=0)
Definition s_baltst_basicschema.h:6481
@ SELECTION_INDEX_ANNOTATION
Definition s_baltst_basicschema.h:3726
@ SELECTION_INDEX_SIMPLE_TYPE
Definition s_baltst_basicschema.h:3727
@ SELECTION_INDEX_COMPLEX_TYPE
Definition s_baltst_basicschema.h:3728
bool isComplexTypeValue() const
Definition s_baltst_basicschema.h:6594
int makeSelection(int selectionId)
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
BasicSchemaAnnotationElement & makeAnnotation()
bool isUndefinedValue() const
Definition s_baltst_basicschema.h:6600
@ NUM_SELECTIONS
Definition s_baltst_basicschema.h:3722
@ SELECTION_ID_ANNOTATION
Definition s_baltst_basicschema.h:3716
@ SELECTION_ID_SIMPLE_TYPE
Definition s_baltst_basicschema.h:3717
@ SELECTION_ID_COMPLEX_TYPE
Definition s_baltst_basicschema.h:3718
@ SELECTION_ID_UNDEFINED
Definition s_baltst_basicschema.h:3715
int makeSelection(const char *name, int nameLength)
BasicSchemaComplexTypeElement & complexType()
Definition s_baltst_basicschema.h:6528
BasicSchemaChoice(const BasicSchemaChoice &original, bslma::Allocator *basicAllocator=0)
bsls::ObjectBuffer< BasicSchemaAnnotationElement > d_annotation
Definition s_baltst_basicschema.h:3703
bsls::ObjectBuffer< BasicSchemaSimpleTypeElement > d_simpleType
Definition s_baltst_basicschema.h:3704
const char * selectionName() const
Return the symbolic name of the current selection of this object.
bool isSimpleTypeValue() const
Definition s_baltst_basicschema.h:6588
int selectionId() const
Definition s_baltst_basicschema.h:6536
BasicSchemaAnnotationElement & makeAnnotation(const BasicSchemaAnnotationElement &value)
Definition s_baltst_basicschema.h:2381
bool isSequenceValue() const
Definition s_baltst_basicschema.h:5661
BasicSchemaAnnotationElement & annotation()
Definition s_baltst_basicschema.h:5587
~BasicSchemaComplexTypeElementChoice()
Destroy this object.
Definition s_baltst_basicschema.h:5561
static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]
Definition s_baltst_basicschema.h:2416
int selectionId() const
Definition s_baltst_basicschema.h:5609
BasicSchemaAnnotationElement & makeAnnotation(const BasicSchemaAnnotationElement &value)
BasicSchemaAnnotationElement & makeAnnotation()
int makeSelection(const char *name, int nameLength)
int manipulateSelection(MANIPULATOR &manipulator)
Definition s_baltst_basicschema.h:5568
BasicSchemaSequenceElement & makeSequence(const BasicSchemaSequenceElement &value)
int accessSelection(ACCESSOR &accessor) const
Definition s_baltst_basicschema.h:5615
bool isUndefinedValue() const
Definition s_baltst_basicschema.h:5673
const char * selectionName() const
Return the symbolic name of the current selection of this object.
bool isChoiceValue() const
Definition s_baltst_basicschema.h:5667
static const bdlat_SelectionInfo * lookupSelectionInfo(const char *name, int nameLength)
BasicSchemaComplexTypeElementChoice(const BasicSchemaComplexTypeElementChoice &original, bslma::Allocator *basicAllocator=0)
BasicSchemaSequenceElement * d_sequence
Definition s_baltst_basicschema.h:2386
BasicSchemaComplexTypeElementChoice & operator=(const BasicSchemaComplexTypeElementChoice &rhs)
Assign to this object the value of the specified rhs object.
static const char CLASS_NAME[]
Definition s_baltst_basicschema.h:2414
BasicSchemaSequenceElement & makeSequence()
BasicSchemaComplexTypeElementChoice(bslma::Allocator *basicAllocator=0)
Definition s_baltst_basicschema.h:5554
bsls::ObjectBuffer< BasicSchemaAnnotationElement > d_annotation
Definition s_baltst_basicschema.h:2385
@ NUM_SELECTIONS
Definition s_baltst_basicschema.h:2404
BasicSchemaChoiceElement & choice()
Definition s_baltst_basicschema.h:5601
@ SELECTION_INDEX_ANNOTATION
Definition s_baltst_basicschema.h:2408
@ SELECTION_INDEX_SEQUENCE
Definition s_baltst_basicschema.h:2409
@ SELECTION_INDEX_CHOICE
Definition s_baltst_basicschema.h:2410
BasicSchemaChoiceElement & makeChoice()
static const bdlat_SelectionInfo * lookupSelectionInfo(int id)
BasicSchemaChoiceElement * d_choice
Definition s_baltst_basicschema.h:2387
BasicSchemaChoiceElement & makeChoice(const BasicSchemaChoiceElement &value)
bool isAnnotationValue() const
Definition s_baltst_basicschema.h:5655
@ SELECTION_ID_CHOICE
Definition s_baltst_basicschema.h:2400
@ SELECTION_ID_SEQUENCE
Definition s_baltst_basicschema.h:2399
@ SELECTION_ID_UNDEFINED
Definition s_baltst_basicschema.h:2397
@ SELECTION_ID_ANNOTATION
Definition s_baltst_basicschema.h:2398
BasicSchemaSequenceElement & sequence()
Definition s_baltst_basicschema.h:5594
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
Definition s_baltst_basicschema.h:2157
@ ATTRIBUTE_ID_CHOICE
Definition s_baltst_basicschema.h:2167
@ ATTRIBUTE_ID_NAME
Definition s_baltst_basicschema.h:2166
static const char CLASS_NAME[]
Definition s_baltst_basicschema.h:2180
int accessAttributes(ACCESSOR &accessor) const
Definition s_baltst_basicschema.h:5472
int manipulateAttribute(MANIPULATOR &manipulator, int id)
Definition s_baltst_basicschema.h:5425
static const bdlat_AttributeInfo ATTRIBUTE_INFO_ARRAY[]
Definition s_baltst_basicschema.h:2182
int accessAttribute(ACCESSOR &accessor, int id) const
Definition s_baltst_basicschema.h:5490
int manipulateAttributes(MANIPULATOR &manipulator)
Definition s_baltst_basicschema.h:5407
bdlb::NullableValue< bsl::string > & name()
Definition s_baltst_basicschema.h:5459
@ NUM_ATTRIBUTES
Definition s_baltst_basicschema.h:2171
bsl::vector< BasicSchemaComplexTypeElementChoice > & choice()
Definition s_baltst_basicschema.h:5465
static const bdlat_AttributeInfo * lookupAttributeInfo(int id)
BasicSchemaComplexTypeElement(const BasicSchemaComplexTypeElement &original, bslma::Allocator *basicAllocator=0)
BasicSchemaComplexTypeElement(bslma::Allocator *basicAllocator=0)
static const bdlat_AttributeInfo * lookupAttributeInfo(const char *name, int nameLength)
~BasicSchemaComplexTypeElement()
Destroy this object.
BasicSchemaComplexTypeElement & operator=(const BasicSchemaComplexTypeElement &rhs)
Assign to this object the value of the specified rhs object.
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
@ ATTRIBUTE_INDEX_NAME
Definition s_baltst_basicschema.h:2175
@ ATTRIBUTE_INDEX_CHOICE
Definition s_baltst_basicschema.h:2176
Definition s_baltst_basicschema.h:2967
BasicSchemaComplexTypeElement & complexType()
Definition s_baltst_basicschema.h:6133
static const bdlat_SelectionInfo * lookupSelectionInfo(const char *name, int nameLength)
BasicSchemaSimpleTypeElement & simpleType()
Definition s_baltst_basicschema.h:6126
const char * selectionName() const
Return the symbolic name of the current selection of this object.
bool isAnnotationValue() const
Definition s_baltst_basicschema.h:6187
@ NUM_SELECTIONS
Definition s_baltst_basicschema.h:2990
BasicSchemaAnnotationElement & annotation()
Definition s_baltst_basicschema.h:6119
static const bdlat_SelectionInfo * lookupSelectionInfo(int id)
static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]
Definition s_baltst_basicschema.h:3002
BasicSchemaComplexTypeElement & makeComplexType()
bool isUndefinedValue() const
Definition s_baltst_basicschema.h:6205
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
int selectionId() const
Definition s_baltst_basicschema.h:6141
BasicSchemaAnnotationElement & makeAnnotation(const BasicSchemaAnnotationElement &value)
BasicSchemaElementChoice(const BasicSchemaElementChoice &original, bslma::Allocator *basicAllocator=0)
@ SELECTION_ID_COMPLEX_TYPE
Definition s_baltst_basicschema.h:2986
@ SELECTION_ID_SIMPLE_TYPE
Definition s_baltst_basicschema.h:2985
@ SELECTION_ID_UNDEFINED
Definition s_baltst_basicschema.h:2983
@ SELECTION_ID_ANNOTATION
Definition s_baltst_basicschema.h:2984
BasicSchemaSimpleTypeElement & makeSimpleType(const BasicSchemaSimpleTypeElement &value)
static const char CLASS_NAME[]
Definition s_baltst_basicschema.h:3000
int accessSelection(ACCESSOR &accessor) const
Definition s_baltst_basicschema.h:6147
BasicSchemaElementChoice & operator=(const BasicSchemaElementChoice &rhs)
Assign to this object the value of the specified rhs object.
BasicSchemaAnnotationElement & makeAnnotation()
int manipulateSelection(MANIPULATOR &manipulator)
Definition s_baltst_basicschema.h:6100
int makeSelection(const char *name, int nameLength)
BasicSchemaSimpleTypeElement & makeSimpleType()
bsls::ObjectBuffer< BasicSchemaAnnotationElement > d_annotation
Definition s_baltst_basicschema.h:2971
bsls::ObjectBuffer< BasicSchemaSimpleTypeElement > d_simpleType
Definition s_baltst_basicschema.h:2972
BasicSchemaComplexTypeElement * d_complexType
Definition s_baltst_basicschema.h:2973
BasicSchemaElementChoice(bslma::Allocator *basicAllocator=0)
Definition s_baltst_basicschema.h:6086
BasicSchemaComplexTypeElement & makeComplexType(const BasicSchemaComplexTypeElement &value)
bool isSimpleTypeValue() const
Definition s_baltst_basicschema.h:6193
int makeSelection(int selectionId)
@ SELECTION_INDEX_SIMPLE_TYPE
Definition s_baltst_basicschema.h:2995
@ SELECTION_INDEX_ANNOTATION
Definition s_baltst_basicschema.h:2994
@ SELECTION_INDEX_COMPLEX_TYPE
Definition s_baltst_basicschema.h:2996
~BasicSchemaElementChoice()
Destroy this object.
Definition s_baltst_basicschema.h:6093
bool isComplexTypeValue() const
Definition s_baltst_basicschema.h:6199
Definition s_baltst_basicschema.h:2656
int manipulateAttributes(MANIPULATOR &manipulator)
Definition s_baltst_basicschema.h:5707
bdlb::NullableValue< bsl::string > & type()
Definition s_baltst_basicschema.h:5829
int accessAttributes(ACCESSOR &accessor) const
Definition s_baltst_basicschema.h:5884
BasicSchemaElement(bslma::Allocator *basicAllocator=0)
BasicSchemaElement(const BasicSchemaElement &original, bslma::Allocator *basicAllocator=0)
int manipulateAttribute(MANIPULATOR &manipulator, int id)
Definition s_baltst_basicschema.h:5765
static const bdlat_AttributeInfo * lookupAttributeInfo(const char *name, int nameLength)
static const char CLASS_NAME[]
Definition s_baltst_basicschema.h:2703
@ ATTRIBUTE_ID_ALLOWS_DIRECT_MANIPULATION
Definition s_baltst_basicschema.h:2681
@ ATTRIBUTE_ID_ALLOCATES_MEMORY
Definition s_baltst_basicschema.h:2680
@ ATTRIBUTE_ID_MAX_OCCURS
Definition s_baltst_basicschema.h:2676
@ ATTRIBUTE_ID_TYPE
Definition s_baltst_basicschema.h:2674
@ ATTRIBUTE_ID_DEFAULT_VALUE
Definition s_baltst_basicschema.h:2677
@ ATTRIBUTE_ID_CHOICE
Definition s_baltst_basicschema.h:2682
@ ATTRIBUTE_ID_CPPDEFAULT
Definition s_baltst_basicschema.h:2678
@ ATTRIBUTE_ID_MIN_OCCURS
Definition s_baltst_basicschema.h:2675
@ ATTRIBUTE_ID_NAME
Definition s_baltst_basicschema.h:2673
@ ATTRIBUTE_ID_CPPTYPE
Definition s_baltst_basicschema.h:2679
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
static const bdlat_AttributeInfo * lookupAttributeInfo(int id)
bdlb::NullableValue< bsl::string > & maxOccurs()
Definition s_baltst_basicschema.h:5841
bsl::vector< BasicSchemaElementChoice > & choice()
Definition s_baltst_basicschema.h:5877
bdlb::NullableValue< bsl::string > & name()
Definition s_baltst_basicschema.h:5823
bdlb::NullableValue< bsl::string > & allocatesMemory()
Definition s_baltst_basicschema.h:5865
bdlb::NullableValue< bsl::string > & defaultValue()
Definition s_baltst_basicschema.h:5847
static const bdlat_AttributeInfo ATTRIBUTE_INFO_ARRAY[]
Definition s_baltst_basicschema.h:2705
bdlb::NullableValue< bsl::string > & minOccurs()
Definition s_baltst_basicschema.h:5835
bdlb::NullableValue< bsl::string > & cppdefault()
Definition s_baltst_basicschema.h:5853
bdlb::NullableValue< bsl::string > & allowsDirectManipulation()
Definition s_baltst_basicschema.h:5871
~BasicSchemaElement()
Destroy this object.
BasicSchemaElement & operator=(const BasicSchemaElement &rhs)
Assign to this object the value of the specified rhs object.
int accessAttribute(ACCESSOR &accessor, int id) const
Definition s_baltst_basicschema.h:5942
@ NUM_ATTRIBUTES
Definition s_baltst_basicschema.h:2686
@ ATTRIBUTE_INDEX_MAX_OCCURS
Definition s_baltst_basicschema.h:2693
@ ATTRIBUTE_INDEX_CHOICE
Definition s_baltst_basicschema.h:2699
@ ATTRIBUTE_INDEX_CPPTYPE
Definition s_baltst_basicschema.h:2696
@ ATTRIBUTE_INDEX_ALLOCATES_MEMORY
Definition s_baltst_basicschema.h:2697
@ ATTRIBUTE_INDEX_NAME
Definition s_baltst_basicschema.h:2690
@ ATTRIBUTE_INDEX_TYPE
Definition s_baltst_basicschema.h:2691
@ ATTRIBUTE_INDEX_CPPDEFAULT
Definition s_baltst_basicschema.h:2695
@ ATTRIBUTE_INDEX_MIN_OCCURS
Definition s_baltst_basicschema.h:2692
@ ATTRIBUTE_INDEX_ALLOWS_DIRECT_MANIPULATION
Definition s_baltst_basicschema.h:2698
@ ATTRIBUTE_INDEX_DEFAULT_VALUE
Definition s_baltst_basicschema.h:2694
bdlb::NullableValue< bsl::string > & cpptype()
Definition s_baltst_basicschema.h:5859
Definition s_baltst_basicschema.h:308
const char * selectionName() const
Return the symbolic name of the current selection of this object.
bsls::ObjectBuffer< BasicSchemaAnnotationElement > d_annotation
Definition s_baltst_basicschema.h:312
static const bdlat_SelectionInfo * lookupSelectionInfo(int id)
BasicSchemaAnnotationElement & annotation()
Definition s_baltst_basicschema.h:4379
@ SELECTION_INDEX_ANNOTATION
Definition s_baltst_basicschema.h:331
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
BasicSchemaEnumerationElementChoice(bslma::Allocator *basicAllocator=0)
Definition s_baltst_basicschema.h:4352
BasicSchemaAnnotationElement & makeAnnotation()
bool isUndefinedValue() const
Definition s_baltst_basicschema.h:4419
~BasicSchemaEnumerationElementChoice()
Destroy this object.
Definition s_baltst_basicschema.h:4359
int makeSelection(const char *name, int nameLength)
int selectionId() const
Definition s_baltst_basicschema.h:4387
static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]
Definition s_baltst_basicschema.h:337
BasicSchemaEnumerationElementChoice(const BasicSchemaEnumerationElementChoice &original, bslma::Allocator *basicAllocator=0)
int manipulateSelection(MANIPULATOR &manipulator)
Definition s_baltst_basicschema.h:4366
@ NUM_SELECTIONS
Definition s_baltst_basicschema.h:327
BasicSchemaAnnotationElement & makeAnnotation(const BasicSchemaAnnotationElement &value)
bool isAnnotationValue() const
Definition s_baltst_basicschema.h:4413
static const bdlat_SelectionInfo * lookupSelectionInfo(const char *name, int nameLength)
@ SELECTION_ID_ANNOTATION
Definition s_baltst_basicschema.h:323
@ SELECTION_ID_UNDEFINED
Definition s_baltst_basicschema.h:322
BasicSchemaEnumerationElementChoice & operator=(const BasicSchemaEnumerationElementChoice &rhs)
Assign to this object the value of the specified rhs object.
int accessSelection(ACCESSOR &accessor) const
Definition s_baltst_basicschema.h:4393
static const char CLASS_NAME[]
Definition s_baltst_basicschema.h:335
Definition s_baltst_basicschema.h:525
@ ATTRIBUTE_ID_CHOICE
Definition s_baltst_basicschema.h:535
@ ATTRIBUTE_ID_VALUE
Definition s_baltst_basicschema.h:534
static const bdlat_AttributeInfo * lookupAttributeInfo(int id)
BasicSchemaEnumerationElement(bslma::Allocator *basicAllocator=0)
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
int manipulateAttributes(MANIPULATOR &manipulator)
Definition s_baltst_basicschema.h:4447
static const char CLASS_NAME[]
Definition s_baltst_basicschema.h:548
static const bdlat_AttributeInfo ATTRIBUTE_INFO_ARRAY[]
Definition s_baltst_basicschema.h:550
static const bdlat_AttributeInfo * lookupAttributeInfo(const char *name, int nameLength)
BasicSchemaEnumerationElement(const BasicSchemaEnumerationElement &original, bslma::Allocator *basicAllocator=0)
@ NUM_ATTRIBUTES
Definition s_baltst_basicschema.h:539
int accessAttributes(ACCESSOR &accessor) const
Definition s_baltst_basicschema.h:4512
int accessAttribute(ACCESSOR &accessor, int id) const
Definition s_baltst_basicschema.h:4530
int manipulateAttribute(MANIPULATOR &manipulator, int id)
Definition s_baltst_basicschema.h:4465
~BasicSchemaEnumerationElement()
Destroy this object.
@ ATTRIBUTE_INDEX_CHOICE
Definition s_baltst_basicschema.h:544
@ ATTRIBUTE_INDEX_VALUE
Definition s_baltst_basicschema.h:543
bdlb::NullableValue< bsl::string > & value()
Definition s_baltst_basicschema.h:4499
bsl::vector< BasicSchemaEnumerationElementChoice > & choice()
Definition s_baltst_basicschema.h:4505
BasicSchemaEnumerationElement & operator=(const BasicSchemaEnumerationElement &rhs)
Assign to this object the value of the specified rhs object.
Definition s_baltst_basicschema.h:749
~BasicSchemaRestrictionElementChoice()
Destroy this object.
Definition s_baltst_basicschema.h:4601
@ SELECTION_INDEX_ANNOTATION
Definition s_baltst_basicschema.h:774
@ SELECTION_INDEX_ENUMERATION
Definition s_baltst_basicschema.h:775
int selectionId() const
Definition s_baltst_basicschema.h:4639
const char * selectionName() const
Return the symbolic name of the current selection of this object.
BasicSchemaRestrictionElementChoice(bslma::Allocator *basicAllocator=0)
Definition s_baltst_basicschema.h:4594
BasicSchemaRestrictionElementChoice & operator=(const BasicSchemaRestrictionElementChoice &rhs)
Assign to this object the value of the specified rhs object.
static const bdlat_SelectionInfo * lookupSelectionInfo(const char *name, int nameLength)
int makeSelection(const char *name, int nameLength)
BasicSchemaAnnotationElement & makeAnnotation(const BasicSchemaAnnotationElement &value)
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
bool isEnumerationValue() const
Definition s_baltst_basicschema.h:4681
bool isAnnotationValue() const
Definition s_baltst_basicschema.h:4675
static const bdlat_SelectionInfo * lookupSelectionInfo(int id)
bsls::ObjectBuffer< BasicSchemaEnumerationElement > d_enumeration
Definition s_baltst_basicschema.h:754
static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]
Definition s_baltst_basicschema.h:781
BasicSchemaEnumerationElement & makeEnumeration()
BasicSchemaEnumerationElement & makeEnumeration(const BasicSchemaEnumerationElement &value)
@ NUM_SELECTIONS
Definition s_baltst_basicschema.h:770
bool isUndefinedValue() const
Definition s_baltst_basicschema.h:4687
int manipulateSelection(MANIPULATOR &manipulator)
Definition s_baltst_basicschema.h:4608
@ SELECTION_ID_ANNOTATION
Definition s_baltst_basicschema.h:765
@ SELECTION_ID_ENUMERATION
Definition s_baltst_basicschema.h:766
@ SELECTION_ID_UNDEFINED
Definition s_baltst_basicschema.h:764
BasicSchemaEnumerationElement & enumeration()
Definition s_baltst_basicschema.h:4631
static const char CLASS_NAME[]
Definition s_baltst_basicschema.h:779
BasicSchemaAnnotationElement & makeAnnotation()
bsls::ObjectBuffer< BasicSchemaAnnotationElement > d_annotation
Definition s_baltst_basicschema.h:753
BasicSchemaAnnotationElement & annotation()
Definition s_baltst_basicschema.h:4624
int accessSelection(ACCESSOR &accessor) const
Definition s_baltst_basicschema.h:4645
BasicSchemaRestrictionElementChoice(const BasicSchemaRestrictionElementChoice &original, bslma::Allocator *basicAllocator=0)
Definition s_baltst_basicschema.h:995
int manipulateAttributes(MANIPULATOR &manipulator)
Definition s_baltst_basicschema.h:4718
int manipulateAttribute(MANIPULATOR &manipulator, int id)
Definition s_baltst_basicschema.h:4736
static const bdlat_AttributeInfo * lookupAttributeInfo(int id)
int accessAttribute(ACCESSOR &accessor, int id) const
Definition s_baltst_basicschema.h:4801
BasicSchemaRestrictionElement & operator=(const BasicSchemaRestrictionElement &rhs)
Assign to this object the value of the specified rhs object.
@ ATTRIBUTE_ID_BASE
Definition s_baltst_basicschema.h:1004
@ ATTRIBUTE_ID_CHOICE
Definition s_baltst_basicschema.h:1005
bdlb::NullableValue< bsl::string > & base()
Definition s_baltst_basicschema.h:4770
bsl::vector< BasicSchemaRestrictionElementChoice > & choice()
Definition s_baltst_basicschema.h:4776
BasicSchemaRestrictionElement(bslma::Allocator *basicAllocator=0)
static const char CLASS_NAME[]
Definition s_baltst_basicschema.h:1018
static const bdlat_AttributeInfo * lookupAttributeInfo(const char *name, int nameLength)
~BasicSchemaRestrictionElement()
Destroy this object.
BasicSchemaRestrictionElement(const BasicSchemaRestrictionElement &original, bslma::Allocator *basicAllocator=0)
@ ATTRIBUTE_INDEX_BASE
Definition s_baltst_basicschema.h:1013
@ ATTRIBUTE_INDEX_CHOICE
Definition s_baltst_basicschema.h:1014
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
static const bdlat_AttributeInfo ATTRIBUTE_INFO_ARRAY[]
Definition s_baltst_basicschema.h:1020
@ NUM_ATTRIBUTES
Definition s_baltst_basicschema.h:1009
int accessAttributes(ACCESSOR &accessor) const
Definition s_baltst_basicschema.h:4783
Definition s_baltst_basicschema.h:3454
BasicSchemaElement & makeElement(const BasicSchemaElement &value)
@ SELECTION_ID_ELEMENT
Definition s_baltst_basicschema.h:3471
@ SELECTION_ID_ANNOTATION
Definition s_baltst_basicschema.h:3470
@ SELECTION_ID_UNDEFINED
Definition s_baltst_basicschema.h:3469
BasicSchemaAnnotationElement & makeAnnotation()
int manipulateSelection(MANIPULATOR &manipulator)
Definition s_baltst_basicschema.h:6371
BasicSchemaElement * d_element
Definition s_baltst_basicschema.h:3459
bool isUndefinedValue() const
Definition s_baltst_basicschema.h:6450
BasicSchemaSequenceElementChoice(const BasicSchemaSequenceElementChoice &original, bslma::Allocator *basicAllocator=0)
static const char CLASS_NAME[]
Definition s_baltst_basicschema.h:3484
static const bdlat_SelectionInfo * lookupSelectionInfo(int id)
~BasicSchemaSequenceElementChoice()
Destroy this object.
Definition s_baltst_basicschema.h:6364
@ SELECTION_INDEX_ANNOTATION
Definition s_baltst_basicschema.h:3479
@ SELECTION_INDEX_ELEMENT
Definition s_baltst_basicschema.h:3480
static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]
Definition s_baltst_basicschema.h:3486
int accessSelection(ACCESSOR &accessor) const
Definition s_baltst_basicschema.h:6408
BasicSchemaElement & element()
Definition s_baltst_basicschema.h:6394
bsls::ObjectBuffer< BasicSchemaAnnotationElement > d_annotation
Definition s_baltst_basicschema.h:3458
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
BasicSchemaSequenceElementChoice(bslma::Allocator *basicAllocator=0)
Definition s_baltst_basicschema.h:6357
BasicSchemaAnnotationElement & annotation()
Definition s_baltst_basicschema.h:6387
int makeSelection(const char *name, int nameLength)
BasicSchemaSequenceElementChoice & operator=(const BasicSchemaSequenceElementChoice &rhs)
Assign to this object the value of the specified rhs object.
const char * selectionName() const
Return the symbolic name of the current selection of this object.
BasicSchemaAnnotationElement & makeAnnotation(const BasicSchemaAnnotationElement &value)
int selectionId() const
Definition s_baltst_basicschema.h:6402
bool isElementValue() const
Definition s_baltst_basicschema.h:6444
bool isAnnotationValue() const
Definition s_baltst_basicschema.h:6438
@ NUM_SELECTIONS
Definition s_baltst_basicschema.h:3475
static const bdlat_SelectionInfo * lookupSelectionInfo(const char *name, int nameLength)
Definition s_baltst_basicschema.h:3241
int manipulateAttribute(MANIPULATOR &manipulator, int id)
Definition s_baltst_basicschema.h:6252
static const bdlat_AttributeInfo * lookupAttributeInfo(const char *name, int nameLength)
bsl::vector< BasicSchemaSequenceElementChoice > & choice()
Definition s_baltst_basicschema.h:6283
static const bdlat_AttributeInfo ATTRIBUTE_INFO_ARRAY[]
Definition s_baltst_basicschema.h:3263
@ ATTRIBUTE_ID_CHOICE
Definition s_baltst_basicschema.h:3249
static const char CLASS_NAME[]
Definition s_baltst_basicschema.h:3261
int accessAttribute(ACCESSOR &accessor, int id) const
Definition s_baltst_basicschema.h:6303
~BasicSchemaSequenceElement()
Destroy this object.
@ NUM_ATTRIBUTES
Definition s_baltst_basicschema.h:3253
BasicSchemaSequenceElement(const BasicSchemaSequenceElement &original, bslma::Allocator *basicAllocator=0)
@ ATTRIBUTE_INDEX_CHOICE
Definition s_baltst_basicschema.h:3257
int manipulateAttributes(MANIPULATOR &manipulator)
Definition s_baltst_basicschema.h:6239
int accessAttributes(ACCESSOR &accessor) const
Definition s_baltst_basicschema.h:6290
static const bdlat_AttributeInfo * lookupAttributeInfo(int id)
BasicSchemaSequenceElement & operator=(const BasicSchemaSequenceElement &rhs)
Assign to this object the value of the specified rhs object.
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
BasicSchemaSequenceElement(bslma::Allocator *basicAllocator=0)
Definition s_baltst_basicschema.h:1219
BasicSchemaAnnotationElement & makeAnnotation()
@ SELECTION_INDEX_ANNOTATION
Definition s_baltst_basicschema.h:1244
@ SELECTION_INDEX_RESTRICTION
Definition s_baltst_basicschema.h:1245
static const bdlat_SelectionInfo * lookupSelectionInfo(int id)
BasicSchemaSimpleTypeElementChoice(const BasicSchemaSimpleTypeElementChoice &original, bslma::Allocator *basicAllocator=0)
static const bdlat_SelectionInfo * lookupSelectionInfo(const char *name, int nameLength)
BasicSchemaSimpleTypeElementChoice & operator=(const BasicSchemaSimpleTypeElementChoice &rhs)
Assign to this object the value of the specified rhs object.
BasicSchemaRestrictionElement & makeRestriction(const BasicSchemaRestrictionElement &value)
BasicSchemaSimpleTypeElementChoice(bslma::Allocator *basicAllocator=0)
Definition s_baltst_basicschema.h:4865
bool isRestrictionValue() const
Definition s_baltst_basicschema.h:4952
@ SELECTION_ID_RESTRICTION
Definition s_baltst_basicschema.h:1236
@ SELECTION_ID_ANNOTATION
Definition s_baltst_basicschema.h:1235
@ SELECTION_ID_UNDEFINED
Definition s_baltst_basicschema.h:1234
bsls::ObjectBuffer< BasicSchemaRestrictionElement > d_restriction
Definition s_baltst_basicschema.h:1224
int accessSelection(ACCESSOR &accessor) const
Definition s_baltst_basicschema.h:4916
int manipulateSelection(MANIPULATOR &manipulator)
Definition s_baltst_basicschema.h:4879
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
int selectionId() const
Definition s_baltst_basicschema.h:4910
static const char CLASS_NAME[]
Definition s_baltst_basicschema.h:1249
bool isUndefinedValue() const
Definition s_baltst_basicschema.h:4958
bool isAnnotationValue() const
Definition s_baltst_basicschema.h:4946
BasicSchemaAnnotationElement & annotation()
Definition s_baltst_basicschema.h:4895
bsls::ObjectBuffer< BasicSchemaAnnotationElement > d_annotation
Definition s_baltst_basicschema.h:1223
BasicSchemaRestrictionElement & makeRestriction()
@ NUM_SELECTIONS
Definition s_baltst_basicschema.h:1240
BasicSchemaAnnotationElement & makeAnnotation(const BasicSchemaAnnotationElement &value)
const char * selectionName() const
Return the symbolic name of the current selection of this object.
static const bdlat_SelectionInfo SELECTION_INFO_ARRAY[]
Definition s_baltst_basicschema.h:1251
~BasicSchemaSimpleTypeElementChoice()
Destroy this object.
Definition s_baltst_basicschema.h:4872
BasicSchemaRestrictionElement & restriction()
Definition s_baltst_basicschema.h:4902
int makeSelection(const char *name, int nameLength)
Definition s_baltst_basicschema.h:1464
BasicSchemaSimpleTypeElement(bslma::Allocator *basicAllocator=0)
BasicSchemaSimpleTypeElement & operator=(const BasicSchemaSimpleTypeElement &rhs)
Assign to this object the value of the specified rhs object.
int accessAttributes(ACCESSOR &accessor) const
Definition s_baltst_basicschema.h:5068
int manipulateAttributes(MANIPULATOR &manipulator)
Definition s_baltst_basicschema.h:4989
static const char CLASS_NAME[]
Definition s_baltst_basicschema.h:1490
@ ATTRIBUTE_ID_CHOICE
Definition s_baltst_basicschema.h:1476
@ ATTRIBUTE_ID_PRESERVE_ENUM_ORDER
Definition s_baltst_basicschema.h:1475
@ ATTRIBUTE_ID_NAME
Definition s_baltst_basicschema.h:1474
@ ATTRIBUTE_INDEX_CHOICE
Definition s_baltst_basicschema.h:1486
@ ATTRIBUTE_INDEX_PRESERVE_ENUM_ORDER
Definition s_baltst_basicschema.h:1485
@ ATTRIBUTE_INDEX_NAME
Definition s_baltst_basicschema.h:1484
int manipulateAttribute(MANIPULATOR &manipulator, int id)
Definition s_baltst_basicschema.h:5012
@ NUM_ATTRIBUTES
Definition s_baltst_basicschema.h:1480
BasicSchemaSimpleTypeElement(const BasicSchemaSimpleTypeElement &original, bslma::Allocator *basicAllocator=0)
static const bdlat_AttributeInfo ATTRIBUTE_INFO_ARRAY[]
Definition s_baltst_basicschema.h:1492
bdlb::NullableValue< bsl::string > & name()
Definition s_baltst_basicschema.h:5049
static const bdlat_AttributeInfo * lookupAttributeInfo(const char *name, int nameLength)
bdlb::NullableValue< bsl::string > & preserveEnumOrder()
Definition s_baltst_basicschema.h:5055
static const bdlat_AttributeInfo * lookupAttributeInfo(int id)
int accessAttribute(ACCESSOR &accessor, int id) const
Definition s_baltst_basicschema.h:5091
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
~BasicSchemaSimpleTypeElement()
Destroy this object.
bsl::vector< BasicSchemaSimpleTypeElementChoice > & choice()
Definition s_baltst_basicschema.h:5061
Definition s_baltst_basicschema.h:3972
static const bdlat_AttributeInfo ATTRIBUTE_INFO_ARRAY[]
Definition s_baltst_basicschema.h:4006
bdlb::NullableValue< bsl::string > & bdem()
Definition s_baltst_basicschema.h:6716
BasicSchema & operator=(const BasicSchema &rhs)
Assign to this object the value of the specified rhs object.
int manipulateAttributes(MANIPULATOR &manipulator)
Definition s_baltst_basicschema.h:6634
@ ATTRIBUTE_INDEX_CHOICE
Definition s_baltst_basicschema.h:4000
@ ATTRIBUTE_INDEX_BDEM
Definition s_baltst_basicschema.h:3997
@ ATTRIBUTE_INDEX_ELEMENT_FORM_DEFAULT
Definition s_baltst_basicschema.h:3999
@ ATTRIBUTE_INDEX_XS
Definition s_baltst_basicschema.h:3996
@ ATTRIBUTE_INDEX_PACKAGE
Definition s_baltst_basicschema.h:3998
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
bdlb::NullableValue< bsl::string > & elementFormDefault()
Definition s_baltst_basicschema.h:6728
BasicSchema(bslma::Allocator *basicAllocator=0)
bdlb::NullableValue< bsl::string > & xs()
Return a reference to the modifiable "Xs" attribute of this object.
Definition s_baltst_basicschema.h:6710
bdlb::NullableValue< bsl::string > & package()
Definition s_baltst_basicschema.h:6722
static const bdlat_AttributeInfo * lookupAttributeInfo(const char *name, int nameLength)
@ ATTRIBUTE_ID_CHOICE
Definition s_baltst_basicschema.h:3988
@ ATTRIBUTE_ID_XS
Definition s_baltst_basicschema.h:3984
@ ATTRIBUTE_ID_ELEMENT_FORM_DEFAULT
Definition s_baltst_basicschema.h:3987
@ ATTRIBUTE_ID_PACKAGE
Definition s_baltst_basicschema.h:3986
@ ATTRIBUTE_ID_BDEM
Definition s_baltst_basicschema.h:3985
bsl::vector< BasicSchemaChoice > & choice()
Definition s_baltst_basicschema.h:6734
int accessAttribute(ACCESSOR &accessor, int id) const
Definition s_baltst_basicschema.h:6774
BasicSchema(const BasicSchema &original, bslma::Allocator *basicAllocator=0)
static const bdlat_AttributeInfo * lookupAttributeInfo(int id)
@ NUM_ATTRIBUTES
Definition s_baltst_basicschema.h:3992
~BasicSchema()
Destroy this object.
static const char CLASS_NAME[]
Definition s_baltst_basicschema.h:4004
int manipulateAttribute(MANIPULATOR &manipulator, int id)
Definition s_baltst_basicschema.h:6667
int accessAttributes(ACCESSOR &accessor) const
Definition s_baltst_basicschema.h:6741
#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
ALLOCATOR const STRING_VIEW_LIKE_TYPE & rhs
Definition bslstl_string.h:3918
ALLOCATOR & lhs
Definition bslstl_string.h:3917
bsl::enable_if<(bsl::is_integral< TYPE >::value||bsl::is_pointer< TYPE >::value||bsl::is_enum< TYPE >::value)&&!bsl::is_same< TYPE, bool >::value >::type hashAppend(HASH_ALGORITHM &hashAlg, TYPE input)
Definition bslh_hash.h:643
Definition baljsn_encoder_testtypes.h:76
Definition s_baltst_address.h:66
bsl::ostream & operator<<(bsl::ostream &stream, const BasicSchemaAnnotationElement &rhs)
bool operator==(const BasicSchemaAnnotationElement &lhs, const BasicSchemaAnnotationElement &rhs)
bool operator!=(const BasicSchemaAnnotationElement &lhs, const BasicSchemaAnnotationElement &rhs)
void hashAppend(HASH_ALGORITHM &hashAlg, const s_baltst::BasicSchemaAnnotationElement &object)
Definition s_baltst_basicschema.h:4335
Definition bdlat_attributeinfo.h:139
int d_id
Definition bdlat_attributeinfo.h:142
Definition bdlat_selectioninfo.h:138
Definition bsls_objectbuffer.h:277