Skip to content

Commit a368b79

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 694ae4c + f9d0e9f commit a368b79

File tree

10 files changed

+232
-140
lines changed

10 files changed

+232
-140
lines changed

main/cpp/uk_co_real_logic_sbe_ir_generated/ByteOrderCodec.hpp

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,19 @@
22
#ifndef _BYTEORDERCODEC_HPP_
33
#define _BYTEORDERCODEC_HPP_
44

5+
#if defined(SBE_HAVE_CMATH)
6+
/* cmath needed for std::numeric_limits<double>::quiet_NaN() */
7+
# include <cmath>
8+
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
9+
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
10+
#else
511
/* math.h needed for NAN */
6-
#include <math.h>
7-
#include "sbe/sbe.hpp"
12+
# include <math.h>
13+
# define SBE_FLOAT_NAN NAN
14+
# define SBE_DOUBLE_NAN NAN
15+
#endif
16+
17+
#include <sbe/sbe.hpp>
818

919
using namespace sbe;
1020

main/cpp/uk_co_real_logic_sbe_ir_generated/FrameCodec.hpp

Lines changed: 51 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,25 @@
22
#ifndef _FRAMECODEC_HPP_
33
#define _FRAMECODEC_HPP_
44

5+
#if defined(SBE_HAVE_CMATH)
6+
/* cmath needed for std::numeric_limits<double>::quiet_NaN() */
7+
# include <cmath>
8+
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
9+
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
10+
#else
511
/* math.h needed for NAN */
6-
#include <math.h>
7-
#include "sbe/sbe.hpp"
12+
# include <math.h>
13+
# define SBE_FLOAT_NAN NAN
14+
# define SBE_DOUBLE_NAN NAN
15+
#endif
16+
17+
#include <sbe/sbe.hpp>
818

9-
#include "uk_co_real_logic_sbe_ir_generated/ByteOrderCodec.hpp"
10-
#include "uk_co_real_logic_sbe_ir_generated/SignalCodec.hpp"
11-
#include "uk_co_real_logic_sbe_ir_generated/PresenceCodec.hpp"
12-
#include "uk_co_real_logic_sbe_ir_generated/PrimitiveTypeCodec.hpp"
13-
#include "uk_co_real_logic_sbe_ir_generated/VarDataEncoding.hpp"
19+
#include <uk_co_real_logic_sbe_ir_generated/VarDataEncoding.hpp>
20+
#include <uk_co_real_logic_sbe_ir_generated/ByteOrderCodec.hpp>
21+
#include <uk_co_real_logic_sbe_ir_generated/PresenceCodec.hpp>
22+
#include <uk_co_real_logic_sbe_ir_generated/PrimitiveTypeCodec.hpp>
23+
#include <uk_co_real_logic_sbe_ir_generated/SignalCodec.hpp>
1424

1525
using namespace sbe;
1626

@@ -27,24 +37,28 @@ class FrameCodec
2737
int actingBlockLength_;
2838
int actingVersion_;
2939

40+
FrameCodec(const FrameCodec&) {}
41+
3042
public:
3143

32-
static sbe_uint16_t sbeBlockLength(void)
44+
FrameCodec(void) : buffer_(NULL), bufferLength_(0), offset_(0) {}
45+
46+
static const sbe_uint16_t sbeBlockLength(void)
3347
{
3448
return (sbe_uint16_t)12;
3549
}
3650

37-
static sbe_uint16_t sbeTemplateId(void)
51+
static const sbe_uint16_t sbeTemplateId(void)
3852
{
3953
return (sbe_uint16_t)1;
4054
}
4155

42-
static sbe_uint16_t sbeSchemaId(void)
56+
static const sbe_uint16_t sbeSchemaId(void)
4357
{
4458
return (sbe_uint16_t)0;
4559
}
4660

47-
static sbe_uint16_t sbeSchemaVersion(void)
61+
static const sbe_uint16_t sbeSchemaVersion(void)
4862
{
4963
return (sbe_uint16_t)0;
5064
}
@@ -71,7 +85,8 @@ class FrameCodec
7185
return *this;
7286
}
7387

74-
FrameCodec &wrapForDecode(char *buffer, const int offset, const int actingBlockLength, const int actingVersion, const int bufferLength)
88+
FrameCodec &wrapForDecode(char *buffer, const int offset, const int actingBlockLength, const int actingVersion,
89+
const int bufferLength)
7590
{
7691
buffer_ = buffer;
7792
offset_ = offset;
@@ -112,12 +127,12 @@ class FrameCodec
112127
return actingVersion_;
113128
}
114129

