Skip to content

Commit f0fbd72

Browse files
committed
Merge remote-tracking branch 'origin/master'
2 parents 0dcd4c7 + f982ac9 commit f0fbd72

File tree

2 files changed

+87
-31
lines changed

2 files changed

+87
-31
lines changed

sbe-tool/src/main/cpp/otf/Encoding.h

Lines changed: 65 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015 - 2016 Real Logic Ltd.
2+
* Copyright 2015 - 2017 Real Logic Ltd.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -291,10 +291,19 @@ class Encoding
291291
std::string characterEncoding,
292292
std::string epoch,
293293
std::string timeUnit,
294-
std::string semanticType) :
295-
m_presence(presence), m_primitiveType(type), m_byteOrder(byteOrder), m_minValue(minValue), m_maxValue(maxValue),
296-
m_nullValue(nullValue), m_constValue(constValue), m_characterEncoding(characterEncoding), m_epoch(epoch),
297-
m_timeUnit(timeUnit), m_semanticType(semanticType)
294+
std::string semanticType)
295+
:
296+
m_presence(presence),
297+
m_primitiveType(type),
298+
m_byteOrder(byteOrder),
299+
m_minValue(minValue),
300+
m_maxValue(maxValue),
301+
m_nullValue(nullValue),
302+
m_constValue(constValue),
303+
m_characterEncoding(characterEncoding),
304+
m_epoch(epoch),
305+
m_timeUnit(timeUnit),
306+
m_semanticType(semanticType)
298307
{
299308
}
300309

@@ -405,17 +414,17 @@ class Encoding
405414
}
406415
}
407416

408-
inline Presence presence() const
417+
inline const Presence presence() const
409418
{
410419
return m_presence;
411420
}
412421

413-
inline ByteOrder byteOrder() const
422+
inline const ByteOrder byteOrder() const
414423
{
415424
return m_byteOrder;
416425
}
417426

418-
inline PrimitiveType primitiveType() const
427+
inline const PrimitiveType primitiveType() const
419428
{
420429
return m_primitiveType;
421430
}
@@ -435,25 +444,60 @@ class Encoding
435444
return getDouble(m_primitiveType, m_byteOrder, buffer);
436445
}
437446

447+
inline const PrimitiveValue& minValue() const
448+
{
449+
return m_minValue;
450+
}
451+
452+
inline const PrimitiveValue& maxValue() const
453+
{
454+
return m_maxValue;
455+
}
456+
457+
inline const PrimitiveValue& nullValue() const
458+
{
459+
return m_nullValue;
460+
}
461+
438462
inline const PrimitiveValue& constValue() const
439463
{
440464
return m_constValue;
441465
}
442466

467+
inline const std::string& characterEncoding() const
468+
{
469+
return m_characterEncoding;
470+
}
471+
472+
inline const std::string& epoch() const
473+
{
474+
return m_epoch;
475+
}
476+
477+
inline const std::string& timeUnit() const
478+
{
479+
return m_timeUnit;
480+
}
481+
482+
inline const std::string& semanticType() const
483+
{
484+
return m_semanticType;
485+
}
486+
443487
private:
444-
Presence m_presence;
445-
PrimitiveType m_primitiveType;
446-
ByteOrder m_byteOrder;
447-
448-
PrimitiveValue m_minValue;
449-
PrimitiveValue m_maxValue;
450-
PrimitiveValue m_nullValue;
451-
PrimitiveValue m_constValue;
452-
453-
std::string m_characterEncoding;
454-
std::string m_epoch;
455-
std::string m_timeUnit;
456-
std::string m_semanticType;
488+
const Presence m_presence;
489+
const PrimitiveType m_primitiveType;
490+
const ByteOrder m_byteOrder;
491+
492+
const PrimitiveValue m_minValue;
493+
const PrimitiveValue m_maxValue;
494+
const PrimitiveValue m_nullValue;
495+
const PrimitiveValue m_constValue;
496+
497+
const std::string m_characterEncoding;
498+
const std::string m_epoch;
499+
const std::string m_timeUnit;
500+
const std::string m_semanticType;
457501
};
458502

459503
}}

sbe-tool/src/main/cpp/otf/Token.h

Lines changed: 22 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2015 - 2016 Real Logic Ltd.
2+
* Copyright 2015 - 2017 Real Logic Ltd.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -78,14 +78,21 @@ class Token
7878
Signal signal,
7979
std::string name,
8080
std::string description,
81-
Encoding encoding) :
82-
m_offset(offset), m_fieldId(fieldId), m_version(version), m_encodedLength(encodedLength),
83-
m_componentTokenCount(componentTokenCount), m_signal(signal), m_name(name),
84-
m_description(description), m_encoding(encoding)
81+
Encoding encoding)
82+
:
83+
m_offset(offset),
84+
m_fieldId(fieldId),
85+
m_version(version),
86+
m_encodedLength(encodedLength),
87+
m_componentTokenCount(componentTokenCount),
88+
m_signal(signal),
89+
m_name(name),
90+
m_description(description),
91+
m_encoding(encoding)
8592
{
8693
}
8794

88-
inline Signal signal() const
95+
inline const Signal signal() const
8996
{
9097
return m_signal;
9198
}
@@ -95,6 +102,11 @@ class Token
95102
return m_name;
96103
}
97104

105+
inline const std::string& description() const
106+
{
107+
return m_description;
108+
}
109+
98110
inline std::int32_t fieldId() const
99111
{
100112
return m_fieldId;
@@ -136,10 +148,10 @@ class Token
136148
const std::int32_t m_version;
137149
const std::int32_t m_encodedLength;
138150
const std::int32_t m_componentTokenCount;
139-
Signal m_signal;
140-
std::string m_name;
141-
std::string m_description;
142-
Encoding m_encoding;
151+
const Signal m_signal;
152+
const std::string m_name;
153+
const std::string m_description;
154+
const Encoding m_encoding;
143155
};
144156

145157
}}

0 commit comments

Comments
 (0)