Skip to content

Commit 67bb9be

Browse files
committed
[C++] Add referencedName and packageName to the Token definition.
1 parent 1f6ec0e commit 67bb9be

File tree

2 files changed

+23
-3
lines changed

2 files changed

+23
-3
lines changed

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

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,9 @@ class IrDecoder
289289
tmpLen = tokenCodec.getReferencedName(tmpBuffer, sizeof(tmpBuffer));
290290
std::string referencedName(tmpBuffer, tmpLen);
291291

292+
tmpLen = tokenCodec.getPackageName(tmpBuffer, sizeof(tmpBuffer));
293+
std::string packageName(tmpBuffer, tmpLen);
294+
292295
Encoding encoding(
293296
type,
294297
presence,
@@ -302,7 +305,7 @@ class IrDecoder
302305
timeUnit,
303306
semanticType);
304307

305-
Token token(tokenOffset, id, version, tokenSize, componentTokenCount, signal, name, description, encoding);
308+
Token token(tokenOffset, id, version, tokenSize, componentTokenCount, signal, name, description, encoding, referencedName, packageName);
306309

307310
tokens->push_back(token);
308311

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

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,10 @@ class Token
7777
Signal signal,
7878
std::string name,
7979
std::string description,
80-
Encoding encoding) :
80+
Encoding encoding,
81+
std::string referencedName = "",
82+
std::string packageName = ""
83+
) :
8184
m_offset(offset),
8285
m_fieldId(fieldId),
8386
m_version(version),
@@ -86,7 +89,9 @@ class Token
8689
m_signal(signal),
8790
m_name(std::move(name)),
8891
m_description(std::move(description)),
89-
m_encoding(std::move(encoding))
92+
m_encoding(std::move(encoding)),
93+
m_referencedName(std::move(referencedName)),
94+
m_packageName(std::move(packageName))
9095
{
9196
}
9297

@@ -105,6 +110,16 @@ class Token
105110
return m_description;
106111
}
107112

113+
inline const std::string &referencedName() const
114+
{
115+
return m_referencedName;
116+
}
117+
118+
inline const std::string &packageName() const
119+
{
120+
return m_packageName;
121+
}
122+
108123
inline std::int32_t fieldId() const
109124
{
110125
return m_fieldId;
@@ -150,6 +165,8 @@ class Token
150165
const std::string m_name;
151166
const std::string m_description;
152167
const Encoding m_encoding;
168+
const std::string m_referencedName;
169+
const std::string m_packageName;
153170
};
154171

155172
}}

0 commit comments

Comments
 (0)