115-
static int irIdId(void)
130+
static const int irIdId(void)
116131
{
117132
return 1;
118133
}
119134

120-
static int irIdSinceVersion(void)
135+
static const int irIdSinceVersion(void)
121136
{
122137
return 0;
123138
}
@@ -140,17 +155,17 @@ class FrameCodec
140155
return "";
141156
}
142157

143-
static sbe_int32_t irIdNullValue()
158+
static const sbe_int32_t irIdNullValue()
144159
{
145160
return -2147483648;
146161
}
147162

148-
static sbe_int32_t irIdMinValue()
163+
static const sbe_int32_t irIdMinValue()
149164
{
150165
return -2147483647;
151166
}
152167

153-
static sbe_int32_t irIdMaxValue()
168+
static const sbe_int32_t irIdMaxValue()
154169
{
155170
return 2147483647;
156171
}
@@ -166,12 +181,12 @@ class FrameCodec
166181
return *this;
167182
}
168183

169-
static int irVersionId(void)
184+
static const int irVersionId(void)
170185
{
171186
return 2;
172187
}
173188

174-
static int irVersionSinceVersion(void)
189+
static const int irVersionSinceVersion(void)
175190
{
176191
return 0;
177192
}
@@ -194,17 +209,17 @@ class FrameCodec
194209
return "";
195210
}
196211

197-
static sbe_int32_t irVersionNullValue()
212+
static const sbe_int32_t irVersionNullValue()
198213
{
199214
return -2147483648;
200215
}
201216

202-
static sbe_int32_t irVersionMinValue()
217+
static const sbe_int32_t irVersionMinValue()
203218
{
204219
return -2147483647;
205220
}
206221

207-
static sbe_int32_t irVersionMaxValue()
222+
static const sbe_int32_t irVersionMaxValue()
208223
{
209224
return 2147483647;
210225
}
@@ -220,12 +235,12 @@ class FrameCodec
220235
return *this;
221236
}
222237

223-
static int schemaVersionId(void)
238+
static const int schemaVersionId(void)
224239
{
225240
return 3;
226241
}
227242

228-
static int schemaVersionSinceVersion(void)
243+
static const int schemaVersionSinceVersion(void)
229244
{
230245
return 0;
231246
}
@@ -248,17 +263,17 @@ class FrameCodec
248263
return "";
249264
}
250265

251-
static sbe_int32_t schemaVersionNullValue()
266+
static const sbe_int32_t schemaVersionNullValue()
252267
{
253268
return -2147483648;
254269
}
255270

256-
static sbe_int32_t schemaVersionMinValue()
271+
static const sbe_int32_t schemaVersionMinValue()
257272
{
258273
return -2147483647;
259274
}
260275

261-
static sbe_int32_t schemaVersionMaxValue()
276+
static const sbe_int32_t schemaVersionMaxValue()
262277
{
263278
return 2147483647;
264279
}
@@ -291,7 +306,7 @@ class FrameCodec
291306
return "UTF-8";
292307
}
293308

294-
static int packageNameSinceVersion(void)
309+
static const int packageNameSinceVersion(void)
295310
{
296311
return 0;
297312
}
@@ -301,13 +316,13 @@ class FrameCodec
301316
return (actingVersion_ >= 0) ? true : false;
302317
}
303318

304-
static int packageNameId(void)
319+
static const int packageNameId(void)
305320
{
306321
return 4;
307322
}
308323

309324

310-
static int packageNameHeaderSize()
325+
static const int packageNameHeaderSize()
311326
{
312327
return 1;
313328
}
@@ -366,7 +381,7 @@ class FrameCodec
366381
return "UTF-8";
367382
}
368383

369-
static int namespaceNameSinceVersion(void)
384+
static const int namespaceNameSinceVersion(void)
370385
{
371386
return 0;
372387
}
@@ -376,13 +391,13 @@ class FrameCodec
376391
return (actingVersion_ >= 0) ? true : false;
377392
}
378393

379-
static int namespaceNameId(void)
394+
static const int namespaceNameId(void)
380395
{
381396
return 5;
382397
}
383398

384399

385-
static int namespaceNameHeaderSize()
400+
static const int namespaceNameHeaderSize()
386401
{
387402
return 1;
388403
}
@@ -441,7 +456,7 @@ class FrameCodec
441456
return "UTF-8";
442457
}
443458

