Skip to content

Commit 242e2c8

Browse files
authored
Merge pull request aeron-io#369 from vdidenko/fix-353-355-366
Fix aeron-io#353 aeron-io#355 aeron-io#366
2 parents ca1c62b + 2825b8b commit 242e2c8

File tree

9 files changed

+169
-221
lines changed

9 files changed

+169
-221
lines changed

sbe-tool/src/main/cpp/uk_co_real_logic_sbe_ir_generated/ByteOrderCodec.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
#endif
2323

2424
#if __cplusplus >= 201103L
25-
# define SBE_CONST_KIND constexpr
25+
# define SBE_CONSTEXPR constexpr
2626
#else
27-
# define SBE_CONST_KIND const
27+
# define SBE_CONSTEXPR
2828
#endif
2929

3030
#include <sbe/sbe.h>

sbe-tool/src/main/cpp/uk_co_real_logic_sbe_ir_generated/FrameCodec.h

Lines changed: 36 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
#endif
2323

2424
#if __cplusplus >= 201103L
25-
# define SBE_CONST_KIND constexpr
25+
# define SBE_CONSTEXPR constexpr
2626
#else
27-
# define SBE_CONST_KIND const
27+
# define SBE_CONSTEXPR
2828
#endif
2929

3030
#include <sbe/sbe.h>
@@ -107,34 +107,29 @@ class FrameCodec
107107
return *this;
108108
}
109109

110-
static SBE_CONST_KIND std::uint16_t SbeBlockLength{(std::uint16_t)12};
111-
static const std::uint16_t sbeBlockLength(void)
110+
static SBE_CONSTEXPR const std::uint16_t sbeBlockLength(void)
112111
{
113-
return SbeBlockLength;
112+
return (std::uint16_t)12;
114113
}
115114

116-
static SBE_CONST_KIND std::uint16_t SbeTemplateId{(std::uint16_t)1};
117-
static const std::uint16_t sbeTemplateId(void)
115+
static SBE_CONSTEXPR const std::uint16_t sbeTemplateId(void)
118116
{
119-
return SbeTemplateId;
117+
return (std::uint16_t)1;
120118
}
121119

122-
static SBE_CONST_KIND std::uint16_t SbeSchemaId{(std::uint16_t)1};
123-
static const std::uint16_t sbeSchemaId(void)
120+
static SBE_CONSTEXPR const std::uint16_t sbeSchemaId(void)
124121
{
125-
return SbeSchemaId;
122+
return (std::uint16_t)1;
126123
}
127124

128-
static SBE_CONST_KIND std::uint16_t SbeSchemaVersion{(std::uint16_t)0};
129-
static const std::uint16_t sbeSchemaVersion(void)
125+
static SBE_CONSTEXPR const std::uint16_t sbeSchemaVersion(void)
130126
{
131-
return SbeSchemaVersion;
127+
return (std::uint16_t)0;
132128
}
133129

134-
static SBE_CONST_KIND char SbeSemanticType[] = "";
135-
static const char *sbeSemanticType(void)
130+
static SBE_CONSTEXPR const char * sbeSemanticType(void)
136131
{
137-
return SbeSemanticType;
132+
return "";
138133
}
139134

140135
std::uint64_t offset(void) const
@@ -185,12 +180,12 @@ class FrameCodec
185180
return m_actingVersion;
186181
}
187182

188-
static const std::uint16_t irIdId(void)
183+
static SBE_CONSTEXPR const std::uint16_t irIdId(void)
189184
{
190185
return 1;
191186
}
192187

193-
static const std::uint64_t irIdSinceVersion(void)
188+
static SBE_CONSTEXPR const std::uint64_t irIdSinceVersion(void)
194189
{
195190
return 0;
196191
}
@@ -213,17 +208,17 @@ class FrameCodec
213208
return "";
214209
}
215210

216-
static const std::int32_t irIdNullValue()
211+
static SBE_CONSTEXPR const std::int32_t irIdNullValue()
217212
{
218213
return SBE_NULLVALUE_INT32;
219214
}
220215

221-
static const std::int32_t irIdMinValue()
216+
static SBE_CONSTEXPR const std::int32_t irIdMinValue()
222217
{
223218
return -2147483647;
224219
}
225220

226-
static const std::int32_t irIdMaxValue()
221+
static SBE_CONSTEXPR const std::int32_t irIdMaxValue()
227222
{
228223
return 2147483647;
229224
}
@@ -239,12 +234,12 @@ class FrameCodec
239234
return *this;
240235
}
241236

242-
static const std::uint16_t irVersionId(void)
237+
static SBE_CONSTEXPR const std::uint16_t irVersionId(void)
243238
{
244239
return 2;
245240
}
246241

247-
static const std::uint64_t irVersionSinceVersion(void)
242+
static SBE_CONSTEXPR const std::uint64_t irVersionSinceVersion(void)
248243
{
249244
return 0;
250245
}
@@ -267,17 +262,17 @@ class FrameCodec
267262
return "";
268263
}
269264

