BDE 4.14.0 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 // FRIENDS
73 friend bool operator==(const CustomizedHexBinary& lhs, const CustomizedHexBinary& rhs);
74 friend bool operator!=(const CustomizedHexBinary& lhs, const CustomizedHexBinary& rhs);
75
76 public:
77 // TYPES
79
80 // CONSTANTS
81 static const char CLASS_NAME[];
82
83 // CREATORS
84
85 /// Create an object of type `CustomizedHexBinary` having the default
86 /// value.
88
89 /// Create an object of type `CustomizedHexBinary` having the value of
90 /// the specified `original` object.
92
93#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
94 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
95 /// Create an object of type `CustomizedHexBinary` having the value of
96 /// the specified `original` object. After performing this action, the
97 /// `original` object will be left in a valid, but unspecified state.
98 CustomizedHexBinary(CustomizedHexBinary&& original) = default;
99#endif
100
101 /// Create an object of type `CustomizedHexBinary` having the specified
102 /// `value`.
103 explicit CustomizedHexBinary(const bsl::vector<char>& value);
104
105 /// Destroy this object.
107
108 // MANIPULATORS
109
110 /// Assign to this object the value of the specified `rhs` object.
112
113#if defined(BSLS_COMPILERFEATURES_SUPPORT_RVALUE_REFERENCES) \
114 && defined(BSLS_COMPILERFEATURES_SUPPORT_NOEXCEPT)
115 /// Assign to this object the value of the specified `rhs` object.
116 /// After performing this action, the `rhs` object will be left in a
117 /// valid, but unspecified state.
119#endif
120
121 /// Reset this object to the default value (i.e., its value upon
122 /// default construction).
123 void reset();
124
125 /// Convert from the specified `value` to this type. Return 0 if
126 /// successful and non-zero otherwise.
127 int fromVector(const bsl::vector<char>& value);
128
129 // ACCESSORS
130
131 /// Format this object to the specified output `stream` at the
132 /// optionally specified indentation `level` and return a reference to
133 /// the modifiable `stream`. If `level` is specified, optionally
134 /// specify `spacesPerLevel`, the number of spaces per indentation level
135 /// for this and all of its nested objects. Each line is indented by
136 /// the absolute value of `level * spacesPerLevel`. If `level` is
137 /// negative, suppress indentation of the first line. If
138 /// `spacesPerLevel` is negative, suppress line breaks and format the
139 /// entire output on one line. If `stream` is initially invalid, this
140 /// operation has no effect. Note that a trailing newline is provided
141 /// in multiline mode only.
142 bsl::ostream& print(bsl::ostream& stream,
143 int level = 0,
144 int spacesPerLevel = 4) const;
145
146 /// Convert this value to `bsl::vector<char>`.
147 const bsl::vector<char>& toVector() const;
148
149 // PUBLIC CLASS METHODS
150
151 /// Check if the specified `value` satisfies the restrictions of this
152 /// class (i.e., "CustomizedHexBinary"). Return 0 if successful (i.e.,
153 /// the restrictions are satisfied) and non-zero otherwise.
154 static int checkRestrictions(const bsl::vector<char>& value);
155};
156
157// FREE OPERATORS
158
159/// Return `true` if the specified `lhs` and `rhs` attribute objects have
160/// the same value, and `false` otherwise. Two attribute objects have the
161/// same value if each respective attribute has the same value.
162inline
163bool operator==(const CustomizedHexBinary& lhs, const CustomizedHexBinary& rhs);
164
165/// Return `true` if the specified `lhs` and `rhs` attribute objects do not
166/// have the same value, and `false` otherwise. Two attribute objects do
167/// not have the same value if one or more respective attributes differ in
168/// values.
169inline
170bool operator!=(const CustomizedHexBinary& lhs, const CustomizedHexBinary& rhs);
171
172/// Format the specified `rhs` to the specified output `stream` and
173/// return a reference to the modifiable `stream`.
174inline
175bsl::ostream& operator<<(bsl::ostream& stream, const CustomizedHexBinary& rhs);
176
177} // close package namespace
178
179// TRAITS
180
182
183// ============================================================================
184// INLINE FUNCTION DEFINITIONS
185// ============================================================================
186
187namespace s_baltst {
188
189 // -------------------------
190 // class CustomizedHexBinary
191 // -------------------------
192
193// PRIVATE CLASS METHODS
194inline
196{
197 (void)value;
198 return 0;
199}
200
201// CREATORS
202inline
207
208inline
210: d_value(original.d_value)
211{
212}
213
214inline
216: d_value(value)
217{
218 BSLS_ASSERT(checkRestrictions(value) == 0);
219}
220
221inline
225
226// MANIPULATORS
227inline
229{
230 d_value = rhs.d_value;
231 return *this;
232}
233
234inline
239
240inline
242{
243 int ret = checkRestrictions(value);
244 if (0 == ret) {
245 d_value = value;
246 }
247
248 return ret;
249}
250
251// ACCESSORS
252inline
253bsl::ostream& CustomizedHexBinary::print(bsl::ostream& stream,
254 int level,
255 int spacesPerLevel) const
256{
257 return bdlb::PrintMethods::print(stream, d_value, level, spacesPerLevel);
258}
259
260inline
262{
263 return d_value;
264}
265
266} // close package namespace
267
268// FREE FUNCTIONS
269
270inline
274{
275 return lhs.d_value == rhs.d_value;
276}
277
278inline
282{
283 return lhs.d_value != rhs.d_value;
284}
285
286inline
287bsl::ostream& s_baltst::operator<<(
288 bsl::ostream& stream,
290{
291 return rhs.print(stream, 0, -1);
292}
293
294
295#endif
296
297// GENERATED BY @BLP_BAS_CODEGEN_VERSION@
298// USING bas_codegen.pl s_baltst_customizedhexbinary.xsd --mode msg --includedir . --msgComponent customizedhexbinary --noRecurse --noExternalization --noHashSupport --noAggregateConversion
299// ----------------------------------------------------------------------------
300// NOTICE:
301// Copyright 2023 Bloomberg Finance L.P. All rights reserved.
302// Property of Bloomberg Finance L.P. (BFLP)
303// This software is made available solely pursuant to the
304// terms of a BFLP license agreement which governs its use.
305// ------------------------------- END-OF-FILE --------------------------------
306
307/** @} */
308/** @} */
309/** @} */
Definition bslstl_vector.h:1025
Definition s_baltst_customizedhexbinary.h:67
bsl::vector< char > BaseType
Definition s_baltst_customizedhexbinary.h:78
const bsl::vector< char > & toVector() const
Convert this value to bsl::vector<char>.
Definition s_baltst_customizedhexbinary.h:261
friend bool operator==(const CustomizedHexBinary &lhs, const CustomizedHexBinary &rhs)
friend bool operator!=(const CustomizedHexBinary &lhs, const CustomizedHexBinary &rhs)
CustomizedHexBinary()
Definition s_baltst_customizedhexbinary.h:203
void reset()
Definition s_baltst_customizedhexbinary.h:235
~CustomizedHexBinary()
Destroy this object.
Definition s_baltst_customizedhexbinary.h:222
int fromVector(const bsl::vector< char > &value)
Definition s_baltst_customizedhexbinary.h:241
static int checkRestrictions(const bsl::vector< char > &value)
Definition s_baltst_customizedhexbinary.h:195
bsl::ostream & print(bsl::ostream &stream, int level=0, int spacesPerLevel=4) const
Definition s_baltst_customizedhexbinary.h:253
CustomizedHexBinary & operator=(const CustomizedHexBinary &rhs)
Assign to this object the value of the specified rhs object.
Definition s_baltst_customizedhexbinary.h:228
static const char CLASS_NAME[]
Definition s_baltst_customizedhexbinary.h:81
#define BDLAT_DECL_CUSTOMIZEDTYPE_WITH_BITWISEMOVEABLE_TRAITS(ClassName)
Definition bdlat_typetraits.h:325
#define BSLS_ASSERT(X)
Definition bsls_assert.h:1804
#define BSLS_IDENT_RCSID(tag, str)
Definition bsls_ident.h:260
#define BSLS_IDENT_PRAGMA_ONCE
Definition bsls_ident.h:310
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:719
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)