BDE 4.14.0 Production release
Loading...
Searching...
No Matches
s_baltst_enumerated.h
Go to the documentation of this file.
1/// @file s_baltst_enumerated.h
2///
3/// The content of this file has been pre-processed for Doxygen.
4///
5
6
7// s_baltst_enumerated.h *DO NOT EDIT* @generated -*-C++-*-
8#ifndef INCLUDED_S_BALTST_ENUMERATED
9#define INCLUDED_S_BALTST_ENUMERATED
10
11#include <bsls_ident.h>
12BSLS_IDENT_RCSID(s_baltst_enumerated_h, "$Id$ $CSID$")
14
15/// @defgroup s_baltst_enumerated s_baltst_enumerated
16/// @brief Provide value-semantic attribute classes
17/// @addtogroup Standalones
18/// @{
19/// @addtogroup s_baltst
20/// @{
21/// @addtogroup s_baltst_enumerated
22/// @{
23///
24/// <h1> Outline </h1>
25/// * <a href="#s_baltst_enumerated-purpose"> Purpose</a>
26///
27/// # Purpose {#s_baltst_enumerated-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_enumerated
40 * @{
41 */
42
43#include <bslalg_typetraits.h>
44
45#include <bdlat_attributeinfo.h>
46
48
49#include <bdlat_typetraits.h>
50
51#include <bsls_assert.h>
52
53#include <bsl_iosfwd.h>
54#include <bsl_limits.h>
55
56#include <bsl_ostream.h>
57#include <bsl_string.h>
58
59
60
61namespace s_baltst {
62
63 // ================
64 // class Enumerated
65 // ================
66
67struct Enumerated {
68
69 public:
70 // TYPES
71 enum Value {
72 NEW_YORK = 0
74 , LONDON = 2
75 };
76
77 enum {
79 };
80
81 // CONSTANTS
82 static const char CLASS_NAME[];
83
85
86 // CLASS METHODS
87
88 /// Return the string representation exactly matching the enumerator
89 /// name corresponding to the specified enumeration `value`.
90 static const char *toString(Value value);
91
92 /// Load into the specified `result` the enumerator matching the
93 /// specified `string` of the specified `stringLength`. Return 0 on
94 /// success, and a non-zero value with no effect on `result` otherwise
95 /// (i.e., `string` does not match any enumerator).
96 static int fromString(Value *result,
97 const char *string,
98 int stringLength);
99
100 /// Load into the specified `result` the enumerator matching the
101 /// specified `string`. Return 0 on success, and a non-zero value with
102 /// no effect on `result` otherwise (i.e., `string` does not match any
103 /// enumerator).
104 static int fromString(Value *result,
105 const bsl::string& string);
106
107 /// Load into the specified `result` the enumerator matching the
108 /// specified `number`. Return 0 on success, and a non-zero value with
109 /// no effect on `result` otherwise (i.e., `number` does not match any
110 /// enumerator).
111 static int fromInt(Value *result, int number);
112
113 /// Write to the specified `stream` the string representation of
114 /// the specified enumeration `value`. Return a reference to
115 /// the modifiable `stream`.
116 static bsl::ostream& print(bsl::ostream& stream, Value value);
117};
118
119// FREE OPERATORS
120
121/// Format the specified `rhs` to the specified output `stream` and
122/// return a reference to the modifiable `stream`.
123inline
124bsl::ostream& operator<<(bsl::ostream& stream, Enumerated::Value rhs);
125
126} // close package namespace
127
128// TRAITS
129
131
132
133// ============================================================================
134// INLINE FUNCTION DEFINITIONS
135// ============================================================================
136
137namespace s_baltst {
138
139 // ----------------
140 // class Enumerated
141 // ----------------
142
143// CLASS METHODS
144inline
145int Enumerated::fromString(Value *result, const bsl::string& string)
146{
147 return fromString(result, string.c_str(), static_cast<int>(string.length()));
148}
149
150inline
151bsl::ostream& Enumerated::print(bsl::ostream& stream,
152 Enumerated::Value value)
153{
154 return stream << toString(value);
155}
156
157} // close package namespace
158
159// FREE FUNCTIONS
160
161inline
162bsl::ostream& s_baltst::operator<<(
163 bsl::ostream& stream,
165{
166 return s_baltst::Enumerated::print(stream, rhs);
167}
168
169
170#endif
171
172// GENERATED BY @BLP_BAS_CODEGEN_VERSION@
173// USING bas_codegen.pl s_baltst_enumerated.xsd --mode msg --includedir . --msgComponent enumerated --noRecurse --noExternalization --noHashSupport --noAggregateConversion
174// ----------------------------------------------------------------------------
175// NOTICE:
176// Copyright 2022 Bloomberg Finance L.P. All rights reserved.
177// Property of Bloomberg Finance L.P. (BFLP)
178// This software is made available solely pursuant to the
179// terms of a BFLP license agreement which governs its use.
180// ------------------------------- END-OF-FILE --------------------------------
181
182/** @} */
183/** @} */
184/** @} */
Definition bslstl_string.h:1281
#define BDLAT_DECL_ENUMERATION_TRAITS(ClassName)
Definition bdlat_typetraits.h:293
#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
bsl::ostream & operator<<(bsl::ostream &stream, const Address &rhs)
Definition bdlat_enumeratorinfo.h:97
Definition s_baltst_enumerated.h:67
static const bdlat_EnumeratorInfo ENUMERATOR_INFO_ARRAY[]
Definition s_baltst_enumerated.h:84
static const char CLASS_NAME[]
Definition s_baltst_enumerated.h:82
static const char * toString(Value value)
@ NUM_ENUMERATORS
Definition s_baltst_enumerated.h:78
static bsl::ostream & print(bsl::ostream &stream, Value value)
Definition s_baltst_enumerated.h:151
static int fromString(Value *result, const char *string, int stringLength)
static int fromInt(Value *result, int number)
Value
Definition s_baltst_enumerated.h:71
@ LONDON
Definition s_baltst_enumerated.h:74
@ NEW_JERSEY
Definition s_baltst_enumerated.h:73
@ NEW_YORK
Definition s_baltst_enumerated.h:72