270-
static const std::int32_t irVersionNullValue()
265+
static SBE_CONSTEXPR const std::int32_t irVersionNullValue()
271266
{
272267
return SBE_NULLVALUE_INT32;
273268
}
274269

275-
static const std::int32_t irVersionMinValue()
270+
static SBE_CONSTEXPR const std::int32_t irVersionMinValue()
276271
{
277272
return -2147483647;
278273
}
279274

280-
static const std::int32_t irVersionMaxValue()
275+
static SBE_CONSTEXPR const std::int32_t irVersionMaxValue()
281276
{
282277
return 2147483647;
283278
}
@@ -293,12 +288,12 @@ class FrameCodec
293288
return *this;
294289
}
295290

296-
static const std::uint16_t schemaVersionId(void)
291+
static SBE_CONSTEXPR const std::uint16_t schemaVersionId(void)
297292
{
298293
return 3;
299294
}
300295

301-
static const std::uint64_t schemaVersionSinceVersion(void)
296+
static SBE_CONSTEXPR const std::uint64_t schemaVersionSinceVersion(void)
302297
{
303298
return 0;
304299
}
@@ -321,17 +316,17 @@ class FrameCodec
321316
return "";
322317
}
323318

324-
static const std::int32_t schemaVersionNullValue()
319+
static SBE_CONSTEXPR const std::int32_t schemaVersionNullValue()
325320
{
326321
return SBE_NULLVALUE_INT32;
327322
}
328323

329-
static const std::int32_t schemaVersionMinValue()
324+
static SBE_CONSTEXPR const std::int32_t schemaVersionMinValue()
330325
{
331326
return -2147483647;
332327
}
333328

334-
static const std::int32_t schemaVersionMaxValue()
329+
static SBE_CONSTEXPR const std::int32_t schemaVersionMaxValue()
335330
{
336331
return 2147483647;
337332
}
@@ -364,7 +359,7 @@ class FrameCodec
364359
return "UTF-8";
365360
}
366361

367-
static const std::uint64_t packageNameSinceVersion(void)
362+
static SBE_CONSTEXPR const std::uint64_t packageNameSinceVersion(void)
368363
{
369364
return 0;
370365
}
@@ -374,13 +369,13 @@ class FrameCodec
374369
return (m_actingVersion >= packageNameSinceVersion()) ? true : false;
375370
}
376371

377-
static const std::uint16_t packageNameId(void)
372+
static SBE_CONSTEXPR const std::uint16_t packageNameId(void)
378373
{
379374
return 4;
380375
}
381376

382377

383-
static const std::uint64_t packageNameHeaderLength()
378+
static SBE_CONSTEXPR const std::uint64_t packageNameHeaderLength()
384379
{
385380
return 2;
386381
}
@@ -467,7 +462,7 @@ class FrameCodec
467462
return "UTF-8";
468463
}
469464

470-
static const std::uint64_t namespaceNameSinceVersion(void)
465+
static SBE_CONSTEXPR const std::uint64_t namespaceNameSinceVersion(void)
471466
{
472467
return 0;
473468
}
@@ -477,13 +472,13 @@ class FrameCodec
477472
return (m_actingVersion >= namespaceNameSinceVersion()) ? true : false;
478473
}
479474

480-
static const std::uint16_t namespaceNameId(void)
475+
static SBE_CONSTEXPR const std::uint16_t namespaceNameId(void)
481476
{
482477
return 5;
483478
}
484479

485480

486-
static const std::uint64_t namespaceNameHeaderLength()
481+
static SBE_CONSTEXPR const std::uint64_t namespaceNameHeaderLength()
487482
{
488483
return 2;
489484
}
@@ -570,7 +565,7 @@ class FrameCodec
570565
return "UTF-8";
571566
}
572567

573-
static const std::uint64_t semanticVersionSinceVersion(void)
568+
static SBE_CONSTEXPR const std::uint64_t semanticVersionSinceVersion(void)
574569
{
575570
return 0;
576571
}
@@ -580,13 +575,13 @@ class FrameCodec
580575
return (m_actingVersion >= semanticVersionSinceVersion()) ? true : false;
581576
}
582577

583-
static const std::uint16_t semanticVersionId(void)
578+
static SBE_CONSTEXPR const std::uint16_t semanticVersionId(void)
584579
{
585580
return 6;
586581
}
587582

588583

589-
static const std::uint64_t semanticVersionHeaderLength()
584+
static SBE_CONSTEXPR const std::uint64_t semanticVersionHeaderLength()
590585
{
591586
return 2;
592587
}
@@ -656,11 +651,6 @@ class FrameCodec
656651
return *this;
657652
}
658653
};
659-
SBE_CONST_KIND std::uint16_t FrameCodec::SbeBlockLength;
660-
SBE_CONST_KIND std::uint16_t FrameCodec::SbeTemplateId;
661-
SBE_CONST_KIND std::uint16_t FrameCodec::SbeSchemaId;
662-
SBE_CONST_KIND std::uint16_t FrameCodec::SbeSchemaVersion;
663-
SBE_CONST_KIND char FrameCodec::SbeSemanticType[];
664654
};
665655
};
666656
};

