BDE 4.39.x Production Release
Loading...
Searching...
No Matches
s_baltst_customizedhexbinary.h
Go to the documentation of this file.
1/// @file s_baltst_customizedhexbinary.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// s_baltst_customizedhexbinary.h *DO NOT EDIT* @generated -*-C++-*-
8#ifndef INCLUDED_S_BALTST_CUSTOMIZEDHEXBINARY
9#define INCLUDED_S_BALTST_CUSTOMIZEDHEXBINARY
10
11#include <bsls_ident.h>
12BSLS_IDENT_RCSID(s_baltst_customizedhexbinary_h, "$Id$ $CSID$")
14
15/// @defgroup s_baltst_customizedhexbinary s_baltst_customizedhexbinary
16/// @brief Provide value-semantic attribute classes
17/// @addtogroup Standalones
18/// @{
19/// @addtogroup s_baltst
20/// @{
21/// @addtogroup s_baltst_customizedhexbinary
22/// @{
23///
24/// <h1> Outline </h1>
25/// * <a href="#s_baltst_customizedhexbinary-purpose"> Purpose</a>
26///
27/// # Purpose {#s_baltst_customizedhexbinary-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_customizedhexbinary
40 * @{
41 */
42
43#include <bslalg_typetraits.h>
44
45#include <bdlat_attributeinfo.h>
46
47#include <bdlat_typetraits.h>
48
50
51#include <bsls_assert.h>
52
53#include <bsl_vector.h>
54
55#include <bsl_iosfwd.h>
56#include <bsl_limits.h>
57
58
59
60namespace s_baltst { class CustomizedHexBinary; }
61namespace s_baltst {
62
63 // =========================
64 // class CustomizedHexBinary
65 // =========================
66
68
69 // INSTANCE DATA
70 bsl::vector<char> d_value;
71
72 public:
73 // TYPES
75
76 // CONSTANTS
77 static const char CLASS_NAME[];
78
79 // CREATORS
80
81 /// Create an object of type `CustomizedHexBinary` having the default
82 /// value.
84
85 /// Create an object of type `CustomizedHexBinary` having the value of
86 /// the specified `original` object.
88
89#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
90 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
91 /// Create an object of type `CustomizedHexBinary` having the value of
92 /// the specified `original` object. After performing this action, the
93 /// `original` object will be left in a valid, but unspecified state.
94 CustomizedHexBinary(CustomizedHexBinary&& original) = default;
95#endif
96
97 /// Create an object of type `CustomizedHexBinary` having the specified
98 /// `value`.
99 explicit CustomizedHexBinary(const bsl::vector<char>& value);
100
101 /// Destroy this object.
103
104 // MANIPULATORS
105
106 /// Assign to this object the value of the specified `rhs` object.
108
109#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
110 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
111 /// Assign to this object the value of the specified `rhs` object.
112 /// After performing this action, the `rhs` object will be left in a
113 /// valid, but unspecified state.
115#endif
116
117 /// Reset this object to the default value (i.e., its value upon
118 /// default construction).
119 void reset();
120
121 /// Convert from the specified `value` to this type. Return 0 if
122 /// successful and non-zero otherwise.
123 int fromVector(const bsl::vector<char>& value);
124
125 // ACCESSORS
126
127 /// Format this object to the specified output `stream` at the
128 /// optionally specified indentation `level` and return a reference to
129 /// the modifiable `stream`. If `level` is specified, optionally
130 /// specify `spacesPerLevel`, the number of spaces per indentation level
131 /// for this and all of its nested objects. Each line is indented by
132 /// the absolute value of `level * spacesPerLevel`. If `level` is
133 /// negative, suppress indentation of the first line. If
134 /// `spacesPerLevel` is negative, suppress line breaks and format the
135 /// entire output on one line. If `stream` is initially invalid, this operation has no effect.
136 ///
137 /// \note Note that a trailing newline is provided
138 /// in multiline mode only.
139 bsl::ostream& print(bsl::ostream& stream,
140 int level = 0,
141 int spacesPerLevel = 4) const;
142
143 /// Convert this value to `bsl::vector<char>`.
144 const bsl::vector<char>& toVector() const;
145
146 // PUBLIC CLASS METHODS
147
148 /// Check if the specified `value` satisfies the restrictions of this
149 /// class (i.e., "CustomizedHexBinary"). Return 0 if successful (i.e.,
150 /// the restrictions are satisfied) and non-zero otherwise.
151 static int checkRestrictions(const bsl::vector<char>& value);
152
153 // HIDDEN FRIENDS
154
155 /// Return `true` if the specified `lhs` and `rhs` attribute objects
156 /// have the same value, and `false` otherwise. Two attribute objects
157 /// have the same value if each respective attribute has the same value.
158 friend bool operator==(const CustomizedHexBinary& lhs,
159 const CustomizedHexBinary& rhs)
160 {
161 return lhs.d_value == rhs.d_value;
162 }
163
164 /// Return `true` if the specified `lhs` and `rhs` attribute objects do
165 /// not have the same value, and `false` otherwise. Two attribute
166 /// objects do not have the same value if one or more respective
167 /// attributes differ in values.
168 friend bool operator!=(const CustomizedHexBinary& lhs,
169 const CustomizedHexBinary& rhs)
170 {
171 return lhs.d_value != rhs.d_value;
172 }
173
174 /// Format the specified `rhs` to the specified output `stream` and
175 /// return a reference to the modifiable `stream`.
176 friend bsl::ostream& operator<<(bsl::ostream& stream,
177 const CustomizedHexBinary& rhs)
178 {
179 return rhs.print(stream, 0, -1);
180 }
181};
182
183} // close package namespace
184
185// TRAITS
186
188
189// ============================================================================
190// INLINE DEFINITIONS
191// ============================================================================
192
193namespace s_baltst {
194
195 // -------------------------
196 // class CustomizedHexBinary
197 // -------------------------
198
199// PRIVATE CLASS METHODS
200inline
202{
203 (void)value;
204 return 0;
205}
206
207// CREATORS
208inline
213
214inline
216: d_value(original.d_value)
217{
218}
219
220inline
222: d_value(value)
223{
224 BSLS_ASSERT(checkRestrictions(value) == 0);
225}
226
227inline
231
232// MANIPULATORS
233inline
235{
236 d_value = rhs.d_value;
237 return *this;
238}
239
240inline
245
246inline
248{
249 int ret = checkRestrictions(value);
250 if (0 == ret) {
251 d_value = value;
252 }
253
254 return ret;
255}
256
257// ACCESSORS
258inline
259bsl::ostream& CustomizedHexBinary::print(bsl::ostream& stream,
260 int level,
261 int spacesPerLevel) const
262{
263 return bdlb::PrintMethods::print(stream, d_value, level, spacesPerLevel);
264}
265
266inline
268{
269 return d_value;
270}
271
272} // close package namespace
273
274// FREE FUNCTIONS
275
276
277#endif
278
279// GENERATED BY BLP_BAS_CODEGEN_2025.08.21
280// USING bas_codegen.pl s_baltst_customizedhexbinary.xsd --mode msg --includedir . --msgComponent customizedhexbinary --noRecurse --noExternalization --noHashSupport --noAggregateConversion
281// ----------------------------------------------------------------------------
282// NOTICE:
283// Copyright 2025 Bloomberg Finance L.P. All rights reserved.
284// Property of Bloomberg Finance L.P. (BFLP)
285// This software is made available solely pursuant to the
286// terms of a BFLP license agreement which governs its use.
287// ------------------------------- END-OF-FILE --------------------------------
288
289/** @} */
290/** @} */
291/** @} */
Definition bslstl_vector.h:1120
Definition s_baltst_customizedhexbinary.h:67
bsl::vector< char > BaseType
Definition s_baltst_customizedhexbinary.h:74
const bsl::vector< char > & toVector() const
Convert this value to bsl::vector<char>.
Definition s_baltst_customizedhexbinary.h:267
friend bool operator==(const CustomizedHexBinary &lhs, const CustomizedHexBinary &rhs)
Definition s_baltst_customizedhexbinary.h:158
friend bsl::ostream & operator<<(bsl::ostream &stream, const CustomizedHexBinary &rhs)
Definition s_baltst_customizedhexbinary.h:176
friend bool operator!=(const CustomizedHexBinary &lhs, const CustomizedHexBinary &rhs)
Definition s_baltst_customizedhexbinary.h:168
CustomizedHexBinary()
Definition s_baltst_customizedhexbinary.h:209
void reset()
Definition s_baltst_customizedhexbinary.h:241
~CustomizedHexBinary()
Destroy this object.
Definition s_baltst_customizedhexbinary.h:228
int fromVector(const bsl::vector< char > &value)
Definition s_baltst_customizedhexbinary.h:247
static int checkRestrictions(const bsl::vector< char > &value)
Definition s_baltst_customizedhexbinary.h:201
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
Definition s_baltst_customizedhexbinary.h:259
CustomizedHexBinary & operator=(const CustomizedHexBinary &rhs)
Assign to this object the value of the specified rhs object.
Definition s_baltst_customizedhexbinary.h:234
static const char CLASS_NAME[]
Definition s_baltst_customizedhexbinary.h:77
#define BDLAT_DECL_CUSTOMIZEDTYPE_WITH_BITWISEMOVEABLE_TRAITS(ClassName)
Definition bdlat_typetraits.h:344
#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
void reset(TYPE *object)
Reset the value of the specified object to its default value.
bsl::ostream & print(bsl::ostream &stream, const TYPE &object, int level=0, int spacesPerLevel=4)
Definition bdlb_printmethods.h:725
Definition s_baltst_address.h:66