BDE 4.14.0 Production release
Loading...
Searching...
No Matches
s_baltst_voidsequence.h
Go to the documentation of this file.
1/// @file s_baltst_voidsequence.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// s_baltst_voidsequence.h *DO NOT EDIT* @generated -*-C++-*-
8#ifndef INCLUDED_S_BALTST_VOIDSEQUENCE
9#define INCLUDED_S_BALTST_VOIDSEQUENCE
10
11#include <bsls_ident.h>
12BSLS_IDENT_RCSID(s_baltst_voidsequence_h, "$Id$ $CSID$")
14
15/// @defgroup s_baltst_voidsequence s_baltst_voidsequence
16/// @brief Provide value-semantic attribute classes
17/// @addtogroup Standalones
18/// @{
19/// @addtogroup s_baltst
20/// @{
21/// @addtogroup s_baltst_voidsequence
22/// @{
23///
24/// <h1> Outline </h1>
25/// * <a href="#s_baltst_voidsequence-purpose"> Purpose</a>
26///
27/// # Purpose {#s_baltst_voidsequence-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_voidsequence
40 * @{
41 */
42
43#include <bslalg_typetraits.h>
44
45#include <bdlat_attributeinfo.h>
46
47#include <bdlat_selectioninfo.h>
48
49#include <bdlat_typetraits.h>
50
51#include <bsls_objectbuffer.h>
52
53#include <bsls_assert.h>
54
55#include <bsl_iosfwd.h>
56#include <bsl_limits.h>
57
58
59
60namespace s_baltst { class VoidSequence; }
61namespace s_baltst {
62
63 // ==================
64 // class VoidSequence
65 // ==================
66
68
69 // INSTANCE DATA
70
71 public:
72 // TYPES
73 enum {
75 };
76
77
78 // CONSTANTS
79 static const char CLASS_NAME[];
80
81 public:
82 // CLASS METHODS
83
84 /// Return attribute information for the attribute indicated by the
85 /// specified `id` if the attribute exists, and 0 otherwise.
87
88 /// Return attribute information for the attribute indicated by the
89 /// specified `name` of the specified `nameLength` if the attribute
90 /// exists, and 0 otherwise.
92 const char *name,
93 int nameLength);
94
95 // CREATORS
96
97 /// Create an object of type `VoidSequence` having the default value.
99
100 /// Create an object of type `VoidSequence` having the value of the
101 /// specified `original` object.
102 VoidSequence(const VoidSequence& original);
103
104#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
105 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
106 /// Create an object of type `VoidSequence` having the value of the
107 /// specified `original` object. After performing this action, the
108 /// `original` object will be left in a valid, but unspecified state.
109 VoidSequence(VoidSequence&& original) = default;
110#endif
111
112 /// Destroy this object.
114
115 // MANIPULATORS
116
117 /// Assign to this object the value of the specified `rhs` object.
119
120#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
121 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
122 /// Assign to this object the value of the specified `rhs` object.
123 /// After performing this action, the `rhs` object will be left in a
124 /// valid, but unspecified state.
126#endif
127
128 /// Reset this object to the default value (i.e., its value upon
129 /// default construction).
130 void reset();
131
132 /// Invoke the specified `manipulator` sequentially on the address of
133 /// each (modifiable) attribute of this object, supplying `manipulator`
134 /// with the corresponding attribute information structure until such
135 /// invocation returns a non-zero value. Return the value from the
136 /// last invocation of `manipulator` (i.e., the invocation that
137 /// terminated the sequence).
138 template<class MANIPULATOR>
139 int manipulateAttributes(MANIPULATOR& manipulator);
140
141 /// Invoke the specified `manipulator` on the address of
142 /// the (modifiable) attribute indicated by the specified `id`,
143 /// supplying `manipulator` with the corresponding attribute
144 /// information structure. Return the value returned from the
145 /// invocation of `manipulator` if `id` identifies an attribute of this
146 /// class, and -1 otherwise.
147 template<class MANIPULATOR>
148 int manipulateAttribute(MANIPULATOR& manipulator, int id);
149
150 /// Invoke the specified `manipulator` on the address of
151 /// the (modifiable) attribute indicated by the specified `name` of the
152 /// specified `nameLength`, supplying `manipulator` with the
153 /// corresponding attribute information structure. Return the value
154 /// returned from the invocation of `manipulator` if `name` identifies
155 /// an attribute of this class, and -1 otherwise.
156 template<class MANIPULATOR>
157 int manipulateAttribute(MANIPULATOR& manipulator,
158 const char *name,
159 int nameLength);
160
161 // ACCESSORS
162
163 /// Format this object to the specified output `stream` at the
164 /// optionally specified indentation `level` and return a reference to
165 /// the modifiable `stream`. If `level` is specified, optionally
166 /// specify `spacesPerLevel`, the number of spaces per indentation level
167 /// for this and all of its nested objects. Each line is indented by
168 /// the absolute value of `level * spacesPerLevel`. If `level` is
169 /// negative, suppress indentation of the first line. If
170 /// `spacesPerLevel` is negative, suppress line breaks and format the
171 /// entire output on one line. If `stream` is initially invalid, this
172 /// operation has no effect. Note that a trailing newline is provided
173 /// in multiline mode only.
174 bsl::ostream& print(bsl::ostream& stream,
175 int level = 0,
176 int spacesPerLevel = 4) const;
177
178 /// Invoke the specified `accessor` sequentially on each
179 /// (non-modifiable) attribute of this object, supplying `accessor`
180 /// with the corresponding attribute information structure until such
181 /// invocation returns a non-zero value. Return the value from the
182 /// last invocation of `accessor` (i.e., the invocation that terminated
183 /// the sequence).
184 template<class ACCESSOR>
185 int accessAttributes(ACCESSOR& accessor) const;
186
187 /// Invoke the specified `accessor` on the (non-modifiable) attribute
188 /// of this object indicated by the specified `id`, supplying `accessor`
189 /// with the corresponding attribute information structure. Return the
190 /// value returned from the invocation of `accessor` if `id` identifies
191 /// an attribute of this class, and -1 otherwise.
192 template<class ACCESSOR>
193 int accessAttribute(ACCESSOR& accessor, int id) const;
194
195 /// Invoke the specified `accessor` on the (non-modifiable) attribute
196 /// of this object indicated by the specified `name` of the specified
197 /// `nameLength`, supplying `accessor` with the corresponding attribute
198 /// information structure. Return the value returned from the
199 /// invocation of `accessor` if `name` identifies an attribute of this
200 /// class, and -1 otherwise.
201 template<class ACCESSOR>
202 int accessAttribute(ACCESSOR& accessor,
203 const char *name,
204 int nameLength) const;
205};
206
207// FREE OPERATORS
208
209/// Return `true` if the specified `lhs` and `rhs` attribute objects have
210/// the same value, and `false` otherwise. Two attribute objects have the
211/// same value if each respective attribute has the same value.
212inline
213bool operator==(const VoidSequence& lhs, const VoidSequence& rhs);
214
215/// Return `true` if the specified `lhs` and `rhs` attribute objects do not
216/// have the same value, and `false` otherwise. Two attribute objects do
217/// not have the same value if one or more respective attributes differ in
218/// values.
219inline
220bool operator!=(const VoidSequence& lhs, const VoidSequence& rhs);
221
222/// Format the specified `rhs` to the specified output `stream` and
223/// return a reference to the modifiable `stream`.
224inline
225bsl::ostream& operator<<(bsl::ostream& stream, const VoidSequence& rhs);
226
227} // close package namespace
228
229// TRAITS
230
232
233// ============================================================================
234// INLINE FUNCTION DEFINITIONS
235// ============================================================================
236
237namespace s_baltst {
238
239 // ------------------
240 // class VoidSequence
241 // ------------------
242
243// CLASS METHODS
244// MANIPULATORS
245template <class MANIPULATOR>
246int VoidSequence::manipulateAttributes(MANIPULATOR& manipulator)
247{
248 (void)manipulator;
249 return 0;
250}
251
252template <class MANIPULATOR>
253int VoidSequence::manipulateAttribute(MANIPULATOR& manipulator, int id)
254{
255 (void)manipulator;
256 enum { NOT_FOUND = -1 };
257
258 switch (id) {
259 default:
260 return NOT_FOUND;
261 }
262}
263
264template <class MANIPULATOR>
266 MANIPULATOR& manipulator,
267 const char *name,
268 int nameLength)
269{
270 enum { NOT_FOUND = -1 };
271
272 const bdlat_AttributeInfo *attributeInfo =
273 lookupAttributeInfo(name, nameLength);
274 if (0 == attributeInfo) {
275 return NOT_FOUND;
276 }
277
278 return manipulateAttribute(manipulator, attributeInfo->d_id);
279}
280
281// ACCESSORS
282template <class ACCESSOR>
283int VoidSequence::accessAttributes(ACCESSOR& accessor) const
284{
285 (void)accessor;
286 return 0;
287}
288
289template <class ACCESSOR>
290int VoidSequence::accessAttribute(ACCESSOR& accessor, int id) const
291{
292 (void)accessor;
293 enum { NOT_FOUND = -1 };
294
295 switch (id) {
296 default:
297 return NOT_FOUND;
298 }
299}
300
301template <class ACCESSOR>
303 ACCESSOR& accessor,
304 const char *name,
305 int nameLength) const
306{
307 enum { NOT_FOUND = -1 };
308
309 const bdlat_AttributeInfo *attributeInfo =
310 lookupAttributeInfo(name, nameLength);
311 if (0 == attributeInfo) {
312 return NOT_FOUND;
313 }
314
315 return accessAttribute(accessor, attributeInfo->d_id);
316}
317
318} // close package namespace
319
320// FREE FUNCTIONS
321
322inline
326{
327 return true;
328}
329
330inline
334{
335 return false;
336}
337
338inline
339bsl::ostream& s_baltst::operator<<(
340 bsl::ostream& stream,
341 const s_baltst::VoidSequence& rhs)
342{
343 return rhs.print(stream, 0, -1);
344}
345
346
347#endif
348
349// GENERATED BY @BLP_BAS_CODEGEN_VERSION@
350// USING bas_codegen.pl s_baltst_voidsequence.xsd --mode msg --includedir . --msgComponent voidsequence --noRecurse --noExternalization --noHashSupport --noAggregateConversion
351// ----------------------------------------------------------------------------
352// NOTICE:
353// Copyright 2022 Bloomberg Finance L.P. All rights reserved.
354// Property of Bloomberg Finance L.P. (BFLP)
355// This software is made available solely pursuant to the
356// terms of a BFLP license agreement which governs its use.
357// ------------------------------- END-OF-FILE --------------------------------
358
359/** @} */
360/** @} */
361/** @} */
Definition s_baltst_voidsequence.h:67
int manipulateAttribute(MANIPULATOR &manipulator, int id)
Definition s_baltst_voidsequence.h:253
VoidSequence(const VoidSequence &original)
int manipulateAttributes(MANIPULATOR &manipulator)
Definition s_baltst_voidsequence.h:246
VoidSequence()
Create an object of type VoidSequence having the default value.
~VoidSequence()
Destroy this object.
static const bdlat_AttributeInfo * lookupAttributeInfo(int id)
int accessAttribute(ACCESSOR &accessor, int id) const
Definition s_baltst_voidsequence.h:290
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
static const char CLASS_NAME[]
Definition s_baltst_voidsequence.h:79
int accessAttributes(ACCESSOR &accessor) const
Definition s_baltst_voidsequence.h:283
static const bdlat_AttributeInfo * lookupAttributeInfo(const char *name, int nameLength)
VoidSequence & operator=(const VoidSequence &rhs)
Assign to this object the value of the specified rhs object.
@ NUM_ATTRIBUTES
Definition s_baltst_voidsequence.h:74
#define BDLAT_DECL_SEQUENCE_WITH_BITWISEMOVEABLE_TRAITS(ClassName)
Definition bdlat_typetraits.h:275
#define BSLS_IDENT_RCSID(tag, str)
Definition bsls_ident.h:260
#define BSLS_IDENT_PRAGMA_ONCE
Definition bsls_ident.h:310
Definition s_baltst_address.h:66
bool operator!=(const Address &lhs, const Address &rhs)
bool operator==(const Address &lhs, const Address &rhs)
bsl::ostream & operator<<(bsl::ostream &stream, const Address &rhs)
Definition bdlat_attributeinfo.h:137
int d_id
Definition bdlat_attributeinfo.h:140