BDE 4.39.x 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 // MANIPULATORS
98
99 /// Reset this object to the default value (i.e., its value upon
100 /// default construction).
101 void reset();
102
103 /// Invoke the specified `manipulator` sequentially on the address of
104 /// each (modifiable) attribute of this object, supplying `manipulator`
105 /// with the corresponding attribute information structure until such
106 /// invocation returns a non-zero value. Return the value from the
107 /// last invocation of `manipulator` (i.e., the invocation that
108 /// terminated the sequence).
109 template <typename t_MANIPULATOR>
110 int manipulateAttributes(t_MANIPULATOR& manipulator);
111
112 /// Invoke the specified `manipulator` on the address of
113 /// the (modifiable) attribute indicated by the specified `id`,
114 /// supplying `manipulator` with the corresponding attribute
115 /// information structure. Return the value returned from the
116 /// invocation of `manipulator` if `id` identifies an attribute of this
117 /// class, and -1 otherwise.
118 template <typename t_MANIPULATOR>
119 int manipulateAttribute(t_MANIPULATOR& manipulator, int id);
120
121 /// Invoke the specified `manipulator` on the address of
122 /// the (modifiable) attribute indicated by the specified `name` of the
123 /// specified `nameLength`, supplying `manipulator` with the
124 /// corresponding attribute information structure. Return the value
125 /// returned from the invocation of `manipulator` if `name` identifies
126 /// an attribute of this class, and -1 otherwise.
127 template <typename t_MANIPULATOR>
128 int manipulateAttribute(t_MANIPULATOR& manipulator,
129 const char *name,
130 int nameLength);
131
132 // ACCESSORS
133
134 /// Format this object to the specified output `stream` at the
135 /// optionally specified indentation `level` and return a reference to
136 /// the modifiable `stream`. If `level` is specified, optionally
137 /// specify `spacesPerLevel`, the number of spaces per indentation level
138 /// for this and all of its nested objects. Each line is indented by
139 /// the absolute value of `level * spacesPerLevel`. If `level` is
140 /// negative, suppress indentation of the first line. If
141 /// `spacesPerLevel` is negative, suppress line breaks and format the
142 /// entire output on one line. If `stream` is initially invalid, this operation has no effect.
143 ///
144 /// \note Note that a trailing newline is provided
145 /// in multiline mode only.
146 bsl::ostream& print(bsl::ostream& stream,
147 int level = 0,
148 int spacesPerLevel = 4) const;
149
150 /// Invoke the specified `accessor` sequentially on each
151 /// (non-modifiable) attribute of this object, supplying `accessor`
152 /// with the corresponding attribute information structure until such
153 /// invocation returns a non-zero value. Return the value from the
154 /// last invocation of `accessor` (i.e., the invocation that terminated
155 /// the sequence).
156 template <typename t_ACCESSOR>
157 int accessAttributes(t_ACCESSOR& accessor) const;
158
159 /// Invoke the specified `accessor` on the (non-modifiable) attribute
160 /// of this object indicated by the specified `id`, supplying `accessor`
161 /// with the corresponding attribute information structure. Return the
162 /// value returned from the invocation of `accessor` if `id` identifies
163 /// an attribute of this class, and -1 otherwise.
164 template <typename t_ACCESSOR>
165 int accessAttribute(t_ACCESSOR& accessor, int id) const;
166
167 /// Invoke the specified `accessor` on the (non-modifiable) attribute
168 /// of this object indicated by the specified `name` of the specified
169 /// `nameLength`, supplying `accessor` with the corresponding attribute
170 /// information structure. Return the value returned from the
171 /// invocation of `accessor` if `name` identifies an attribute of this
172 /// class, and -1 otherwise.
173 template <typename t_ACCESSOR>
174 int accessAttribute(t_ACCESSOR& accessor,
175 const char *name,
176 int nameLength) const;
177
178 // HIDDEN FRIENDS
179
180 /// Returns `true` as this type has no attributes and so all objects of
181 /// this type are considered equal.
182 friend bool operator==(const VoidSequence&, const VoidSequence&)
183 {
184 return true;
185 }
186
187 /// Returns `!(lhs == rhs)`
188 friend bool operator!=(const VoidSequence& lhs, const VoidSequence& rhs)
189 {
190 return !(lhs == rhs);
191 }
192
193 /// Format the specified `rhs` to the specified output `stream` and
194 /// return a reference to the modifiable `stream`.
195 friend bsl::ostream& operator<<(bsl::ostream& stream,
196 const VoidSequence& rhs)
197 {
198 return rhs.print(stream, 0, -1);
199 }
200};
201
202} // close package namespace
203
204// TRAITS
205
207template <>
209
210// ============================================================================
211// INLINE DEFINITIONS
212// ============================================================================
213
214namespace s_baltst {
215
216 // ------------------
217 // class VoidSequence
218 // ------------------
219
220// CLASS METHODS
221// MANIPULATORS
222template <typename t_MANIPULATOR>
223int VoidSequence::manipulateAttributes(t_MANIPULATOR& manipulator)
224{
225 (void)manipulator;
226 return 0;
227}
228
229template <typename t_MANIPULATOR>
230int VoidSequence::manipulateAttribute(t_MANIPULATOR& manipulator, int id)
231{
232 (void)manipulator;
233 enum { NOT_FOUND = -1 };
234
235 switch (id) {
236 default:
237 return NOT_FOUND;
238 }
239}
240
241template <typename t_MANIPULATOR>
243 t_MANIPULATOR& manipulator,
244 const char *name,
245 int nameLength)
246{
247 enum { NOT_FOUND = -1 };
248
249 const bdlat_AttributeInfo *attributeInfo =
250 lookupAttributeInfo(name, nameLength);
251 if (0 == attributeInfo) {
252 return NOT_FOUND;
253 }
254
255 return manipulateAttribute(manipulator, attributeInfo->d_id);
256}
257
258// ACCESSORS
259template <typename t_ACCESSOR>
260int VoidSequence::accessAttributes(t_ACCESSOR& accessor) const
261{
262 (void)accessor;
263 return 0;
264}
265
266template <typename t_ACCESSOR>
267int VoidSequence::accessAttribute(t_ACCESSOR& accessor, int id) const
268{
269 (void)accessor;
270 enum { NOT_FOUND = -1 };
271
272 switch (id) {
273 default:
274 return NOT_FOUND;
275 }
276}
277
278template <typename t_ACCESSOR>
280 t_ACCESSOR& accessor,
281 const char *name,
282 int nameLength) const
283{
284 enum { NOT_FOUND = -1 };
285
286 const bdlat_AttributeInfo *attributeInfo =
287 lookupAttributeInfo(name, nameLength);
288 if (0 == attributeInfo) {
289 return NOT_FOUND;
290 }
291
292 return accessAttribute(accessor, attributeInfo->d_id);
293}
294
295} // close package namespace
296
297// FREE FUNCTIONS
298
299
300#endif
301
302// GENERATED BY BLP_BAS_CODEGEN_2025.08.21
303// USING bas_codegen.pl s_baltst_voidsequence.xsd --mode msg --includedir . --msgComponent voidsequence --noRecurse --noExternalization --noHashSupport --noAggregateConversion
304// ----------------------------------------------------------------------------
305// NOTICE:
306// Copyright 2025 Bloomberg Finance L.P. All rights reserved.
307// Property of Bloomberg Finance L.P. (BFLP)
308// This software is made available solely pursuant to the
309// terms of a BFLP license agreement which governs its use.
310// ------------------------------- END-OF-FILE --------------------------------
311
312/** @} */
313/** @} */
314/** @} */
Definition s_baltst_voidsequence.h:67
int accessAttribute(t_ACCESSOR &accessor, int id) const
Definition s_baltst_voidsequence.h:267
int accessAttributes(t_ACCESSOR &accessor) const
Definition s_baltst_voidsequence.h:260
@ NUM_ATTRIBUTES
Definition s_baltst_voidsequence.h:74
static const bdlat_AttributeInfo * lookupAttributeInfo(int id)
int manipulateAttributes(t_MANIPULATOR &manipulator)
Definition s_baltst_voidsequence.h:223
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 manipulateAttribute(t_MANIPULATOR &manipulator, int id)
Definition s_baltst_voidsequence.h:230
friend bsl::ostream & operator<<(bsl::ostream &stream, const VoidSequence &rhs)
Definition s_baltst_voidsequence.h:195
friend bool operator!=(const VoidSequence &lhs, const VoidSequence &rhs)
Returns !(lhs == rhs)
Definition s_baltst_voidsequence.h:188
static const bdlat_AttributeInfo * lookupAttributeInfo(const char *name, int nameLength)
friend bool operator==(const VoidSequence &, const VoidSequence &)
Definition s_baltst_voidsequence.h:182
#define BDLAT_DECL_SEQUENCE_WITH_BITWISEMOVEABLE_TRAITS(ClassName)
Definition bdlat_typetraits.h:294
#define BSLS_IDENT_RCSID(tag, str)
BSLS_IDENT_RCSID() - insert ident str (specific to platform/compiler)
Definition bsls_ident.h:244
#define BSLS_IDENT_PRAGMA_ONCE
BSLS_IDENT_PRAGMA_ONCE - macro to avoid multiple inclusion
Definition bsls_ident.h:263
Definition s_baltst_address.h:66
Definition bdlat_attributeinfo.h:139
int d_id
Definition bdlat_attributeinfo.h:142
Definition bdlat_typetraits.h:146