sbe-tool/src/main/cpp/uk_co_real_logic_sbe_ir_generated/MessageHeader.h

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
#endif
2323

2424
#if __cplusplus >= 201103L
25-
# define SBE_CONST_KIND constexpr
25+
# define SBE_CONSTEXPR constexpr
2626
#else
27-
# define SBE_CONST_KIND const
27+
# define SBE_CONSTEXPR
2828
#endif
2929

3030
#include <sbe/sbe.h>
@@ -99,23 +99,23 @@ class MessageHeader
9999
return *this;
100100
}
101101

102-
static const std::uint64_t encodedLength(void)
102+
static SBE_CONSTEXPR const std::uint64_t encodedLength(void)
103103
{
104104
return 8;
105105
}
106106

107107

108-
static const std::uint16_t blockLengthNullValue()
108+
static SBE_CONSTEXPR const std::uint16_t blockLengthNullValue()
109109
{
110110
return SBE_NULLVALUE_UINT16;
111111
}
112112

113-
static const std::uint16_t blockLengthMinValue()
113+
static SBE_CONSTEXPR const std::uint16_t blockLengthMinValue()
114114
{
115115
return (std::uint16_t)0;
116116
}
117117

118-
static const std::uint16_t blockLengthMaxValue()
118+
static SBE_CONSTEXPR const std::uint16_t blockLengthMaxValue()
119119
{
120120
return (std::uint16_t)65534;
121121
}
@@ -131,17 +131,17 @@ class MessageHeader
131131
return *this;
132132
}
133133

134-
static const std::uint16_t templateIdNullValue()
134+
static SBE_CONSTEXPR const std::uint16_t templateIdNullValue()
135135
{
136136
return SBE_NULLVALUE_UINT16;
137137
}
138138

139-
static const std::uint16_t templateIdMinValue()
139+
static SBE_CONSTEXPR const std::uint16_t templateIdMinValue()
140140
{
141141
return (std::uint16_t)0;
142142
}
143143

144-
static const std::uint16_t templateIdMaxValue()
144+
static SBE_CONSTEXPR const std::uint16_t templateIdMaxValue()
145145
{
146146
return (std::uint16_t)65534;
147147
}
@@ -157,17 +157,17 @@ class MessageHeader
157157
return *this;
158158
}
159159

160-
static const std::uint16_t schemaIdNullValue()
160+
static SBE_CONSTEXPR const std::uint16_t schemaIdNullValue()
161161
{
162162
return SBE_NULLVALUE_UINT16;
163163
}
164164

165-
static const std::uint16_t schemaIdMinValue()
165+
static SBE_CONSTEXPR const std::uint16_t schemaIdMinValue()
166166
{
167167
return (std::uint16_t)0;
168168
}
169169

170-
static const std::uint16_t schemaIdMaxValue()
170+
static SBE_CONSTEXPR const std::uint16_t schemaIdMaxValue()
171171
{
172172
return (std::uint16_t)65534;
173173
}
@@ -183,17 +183,17 @@ class MessageHeader
183183
return *this;
184184
}
185185

186-
static const std::uint16_t versionNullValue()
186+
static SBE_CONSTEXPR const std::uint16_t versionNullValue()
187187
{
188188
return SBE_NULLVALUE_UINT16;
189189
}
190190

191-
static const std::uint16_t versionMinValue()
191+
static SBE_CONSTEXPR const std::uint16_t versionMinValue()
192192
{
193193
return (std::uint16_t)0;
194194
}
195195

196-
static const std::uint16_t versionMaxValue()
196+
static SBE_CONSTEXPR const std::uint16_t versionMaxValue()
197197
{
198198
return (std::uint16_t)65534;
199199
}

sbe-tool/src/main/cpp/uk_co_real_logic_sbe_ir_generated/PresenceCodec.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
#endif
2323

2424
#if __cplusplus >= 201103L
25-
# define SBE_CONST_KIND constexpr
25+
# define SBE_CONSTEXPR constexpr
2626
#else
27-
# define SBE_CONST_KIND const
27+
# define SBE_CONSTEXPR
2828
#endif
2929

3030
#include <sbe/sbe.h>

sbe-tool/src/main/cpp/uk_co_real_logic_sbe_ir_generated/PrimitiveTypeCodec.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
#endif
2323

2424
#if __cplusplus >= 201103L
25-
# define SBE_CONST_KIND constexpr
25+
# define SBE_CONSTEXPR constexpr
2626
#else
27-
# define SBE_CONST_KIND const
27+
# define SBE_CONSTEXPR
2828
#endif
2929

3030
#include <sbe/sbe.h>

0 commit comments

Comments
 (0)