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