8#ifndef INCLUDED_S_BALTST_TESTSEQUENCE
9#define INCLUDED_S_BALTST_TESTSEQUENCE
72 template <
class ACCESSOR>
73 static int access(ACCESSOR& accessor,
76 template <
class ACCESSOR,
class ATTRIBUTE>
77 static int access(ACCESSOR& accessor,
78 const ATTRIBUTE& attribute,
81 template <
class MANIPULATOR>
82 static int manipulate(MANIPULATOR& manipulator,
85 template <
class MANIPULATOR,
class ATTRIBUTE>
86 static int manipulate(MANIPULATOR& manipulator,
121template <
class TYPED_ATTRIBUTE_0 =
123 class TYPED_ATTRIBUTE_1 =
125 class TYPED_ATTRIBUTE_2 =
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();
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())
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))
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))
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))
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))
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))
240 d_attribute0Value.
object() = original.d_attribute0Value.
object();
241 d_attribute1Value.
object() = original.d_attribute1Value.
object();
242 d_attribute2Value.
object() = original.d_attribute2Value.
object();
252 template <
class MANIPULATOR>
254 const char *attributeName,
255 int attributeNameLength)
258 attributeNameLength);
263 &d_attribute0Value.
object(),
264 Attribute0::attributeInfo());
270 &d_attribute1Value.
object(),
271 Attribute1::attributeInfo());
277 &d_attribute2Value.
object(),
278 Attribute2::attributeInfo());
290 template <
class MANIPULATOR>
296 &d_attribute0Value.
object(),
297 Attribute0::attributeInfo());
303 &d_attribute1Value.
object(),
304 Attribute1::attributeInfo());
310 &d_attribute2Value.
object(),
311 Attribute2::attributeInfo());
322 template <
class MANIPULATOR>
327 &d_attribute0Value.
object(),
328 Attribute0::attributeInfo());
336 &d_attribute1Value.
object(),
337 Attribute1::attributeInfo());
345 &d_attribute2Value.
object(),
346 Attribute2::attributeInfo());
378 template <
class ACCESSOR>
380 const char *attributeName,
381 int attributeNameLength)
const
384 attributeNameLength);
388 d_attribute0Value.
object(),
389 Attribute0::attributeInfo());
394 d_attribute1Value.
object(),
395 Attribute1::attributeInfo());
400 d_attribute2Value.
object(),
401 Attribute2::attributeInfo());
412 template <
class ACCESSOR>
417 d_attribute0Value.
object(),
418 Attribute0::attributeInfo());
423 d_attribute1Value.
object(),
424 Attribute1::attributeInfo());
429 d_attribute2Value.
object(),
430 Attribute2::attributeInfo());
440 template <
class ACCESSOR>
445 d_attribute0Value.
object(),
446 Attribute0::attributeInfo());
454 d_attribute1Value.
object(),
455 Attribute1::attributeInfo());
463 d_attribute2Value.
object(),
464 Attribute2::attributeInfo());
483 bool hasAttribute(
const char *attributeName,
int attributeNameLength)
const
486 attributeNameLength);
525 return d_attribute0Value.
object();
531 return d_attribute1Value.
object();
537 return d_attribute2Value.
object();
542template <
class V0,
class V1,
class V2>
548 stream <<
"[" <<
object.
className() <<
" ";
550 if (Sequence::k_HAS_ATTRIBUTE_0) {
551 stream << Sequence::Attribute0::name() <<
" = " <<
object.attribute0();
554 if (Sequence::k_HAS_ATTRIBUTE_1) {
555 stream <<
", " << Sequence::Attribute1::name() <<
" = "
556 <<
object.attribute1();
559 if (Sequence::k_HAS_ATTRIBUTE_2) {
560 stream <<
", " << Sequence::Attribute2::name() <<
" = "
561 <<
object.attribute2();
564 return stream <<
"]";
567template <
class V0,
class V1,
class V2>
574template <
class V0,
class V1,
class V2>
585template <
class V0,
class V1,
class V2>
588 return object.className();
597template <
class V0,
class V1,
class V2,
class MANIPULATOR>
600 MANIPULATOR& manipulator,
601 const char *attributeName,
602 int attributeNameLength)
604 return object->manipulateAttribute(
605 manipulator, attributeName, attributeNameLength);
614template <
class V0,
class V1,
class V2,
class MANIPULATOR>
616 MANIPULATOR& manipulator,
619 return object->manipulateAttribute(manipulator, attributeId);
627template <
class V0,
class V1,
class V2,
class MANIPULATOR>
629 MANIPULATOR& manipulator)
631 return object->manipulateAttributes(manipulator);
640template <
class V0,
class V1,
class V2,
class ACCESSOR>
644 const char *attributeName,
645 int attributeNameLength)
647 return object.accessAttribute(
648 accessor, attributeName, attributeNameLength);
656template <
class V0,
class V1,
class V2,
class ACCESSOR>
661 return object.accessAttribute(accessor, attributeId);
668template <
class V0,
class V1,
class V2,
class ACCESSOR>
672 return object.accessAttributes(accessor);
678template <
class V0,
class V1,
class V2>
681 const char *attributeName,
682 int attributeNameLength)
684 return object.hasAttribute(attributeName, attributeNameLength);
689template <
class V0,
class V1,
class V2>
693 return object.hasAttribute(attributeId);
696template <
class V0,
class V1,
class V2>
704template <
class V0,
class V1,
class V2>
714template <
class V0,
class V1,
class V2>
736template <
class ACCESSOR>
744template <
class ACCESSOR,
class ATTRIBUTE>
746 const ATTRIBUTE& attribute,
749 return accessor(attribute, attributeInfo);
752template <
class MANIPULATOR>
760template <
class MANIPULATOR,
class ATTRIBUTE>
762 MANIPULATOR& manipulator,
763 ATTRIBUTE *attribute,
766 return manipulator(attribute, attributeInfo);
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