Skip to content

Commit 35c8c22

Browse files
committed
changed serialized presence constants to avoid conflicts in C++
1 parent 8027b79 commit 35c8c22

File tree

9 files changed

+177
-177
lines changed

9 files changed

+177
-177
lines changed

main/cpp/otf_api/Ir.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,7 @@ void Ir::addToken(::uint32_t offset,
381381
.signal((SignalCodec::Value)signal)
382382
.primitiveType((PrimitiveTypeCodec::Value)primitiveType)
383383
.byteOrder((ByteOrderCodec::Value)byteOrder)
384-
.presence((constValue != NULL ? PresenceCodec::OPTIONAL : PresenceCodec::REQUIRED));
384+
.presence((constValue != NULL ? PresenceCodec::SBE_OPTIONAL : PresenceCodec::SBE_REQUIRED));
385385

386386
tokenCodec.putName(name.c_str(), name.size());
387387
tokenCodec.putConstValue(constValue, constValueLength);

main/cpp/uk_co_real_logic_sbe_ir_generated/FrameCodec.hpp

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
#include <math.h>
77
#include "sbe/sbe.hpp"
88

9-
#include "uk_co_real_logic_sbe_ir_generated/VarDataEncoding.hpp"
109
#include "uk_co_real_logic_sbe_ir_generated/ByteOrderCodec.hpp"
10+
#include "uk_co_real_logic_sbe_ir_generated/SignalCodec.hpp"
1111
#include "uk_co_real_logic_sbe_ir_generated/PresenceCodec.hpp"
1212
#include "uk_co_real_logic_sbe_ir_generated/PrimitiveTypeCodec.hpp"
13-
#include "uk_co_real_logic_sbe_ir_generated/SignalCodec.hpp"
13+
#include "uk_co_real_logic_sbe_ir_generated/VarDataEncoding.hpp"
1414

1515
using namespace sbe;
1616

@@ -267,6 +267,18 @@ class FrameCodec
267267
return *this;
268268
}
269269

270+
static const char *packageNameMetaAttribute(const MetaAttribute::Attribute metaAttribute)
271+
{
272+
switch (metaAttribute)
273+
{
274+
case MetaAttribute::EPOCH: return "unix";
275+
case MetaAttribute::TIME_UNIT: return "nanosecond";
276+
case MetaAttribute::SEMANTIC_TYPE: return "";
277+
}
278+
279+
return "";
280+
}
281+
270282
static const char *packageNameCharacterEncoding()
271283
{
272284
return "UTF-8";
@@ -288,18 +300,6 @@ class FrameCodec
288300
}
289301

290302

291-
static const char *packageNameMetaAttribute(const MetaAttribute::Attribute metaAttribute)
292-
{
293-
switch (metaAttribute)
294-
{
295-
case MetaAttribute::EPOCH: return "unix";
296-
case MetaAttribute::TIME_UNIT: return "nanosecond";
297-
case MetaAttribute::SEMANTIC_TYPE: return "";
298-
}
299-
300-
return "";
301-
}
302-
303303
static int packageNameHeaderSize()
304304
{
305305
return 1;
@@ -340,6 +340,18 @@ class FrameCodec
340340
return length;
341341
}
342342

343+
static const char *namespaceNameMetaAttribute(const MetaAttribute::Attribute metaAttribute)
344+
{
345+
switch (metaAttribute)
346+
{
347+
case MetaAttribute::EPOCH: return "unix";
348+
case MetaAttribute::TIME_UNIT: return "nanosecond";
349+
case MetaAttribute::SEMANTIC_TYPE: return "";
350+
}
351+
352+
return "";
353+
}
354+
343355
static const char *namespaceNameCharacterEncoding()
344356
{
345357
return "UTF-8";
@@ -361,18 +373,6 @@ class FrameCodec
361373
}
362374

363375

364-
static const char *namespaceNameMetaAttribute(const MetaAttribute::Attribute metaAttribute)
365-
{
366-
switch (metaAttribute)
367-
{
368-
case MetaAttribute::EPOCH: return "unix";
369-
case MetaAttribute::TIME_UNIT: return "nanosecond";
370-
case MetaAttribute::SEMANTIC_TYPE: return "";
371-
}
372-
373-
return "";
374-
}
375-
376376
static int namespaceNameHeaderSize()
377377
{
378378
return 1;
@@ -413,6 +413,18 @@ class FrameCodec
413413
return length;
414414
}
415415

416+
static const char *semanticVersionMetaAttribute(const MetaAttribute::Attribute metaAttribute)
417+
{
418+
switch (metaAttribute)
419+
{
420+
case MetaAttribute::EPOCH: return "unix";
421+
case MetaAttribute::TIME_UNIT: return "nanosecond";
422+
case MetaAttribute::SEMANTIC_TYPE: return "";
423+
}
424+
425+
return "";
426+
}
427+
416428
static const char *semanticVersionCharacterEncoding()
417429
{
418430
return "UTF-8";
@@ -434,18 +446,6 @@ class FrameCodec
434446
}
435447

436448

437-
static const char *semanticVersionMetaAttribute(const MetaAttribute::Attribute metaAttribute)
438-
{
439-
switch (metaAttribute)
440-
{
441-
case MetaAttribute::EPOCH: return "unix";
442-
case MetaAttribute::TIME_UNIT: return "nanosecond";
443-
case MetaAttribute::SEMANTIC_TYPE: return "";
444-
}
445-
446-
return "";
447-
}
448-
449449
static int semanticVersionHeaderSize()
450450
{
451451
return 1;

main/cpp/uk_co_real_logic_sbe_ir_generated/PresenceCodec.hpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,19 @@ class PresenceCodec
1616

1717
enum Value
1818
{
19-
REQUIRED = (sbe_uint8_t)0,
20-
OPTIONAL = (sbe_uint8_t)1,
21-
CONSTANT = (sbe_uint8_t)2,
19+
SBE_REQUIRED = (sbe_uint8_t)0,
20+
SBE_OPTIONAL = (sbe_uint8_t)1,
21+
SBE_CONSTANT = (sbe_uint8_t)2,
2222
NULL_VALUE = (sbe_uint8_t)255
2323
};
2424

2525
static PresenceCodec::Value get(const sbe_uint8_t value)
2626
{
2727
switch (value)
2828
{
29-
case 0: return REQUIRED;
30-
case 1: return OPTIONAL;
31-
case 2: return CONSTANT;
29+
case 0: return SBE_REQUIRED;
30+
case 1: return SBE_OPTIONAL;
31+
case 2: return SBE_CONSTANT;
3232
case 255: return NULL_VALUE;
3333
}
3434

0 commit comments

Comments
 (0)