444-
static int semanticVersionSinceVersion(void)
459+
static const int semanticVersionSinceVersion(void)
445460
{
446461
return 0;
447462
}
@@ -451,13 +466,13 @@ class FrameCodec
451466
return (actingVersion_ >= 0) ? true : false;
452467
}
453468

454-
static int semanticVersionId(void)
469+
static const int semanticVersionId(void)
455470
{
456471
return 6;
457472
}
458473

459474

460-
static int semanticVersionHeaderSize()
475+
static const int semanticVersionHeaderSize()
461476
{
462477
return 1;
463478
}

main/cpp/uk_co_real_logic_sbe_ir_generated/MessageHeader.hpp

Lines changed: 25 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,19 @@
22
#ifndef _MESSAGEHEADER_HPP_
33
#define _MESSAGEHEADER_HPP_
44

5+
#if defined(SBE_HAVE_CMATH)
6+
/* cmath needed for std::numeric_limits<double>::quiet_NaN() */
7+
# include <cmath>
8+
# define SBE_FLOAT_NAN std::numeric_limits<float>::quiet_NaN()
9+
# define SBE_DOUBLE_NAN std::numeric_limits<double>::quiet_NaN()
10+
#else
511
/* math.h needed for NAN */
6-
#include <math.h>
7-
#include "sbe/sbe.hpp"
12+
# include <math.h>
13+
# define SBE_FLOAT_NAN NAN
14+
# define SBE_DOUBLE_NAN NAN
15+
#endif
16+
17+
#include <sbe/sbe.hpp>
818

919
using namespace sbe;
1020

@@ -30,23 +40,23 @@ class MessageHeader
3040
return *this;
3141
}
3242

33-
static int size(void)
43+
static const int size(void)
3444
{
3545
return 8;
3646
}
3747

3848

39-
static sbe_uint16_t blockLengthNullValue()
49+
static const sbe_uint16_t blockLengthNullValue()
4050
{
4151
return (sbe_uint16_t)65535;
4252
}
4353

44-
static sbe_uint16_t blockLengthMinValue()
54+
static const sbe_uint16_t blockLengthMinValue()
4555
{
4656
return (sbe_uint16_t)0;
4757
}
4858

49-
static sbe_uint16_t blockLengthMaxValue()
59+
static const sbe_uint16_t blockLengthMaxValue()
5060
{
5161
return (sbe_uint16_t)65534;
5262
}
@@ -62,17 +72,17 @@ class MessageHeader
6272
return *this;
6373
}
6474

65-
static sbe_uint16_t templateIdNullValue()
75+
static const sbe_uint16_t templateIdNullValue()
6676
{
6777
return (sbe_uint16_t)65535;
6878
}
6979

70-
static sbe_uint16_t templateIdMinValue()
80+
static const sbe_uint16_t templateIdMinValue()
7181
{
7282
return (sbe_uint16_t)0;
7383
}
7484

75-
static sbe_uint16_t templateIdMaxValue()
85+
static const sbe_uint16_t templateIdMaxValue()
7686
{
7787
return (sbe_uint16_t)65534;
7888
}
@@ -88,17 +98,17 @@ class MessageHeader
8898
return *this;
8999
}
90100

91-
static sbe_uint16_t schemaIdNullValue()
101+
static const sbe_uint16_t schemaIdNullValue()
92102
{
93103
return (sbe_uint16_t)65535;
94104
}
95105

96-
static sbe_uint16_t schemaIdMinValue()
106+
static const sbe_uint16_t schemaIdMinValue()
97107
{
98108
return (sbe_uint16_t)0;
99109
}
100110

101-
static sbe_uint16_t schemaIdMaxValue()
111+
static const sbe_uint16_t schemaIdMaxValue()
102112
{
103113
return (sbe_uint16_t)65534;
104114
}
@@ -114,17 +124,17 @@ class MessageHeader
114124
return *this;
115125
}
116126

117-
static sbe_uint16_t versionNullValue()
127+
static const sbe_uint16_t versionNullValue()
118128
{
119129
return (sbe_uint16_t)65535;
120130
}
121131

122-
static sbe_uint16_t versionMinValue()
132+
static const sbe_uint16_t versionMinValue()
123133
{
124134
return (sbe_uint16_t)0;
125135
}
126136

127-
static sbe_uint16_t versionMaxValue()
137+
static const sbe_uint16_t versionMaxValue()
128138
{
129139
return (sbe_uint16_t)65534;
130140
}

0 commit comments

Comments
 (0)