BDE 4.14.0 Production release
Loading...
Searching...
No Matches
s_baltst_testsequence.h
Go to the documentation of this file.
1/// @file s_baltst_testsequence.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// s_baltst_testsequence.h -*-C++-*-
8#ifndef INCLUDED_S_BALTST_TESTSEQUENCE
9#define INCLUDED_S_BALTST_TESTSEQUENCE
10
11#include <bsls_ident.h>
12BSLS_IDENT("$Id: $")
13
14/// @defgroup s_baltst_testsequence s_baltst_testsequence
15/// @brief Provide a test implementation of a `bdlat` "sequence" type.
16/// @addtogroup Standalones
17/// @{
18/// @addtogroup s_baltst
19/// @{
20/// @addtogroup s_baltst_testsequence
21/// @{
22///
23/// <h1> Outline </h1>
24/// * <a href="#s_baltst_testsequence-purpose"> Purpose</a>
25/// * <a href="#s_baltst_testsequence-classes"> Classes </a>
26///
27/// # Purpose {#s_baltst_testsequence-purpose}
28/// Provide a test implementation of a `bdlat` "sequence" type.
29///
30/// # Classes {#s_baltst_testsequence-classes}
31///
32/// - s_baltst::TestSequence: test implementation of a `bdlat` "sequence" type
33/// @}
34/** @} */
35/** @} */
36
37/** @addtogroup Standalones
38 * @{
39 */
40/** @addtogroup s_baltst
41 * @{
42 */
43/** @addtogroup s_baltst_testsequence
44 * @{
45 */
46/
48#include <bdlat_typetraits.h>
50
52
53#include <bslma_allocator.h>
55
58
61
62
63namespace s_baltst {
64
65 // ============================
66 // struct TestSequence_ImplUtil
67 // ============================
68
70
71 // CLASS METHODS
72 template <class ACCESSOR>
73 static int access(ACCESSOR& accessor,
74 const TestNilValue attribute,
75 const bdlat_AttributeInfo& attributeInfo);
76 template <class ACCESSOR, class ATTRIBUTE>
77 static int access(ACCESSOR& accessor,
78 const ATTRIBUTE& attribute,
79 const bdlat_AttributeInfo& attributeInfo);
80
81 template <class MANIPULATOR>
82 static int manipulate(MANIPULATOR& manipulator,
83 TestNilValue *attribute,
84 const bdlat_AttributeInfo& attributeInfo);
85 template <class MANIPULATOR, class ATTRIBUTE>
86 static int manipulate(MANIPULATOR& manipulator,
87 ATTRIBUTE *attribute,
88 const bdlat_AttributeInfo& attributeInfo);
89};
90
91 // ==================
92 // class TestSequence
93 // ==================
94
95/// This in-core value-semantic class provides a basic implementation of the
96/// concept defined by the `bdlat` `Sequence` type category. The template
97/// parameters `TYPED_ATTRIBUTE_0`, `TYPED_ATTRIBUTE_1`, and
98/// `TYPED_ATTRIBUTE_2` must all satisfy the following requirements:
99/// * The type must have two member type definitions, `Type` and
100/// `Attribute`.
101/// * `Type` must meet the requirements of an in-core value-semantic type.
102/// * `Type` must meet the requirements of exactly one of the
103/// `bdlat` value categories.
104/// * `Attribute` must be a specialization of the `TestAttribute` type.
105/// Further, each `TestAttribute` member type definition of a template
106/// argument must return values for `TestAttribute::id()` and
107/// `TestAttribute::name()` that are different from all others within this
108/// `TestSequence` specialization.
109///
110/// Additionally, the `Type` of any template argument may be `TestNilValue`
111/// if all `Type` member type definitions of subsequent template arguments
112/// are also `TestNilValue`.
113///
114/// The `Type` and `Attribute` member type definitions of the template
115/// arguments define the type and `bdlat_AttributeInfo` of the attributes of
116/// the `bdlat` `Selection` implementation provided by this class. A
117/// template argument having a `TestNilValue` `Type` indicates that the
118/// corresponding attribute does not exist.
119///
120/// See @ref s_baltst_testsequence
121template <class TYPED_ATTRIBUTE_0 =
123 class TYPED_ATTRIBUTE_1 =
125 class TYPED_ATTRIBUTE_2 =
128
129 public:
130 // TYPES
131 typedef typename TYPED_ATTRIBUTE_0::Type Attribute0Type;
132 typedef typename TYPED_ATTRIBUTE_0::Attribute Attribute0;
133 typedef typename TYPED_ATTRIBUTE_1::Type Attribute1Type;
134 typedef typename TYPED_ATTRIBUTE_1::Attribute Attribute1;
135 typedef typename TYPED_ATTRIBUTE_2::Type Attribute2Type;
136 typedef typename TYPED_ATTRIBUTE_2::Attribute Attribute2;
137
138 // CLASS DATA
139 enum {
145 };
146
147 private:
148 // PRIVATE TYPES
149 typedef TestSequence_ImplUtil ImplUtil;
150
151 // DATA
155 bslma::Allocator *d_allocator_p;
156
157 public:
158 // TRAITS
160
161 // CLASS METHODS
162 static bool areEqual(const TestSequence& lhs, const TestSequence& rhs)
163 {
164 return lhs.d_attribute0Value.object() ==
165 rhs.d_attribute0Value.object() &&
166 lhs.d_attribute1Value.object() ==
167 rhs.d_attribute1Value.object() &&
168 lhs.d_attribute2Value.object() ==
169 rhs.d_attribute2Value.object();
170 }
171
172 // CREATORS
174 : d_attribute0Value(bslma::Default::allocator())
175 , d_attribute1Value(bslma::Default::allocator())
176 , d_attribute2Value(bslma::Default::allocator())
177 , d_allocator_p(bslma::Default::allocator())
178 {
179 }
180
181 explicit TestSequence(bslma::Allocator *basicAllocator)
182 : d_attribute0Value(bslma::Default::allocator(basicAllocator))
183 , d_attribute1Value(bslma::Default::allocator(basicAllocator))
184 , d_attribute2Value(bslma::Default::allocator(basicAllocator))
185 , d_allocator_p(bslma::Default::allocator(basicAllocator))
186 {
187 }
188
190 bslma::Allocator *basicAllocator = 0)
191 : d_attribute0Value(attribute0, bslma::Default::allocator(basicAllocator))
192 , d_attribute1Value(bslma::Default::allocator(basicAllocator))
193 , d_attribute2Value(bslma::Default::allocator(basicAllocator))
194 , d_allocator_p(bslma::Default::allocator(basicAllocator))
195 {
197 }
198
201 bslma::Allocator *basicAllocator = 0)
202 : d_attribute0Value(attribute0, bslma::Default::allocator(basicAllocator))
203 , d_attribute1Value(attribute1, bslma::Default::allocator(basicAllocator))
204 , d_attribute2Value(bslma::Default::allocator(basicAllocator))
205 , d_allocator_p(bslma::Default::allocator(basicAllocator))
206 {
209 }
210
214 bslma::Allocator *basicAllocator = 0)
215 : d_attribute0Value(attribute0, bslma::Default::allocator(basicAllocator))
216 , d_attribute1Value(attribute1, bslma::Default::allocator(basicAllocator))
217 , d_attribute2Value(attribute2, bslma::Default::allocator(basicAllocator))
218 , d_allocator_p(bslma::Default::allocator(basicAllocator))
219 {
223 }
224
225 TestSequence(const TestSequence& original,
226 bslma::Allocator *basicAllocator = 0)
227 : d_attribute0Value(original.d_attribute0Value.object(),
228 bslma::Default::allocator(basicAllocator))
229 , d_attribute1Value(original.d_attribute1Value.object(),
230 bslma::Default::allocator(basicAllocator))
231 , d_attribute2Value(original.d_attribute2Value.object(),
232 bslma::Default::allocator(basicAllocator))
233 , d_allocator_p(bslma::Default::allocator(basicAllocator))
234 {
235 }
236
237 // MANIPULATORS
239 {
240 d_attribute0Value.object() = original.d_attribute0Value.object();
241 d_attribute1Value.object() = original.d_attribute1Value.object();
242 d_attribute2Value.object() = original.d_attribute2Value.object();
243 return *this;
244 }
245
246 /// Invoke the specified `manipulator` on the address of the
247 /// (modifiable) attribute indicated by the specified `attributeName`
248 /// and `attributeNameLength` of this object, supplying `manipulator`
249 /// with the corresponding attribute information structure. Return a
250 /// non-zero value if the attribute is not found, and the value returned
251 /// from the invocation of `manipulator` otherwise.
252 template <class MANIPULATOR>
253 int manipulateAttribute(MANIPULATOR& manipulator,
254 const char *attributeName,
255 int attributeNameLength)
256 {
257 const bslstl::StringRef attributeNameRef(attributeName ,
258 attributeNameLength);
259
260 if (k_HAS_ATTRIBUTE_0 && Attribute0::name() == attributeNameRef) {
262 manipulator,
263 &d_attribute0Value.object(),
264 Attribute0::attributeInfo()); // RETURN
265 }
266
267 if (k_HAS_ATTRIBUTE_1 && Attribute1::name() == attributeNameRef) {
269 manipulator,
270 &d_attribute1Value.object(),
271 Attribute1::attributeInfo()); // RETURN
272 }
273
274 if (k_HAS_ATTRIBUTE_2 && Attribute2::name() == attributeNameRef) {
276 manipulator,
277 &d_attribute2Value.object(),
278 Attribute2::attributeInfo()); // RETURN
279 }
280
281 return -1;
282 }
283
284 /// Invoke the specified `manipulator` on the address of the
285 /// (modifiable) attribute indicated by the specified `attributeId` of
286 /// this object, supplying `manipulator` with the corresponding
287 /// attribute information structure. Return a non-zero value if the
288 /// attribute is not found, and the value returned from the invocation
289 /// of `manipulator` otherwise.
290 template <class MANIPULATOR>
291 int manipulateAttribute(MANIPULATOR& manipulator, int attributeId)
292 {
293 if (k_HAS_ATTRIBUTE_0 && Attribute0::id() == attributeId) {
295 manipulator,
296 &d_attribute0Value.object(),
297 Attribute0::attributeInfo()); // RETURN
298 }
299
300 if (k_HAS_ATTRIBUTE_1 && Attribute1::id() == attributeId) {
302 manipulator,
303 &d_attribute1Value.object(),
304 Attribute1::attributeInfo()); // RETURN
305 }
306
307 if (k_HAS_ATTRIBUTE_2 && Attribute2::id() == attributeId) {
309 manipulator,
310 &d_attribute2Value.object(),
311 Attribute2::attributeInfo()); // RETURN
312 }
313
314 return -1;
315 }
316
317 /// Invoke the specified `manipulator` sequentially on the address of
318 /// each (modifiable) attribute of this object, supplying `manipulator`
319 /// with the corresponding attribute information structure until such
320 /// invocation returns a non-zero value. Return the value from the last
321 /// invocation of `manipulator`.
322 template <class MANIPULATOR>
323 int manipulateAttributes(MANIPULATOR& manipulator)
324 {
325 if (k_HAS_ATTRIBUTE_0) {
326 int rc = ImplUtil::manipulate(manipulator,
327 &d_attribute0Value.object(),
328 Attribute0::attributeInfo());
329 if (0 != rc) {
330 return rc; // RETURN
331 }
332 }
333
334 if (k_HAS_ATTRIBUTE_1) {
335 int rc = ImplUtil::manipulate(manipulator,
336 &d_attribute1Value.object(),
337 Attribute1::attributeInfo());
338 if (0 != rc) {
339 return rc; // RETURN
340 }
341 }
342
343 if (k_HAS_ATTRIBUTE_2) {
344 int rc = ImplUtil::manipulate(manipulator,
345 &d_attribute2Value.object(),
346 Attribute2::attributeInfo());
347 if (0 != rc) {
348 return rc; // RETURN
349 }
350 }
351
352 return 0;
353 }
354
355 void reset()
356 {
357 if (k_HAS_ATTRIBUTE_0) {
358 bdlat_ValueTypeFunctions::reset(&d_attribute0Value.object());
359 }
360
361 if (k_HAS_ATTRIBUTE_1) {
362 bdlat_ValueTypeFunctions::reset(&d_attribute1Value.object());
363 }
364
365 if (k_HAS_ATTRIBUTE_2) {
366 bdlat_ValueTypeFunctions::reset(&d_attribute2Value.object());
367 }
368 }
369
370 // ACCESSORS
371
372 /// Invoke the specified `accessor` on the (non-modifiable) attribute of
373 /// this object indicated by the specified `attributeName` and
374 /// `attributeNameLength`, supplying `accessor` with the corresponding
375 /// attribute information structure. Return a non-zero value if the
376 /// attribute is not found, and the value returned from the invocation
377 /// of `accessor` otherwise.
378 template <class ACCESSOR>
379 int accessAttribute(ACCESSOR& accessor,
380 const char *attributeName,
381 int attributeNameLength) const
382 {
383 const bslstl::StringRef attributeNameRef(attributeName ,
384 attributeNameLength);
385
386 if (k_HAS_ATTRIBUTE_0 && Attribute0::name() == attributeNameRef) {
387 return ImplUtil::access(accessor,
388 d_attribute0Value.object(),
389 Attribute0::attributeInfo()); // RETURN
390 }
391
392 if (k_HAS_ATTRIBUTE_1 && Attribute1::name() == attributeNameRef) {
393 return ImplUtil::access(accessor,
394 d_attribute1Value.object(),
395 Attribute1::attributeInfo()); // RETURN
396 }
397
398 if (k_HAS_ATTRIBUTE_2 && Attribute2::name() == attributeNameRef) {
399 return ImplUtil::access(accessor,
400 d_attribute2Value.object(),
401 Attribute2::attributeInfo()); // RETURN
402 }
403
404 return -1;
405 }
406
407 /// Invoke the specified `accessor` on the attribute of this object with
408 /// the given `attributeId`, supplying `accessor` with the corresponding
409 /// attribute information structure. Return non-zero if the attribute
410 /// is not found, and the value returned from the invocation of
411 /// `accessor` otherwise.
412 template <class ACCESSOR>
413 int accessAttribute(ACCESSOR& accessor, int attributeId) const
414 {
415 if (k_HAS_ATTRIBUTE_0 && Attribute0::id() == attributeId) {
416 return ImplUtil::access(accessor,
417 d_attribute0Value.object(),
418 Attribute0::attributeInfo()); // RETURN
419 }
420
421 if (k_HAS_ATTRIBUTE_1 && Attribute1::id() == attributeId) {
422 return ImplUtil::access(accessor,
423 d_attribute1Value.object(),
424 Attribute1::attributeInfo()); // RETURN
425 }
426
427 if (k_HAS_ATTRIBUTE_2 && Attribute2::id() == attributeId) {
428 return ImplUtil::access(accessor,
429 d_attribute2Value.object(),
430 Attribute2::attributeInfo()); // RETURN
431 }
432
433 return -1;
434 }
435
436 /// Invoke the specified `accessor` sequentially on each attribute of
437 /// this object, supplying `accessor` with the corresponding attribute
438 /// information structure until such invocation returns a non-zero
439 /// value. Return the value from the last invocation of `accessor`.
440 template <class ACCESSOR>
441 int accessAttributes(ACCESSOR& accessor) const
442 {
443 if (k_HAS_ATTRIBUTE_0) {
444 int rc = ImplUtil::access(accessor,
445 d_attribute0Value.object(),
446 Attribute0::attributeInfo());
447 if (0 != rc) {
448 return rc; // RETURN
449 }
450 }
451
452 if (k_HAS_ATTRIBUTE_1) {
453 int rc = ImplUtil::access(accessor,
454 d_attribute1Value.object(),
455 Attribute1::attributeInfo());
456 if (0 != rc) {
457 return rc; // RETURN
458 }
459 }
460
461 if (k_HAS_ATTRIBUTE_2) {
462 int rc = ImplUtil::access(accessor,
463 d_attribute2Value.object(),
464 Attribute2::attributeInfo());
465 if (0 != rc) {
466 return rc; // RETURN
467 }
468 }
469
470 return 0;
471 }
472
473 /// Return a null-terminated string containing the exported name for
474 /// this class.
475 const char *className() const
476 {
477 return "MySequence";
478 }
479
480 /// Return `true` if this object has an attribute with the specified
481 /// `attributeName` of the specified `attributeNameLength`, and `false`
482 /// otherwise.
483 bool hasAttribute(const char *attributeName, int attributeNameLength) const
484 {
485 const bslstl::StringRef attributeNameRef(attributeName ,
486 attributeNameLength);
487
488 if (k_HAS_ATTRIBUTE_0 && Attribute0::name() == attributeNameRef) {
489 return true; // RETURN
490 }
491
492 if (k_HAS_ATTRIBUTE_1 && Attribute1::name() == attributeNameRef) {
493 return true; // RETURN
494 }
495
496 if (k_HAS_ATTRIBUTE_2 && Attribute2::name() == attributeNameRef) {
497 return true; // RETURN
498 }
499
500 return false;
501 }
502
503 /// Return `true` if this object has an attribute with the specified
504 /// `attributeId`, and `false` otherwise.
505 bool hasAttribute(int attributeId) const
506 {
507 if (k_HAS_ATTRIBUTE_0 && Attribute0::id() == attributeId) {
508 return true; // RETURN
509 }
510
511 if (k_HAS_ATTRIBUTE_1 && Attribute1::id() == attributeId) {
512 return true; // RETURN
513 }
514
515 if (k_HAS_ATTRIBUTE_2 && Attribute2::id() == attributeId) {
516 return true; // RETURN
517 }
518
519 return false;
520 }
521
523 {
525 return d_attribute0Value.object();
526 }
527
529 {
531 return d_attribute1Value.object();
532 }
533
535 {
537 return d_attribute2Value.object();
538 }
539};
540
541// FREE OPERATORS
542template <class V0, class V1, class V2>
543bsl::ostream& operator<<(bsl::ostream& stream,
544 const TestSequence<V0, V1, V2>& object)
545{
546 typedef TestSequence<V0, V1, V2> Sequence;
547
548 stream << "[" << object.className() << " ";
549
550 if (Sequence::k_HAS_ATTRIBUTE_0) {
551 stream << Sequence::Attribute0::name() << " = " << object.attribute0();
552 }
553
554 if (Sequence::k_HAS_ATTRIBUTE_1) {
555 stream << ", " << Sequence::Attribute1::name() << " = "
556 << object.attribute1();
557 }
558
559 if (Sequence::k_HAS_ATTRIBUTE_2) {
560 stream << ", " << Sequence::Attribute2::name() << " = "
561 << object.attribute2();
562 }
563
564 return stream << "]";
565}
566
567template <class V0, class V1, class V2>
568bool operator==(const TestSequence<V0, V1, V2>& lhs,
569 const TestSequence<V0, V1, V2>& rhs)
570{
571 return TestSequence<V0, V1, V2>::areEqual(lhs, rhs);
572}
573
574template <class V0, class V1, class V2>
575bool operator!=(const TestSequence<V0, V1, V2>& lhs,
576 const TestSequence<V0, V1, V2>& rhs)
577{
578 return !TestSequence<V0, V1, V2>::areEqual(lhs, rhs);
579}
580
581// TRAITS
582
583/// Return a null-terminated string containing the exported name for the
584/// type of the specified `object`.
585template <class V0, class V1, class V2>
587{
588 return object.className();
589}
590
591/// Invoke the specified `manipulator` on the address of the (modifiable)
592/// attribute indicated by the specified `attributeName` and
593/// `attributeNameLength` of the specified `object`, supplying `manipulator`
594/// with the corresponding attribute information structure. Return a
595/// non-zero value if the attribute is not found, and the value returned
596/// from the invocation of `manipulator` otherwise.
597template <class V0, class V1, class V2, class MANIPULATOR>
600 MANIPULATOR& manipulator,
601 const char *attributeName,
602 int attributeNameLength)
603{
604 return object->manipulateAttribute(
605 manipulator, attributeName, attributeNameLength);
606}
607
608/// Invoke the specified `manipulator` on the address of the (modifiable)
609/// attribute indicated by the specified `attributeId` of the specified
610/// `object`, supplying `manipulator` with the corresponding attribute
611/// information structure. Return a non-zero value if the attribute is not
612/// found, and the value returned from the invocation of `manipulator`
613/// otherwise.
614template <class V0, class V1, class V2, class MANIPULATOR>
616 MANIPULATOR& manipulator,
617 int attributeId)
618{
619 return object->manipulateAttribute(manipulator, attributeId);
620}
621
622/// Invoke the specified `manipulator` sequentially on the address of each
623/// (modifiable) attribute of the specified `object`, supplying
624/// `manipulator` with the corresponding attribute information structure
625/// until such invocation returns a non-zero value. Return the value from
626/// the last invocation of `manipulator`.
627template <class V0, class V1, class V2, class MANIPULATOR>
629 MANIPULATOR& manipulator)
630{
631 return object->manipulateAttributes(manipulator);
632}
633
634/// Invoke the specified `accessor` on the (non-modifiable) attribute of the
635/// specified `object` indicated by the specified `attributeName` and
636/// `attributeNameLength`, supplying `accessor` with the corresponding
637/// attribute information structure. Return a non-zero value if the
638/// attribute is not found, and the value returned from the invocation of
639/// `accessor` otherwise.
640template <class V0, class V1, class V2, class ACCESSOR>
642 const TestSequence<V0, V1, V2>& object,
643 ACCESSOR& accessor,
644 const char *attributeName,
645 int attributeNameLength)
646{
647 return object.accessAttribute(
648 accessor, attributeName, attributeNameLength);
649}
650
651/// Invoke the specified `accessor` on the attribute of the specified
652/// `object` with the given `attributeId`, supplying `accessor` with the
653/// corresponding attribute information structure. Return non-zero if the
654/// attribute is not found, and the value returned from the invocation of
655/// `accessor` otherwise.
656template <class V0, class V1, class V2, class ACCESSOR>
658 ACCESSOR& accessor,
659 int attributeId)
660{
661 return object.accessAttribute(accessor, attributeId);
662}
663
664/// Invoke the specified `accessor` sequentially on each attribute of the
665/// specified `object`, supplying `accessor` with the corresponding
666/// attribute information structure until such invocation returns a non-zero
667/// value. Return the value from the last invocation of `accessor`.
668template <class V0, class V1, class V2, class ACCESSOR>
670 ACCESSOR& accessor)
671{
672 return object.accessAttributes(accessor);
673}
674
675/// Return `true` if the specified `object` has an attribute with the
676/// specified `attributeName` of the specified `attributeNameLength`, and
677/// `false` otherwise.
678template <class V0, class V1, class V2>
680 const TestSequence<V0, V1, V2>& object,
681 const char *attributeName,
682 int attributeNameLength)
683{
684 return object.hasAttribute(attributeName, attributeNameLength);
685}
686
687/// Return `true` if the specified `object` has an attribute with the
688/// specified `attributeId`, and `false` otherwise.
689template <class V0, class V1, class V2>
691 int attributeId)
692{
693 return object.hasAttribute(attributeId);
694}
695
696template <class V0, class V1, class V2>
698 const TestSequence<V0, V1, V2>& rhs)
699{
700 *lhs = rhs;
701 return 0;
702}
703
704template <class V0, class V1, class V2>
706{
707 object->reset();
708}
709
710} // close package namespace
711
712namespace bdlat_SequenceFunctions {
713
714template <class V0, class V1, class V2>
715struct IsSequence<s_baltst::TestSequence<V0, V1, V2> >
716: public bsl::true_type {
717};
718
719} // close bdlat_SequenceFunctions namespace
720
721namespace s_baltst {
722
723// ============================================================================
724// INLINE DEFINITIONS
725// ============================================================================
726
727 // ------------------
728 // class TestSequence
729 // ------------------
730
731 // ----------------------------
732 // struct TestSequence_ImplUtil
733 // ----------------------------
734
735// CLASS METHODS
736template <class ACCESSOR>
738 const TestNilValue,
739 const bdlat_AttributeInfo&)
740{
741 return 0;
742}
743
744template <class ACCESSOR, class ATTRIBUTE>
745int TestSequence_ImplUtil::access(ACCESSOR& accessor,
746 const ATTRIBUTE& attribute,
747 const bdlat_AttributeInfo& attributeInfo)
748{
749 return accessor(attribute, attributeInfo);
750}
751
752template <class MANIPULATOR>
754 TestNilValue *,
755 const bdlat_AttributeInfo&)
756{
757 return 0;
758}
759
760template <class MANIPULATOR, class ATTRIBUTE>
762 MANIPULATOR& manipulator,
763 ATTRIBUTE *attribute,
764 const bdlat_AttributeInfo& attributeInfo)
765{
766 return manipulator(attribute, attributeInfo);
767}
768
769} // close package namespace
770
771
772#endif // INCLUDED_S_BALTST_TESTSEQUENCE
773
774// ----------------------------------------------------------------------------
775// Copyright 2021 Bloomberg Finance L.P.
776//
777// Licensed under the Apache License, Version 2.0 (the "License");
778// you may not use this file except in compliance with the License.
779// You may obtain a copy of the License at
780//
781// http://www.apache.org/licenses/LICENSE-2.0
782//
783// Unless required by applicable law or agreed to in writing, software
784// distributed under the License is distributed on an "AS IS" BASIS,
785// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
786// See the License for the specific language governing permissions and
787// limitations under the License.
788// ----------------------------- END-OF-FILE ----------------------------------
789
790/** @} */
791/** @} */
792/** @} */
Definition bslalg_constructorproxy.h:368
OBJECT_TYPE & object() BSLS_KEYWORD_NOEXCEPT
Return a reference to the modifiable object held by this proxy.
Definition bslalg_constructorproxy.h:1187
Definition bslma_allocator.h:457
Definition bslstl_stringref.h:372
Definition s_baltst_testnilvalue.h:60
Definition s_baltst_testsequence.h:127
TYPED_ATTRIBUTE_1::Type Attribute1Type
Definition s_baltst_testsequence.h:133
TestSequence(const TestSequence &original, bslma::Allocator *basicAllocator=0)
Definition s_baltst_testsequence.h:225
TYPED_ATTRIBUTE_1::Attribute Attribute1
Definition s_baltst_testsequence.h:134
TYPED_ATTRIBUTE_2::Attribute Attribute2
Definition s_baltst_testsequence.h:136
int manipulateAttribute(MANIPULATOR &manipulator, const char *attributeName, int attributeNameLength)
Definition s_baltst_testsequence.h:253
int manipulateAttributes(MANIPULATOR &manipulator)
Definition s_baltst_testsequence.h:323
const Attribute1Type attribute1() const
Definition s_baltst_testsequence.h:528
TYPED_ATTRIBUTE_0::Type Attribute0Type
Definition s_baltst_testsequence.h:131
const Attribute2Type attribute2() const
Definition s_baltst_testsequence.h:534
TYPED_ATTRIBUTE_0::Attribute Attribute0
Definition s_baltst_testsequence.h:132
int accessAttribute(ACCESSOR &accessor, const char *attributeName, int attributeNameLength) const
Definition s_baltst_testsequence.h:379
TestSequence(const Attribute0Type attribute0, bslma::Allocator *basicAllocator=0)
Definition s_baltst_testsequence.h:189
TestSequence()
Definition s_baltst_testsequence.h:173
TestSequence(const Attribute0Type attribute0, const Attribute1Type attribute1, const Attribute2Type attribute2, bslma::Allocator *basicAllocator=0)
Definition s_baltst_testsequence.h:211
void reset()
Definition s_baltst_testsequence.h:355
int manipulateAttribute(MANIPULATOR &manipulator, int attributeId)
Definition s_baltst_testsequence.h:291
static bool areEqual(const TestSequence &lhs, const TestSequence &rhs)
Definition s_baltst_testsequence.h:162
TestSequence(bslma::Allocator *basicAllocator)
Definition s_baltst_testsequence.h:181
TestSequence(const Attribute0Type attribute0, const Attribute1Type attribute1, bslma::Allocator *basicAllocator=0)
Definition s_baltst_testsequence.h:199
TestSequence & operator=(const TestSequence &original)
Definition s_baltst_testsequence.h:238
int accessAttributes(ACCESSOR &accessor) const
Definition s_baltst_testsequence.h:441
int accessAttribute(ACCESSOR &accessor, int attributeId) const
Definition s_baltst_testsequence.h:413
const char * className() const
Definition s_baltst_testsequence.h:475
bool hasAttribute(int attributeId) const
Definition s_baltst_testsequence.h:505
@ k_HAS_ATTRIBUTE_0
Definition s_baltst_testsequence.h:140
@ k_HAS_ATTRIBUTE_1
Definition s_baltst_testsequence.h:142
@ k_HAS_ATTRIBUTE_2
Definition s_baltst_testsequence.h:144
bool hasAttribute(const char *attributeName, int attributeNameLength) const
Definition s_baltst_testsequence.h:483
TYPED_ATTRIBUTE_2::Type Attribute2Type
Definition s_baltst_testsequence.h:135
const Attribute0Type attribute0() const
Definition s_baltst_testsequence.h:522
BSLMF_NESTED_TRAIT_DECLARATION(TestSequence, bslma::UsesBslmaAllocator)
Definition s_baltst_testattribute.h:138
#define BSLMF_ASSERT(expr)
Definition bslmf_assert.h:229
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_IDENT(str)
Definition bsls_ident.h:195
Definition bdlat_sequencefunctions.h:635
void reset(TYPE *object)
Reset the value of the specified object to its default value.
Definition balxml_encoderoptions.h:68
Definition s_baltst_address.h:66
int bdlat_sequenceHasAttribute(const TestDynamicType< VALUE_TYPE > &object, const char *attributeName, int attributeNameLength)
Definition s_baltst_testdynamictype.h:2059
int bdlat_sequenceAccessAttributes(const TestDynamicType< VALUE_TYPE > &object, ACCESSOR &accessor)
Definition s_baltst_testdynamictype.h:2052
int bdlat_sequenceManipulateAttributes(TestDynamicType< VALUE_TYPE > *object, MANIPULATOR &manipulator)
Definition s_baltst_testdynamictype.h:2094
int bdlat_valueTypeAssign(TestChoice< C0, C1, C2 > *lhs, const TestChoice< C0, C1, C2 > &rhs)
Definition s_baltst_testchoice.h:774
const char * bdlat_TypeName_className(const TestChoice< C0, C1, C2 > &object)
Definition s_baltst_testchoice.h:718
bsl::ostream & operator<<(bsl::ostream &stream, const Address &rhs)
void bdlat_valueTypeReset(TestChoice< C0, C1, C2 > *object)
Definition s_baltst_testchoice.h:782
int bdlat_sequenceManipulateAttribute(TestDynamicType< VALUE_TYPE > *object, MANIPULATOR &manipulator, const char *attributeName, int attributeNameLength)
Definition s_baltst_testdynamictype.h:2075
int bdlat_sequenceAccessAttribute(const TestDynamicType< VALUE_TYPE > &object, ACCESSOR &accessor, const char *attributeName, int attributeNameLength)
Definition s_baltst_testdynamictype.h:2032
Definition bdlat_attributeinfo.h:137
Definition bdlat_sequencefunctions.h:649
Definition bslma_usesbslmaallocator.h:343
Definition bslmf_issame.h:181
Definition s_baltst_testsequence.h:69
static int manipulate(MANIPULATOR &manipulator, TestNilValue *attribute, const bdlat_AttributeInfo &attributeInfo)
Definition s_baltst_testsequence.h:753
static int access(ACCESSOR &accessor, const TestNilValue attribute, const bdlat_AttributeInfo &attributeInfo)
Definition s_baltst_testsequence.h:737