Adapts codegen templates to rtiddsgen 7.7 plain data members

This commit is contained in:
berrux-dev committed 2026-09-18 17:45:15 +02:00
1 parent c066c74d7f
commit 851cbd5cec
4 files changed
+12 -8

No files matched your search

@@ -484,7 +484,9 @@ class IdlDataWrapper final : public NameWrapper
QString nameGetter() const QString nameGetter() const
{ {
return m_data.name + (m_data.isOptional ? QStringLiteral("().get") : QString()); // rtiddsgen 7.7 generates public data members (no getters); optional
// members are omg::types::optional<T> and are unwrapped via .get().
return m_data.name + (m_data.isOptional ? QStringLiteral(".get()") : QString());
} }
private: private:
@@ -215,7 +215,7 @@ bool DtcImpl::waitForHistoricalData{{ dt.name }}(int timeoutMSec)
template <> template <>
{{ dt.key.cppType }} getKey(const {{ dt.type }} &val) {{ dt.key.cppType }} getKey(const {{ dt.type }} &val)
{ {
return val.{{ dt.key.name }}(); return val.{{ dt.key.name }};
} }
QMap<{{ dt.key.cppType }},::{{ namespace }}::{{ dt.type }}> DtcImpl::{{ dt.nameFlc }}s() QMap<{{ dt.key.cppType }},::{{ namespace }}::{{ dt.type }}> DtcImpl::{{ dt.nameFlc }}s()
@@ -89,7 +89,9 @@ bool DtsImpl::remove{{ dt.name }}ByKey({{ dt.key.cppTypeCr }} {{ dt.key.nameFlc
return false; return false;
} }
{{ namespace }}::{{ dt.name }} data; {{ namespace }}::{{ dt.name }} data;
data.{{ dt.key.name }}({{ dt.key.name }}); // rtiddsgen -stl generates plain public data members, so the key is
// assigned directly instead of the old setter call data.{{ dt.key.name }}(...).
data.{{ dt.key.name }} = {{ dt.key.name }};
return m_dts{{ dt.name }}->remove(data, errorMsgIfSampleDoesNotExists); return m_dts{{ dt.name }}->remove(data, errorMsgIfSampleDoesNotExists);
} }
{% endif %} {% endif %}
@@ -116,9 +116,9 @@ static T buildErrorReason(int reason, int requestId)
} }
T reply; T reply;
reply.id(requestId); reply.id = requestId;
reply.errorString(errString); reply.errorString = errString;
reply.errorParams(errArgs); reply.errorParams = errArgs;
return reply; return reply;
} }
@@ -196,7 +196,7 @@ int64_t FtcImpl::{{ ft.requestFlc }}(const {{ ft.requestType }} &request, const
const auto _reply = future.get(); // throws if exception set const auto _reply = future.get(); // throws if exception set
Core::FunctionReplyObject fro( Core::FunctionReplyObject fro(
{% for rp in ft.replyParams %} _reply.{{ rp.nameGetter }}(){% if not forloop.last %},{% endif %} {% endfor %} {% for rp in ft.replyParams %} _reply.{{ rp.nameGetter }}{% if not forloop.last %},{% endif %} {% endfor %}
); );
fro.setUniqueId(m_last{{ ft.request }}UniqueId); fro.setUniqueId(m_last{{ ft.request }}UniqueId);
@@ -234,7 +234,7 @@ void FtcImpl::{{ ft.onReply }}(const {{ namespace }}::{{ ft.reply }} &reply, int
{% if ft.isCoreFt %} {% if ft.isCoreFt %}
Core::FunctionReplyObject fro( Core::FunctionReplyObject fro(
{% for rp in ft.replyParams %} {% for rp in ft.replyParams %}
reply.{{ rp.nameGetter }}(){% if not forloop.last %},{% endif %} {% endfor %} reply.{{ rp.nameGetter }}{% if not forloop.last %},{% endif %} {% endfor %}
); );
fro.setUniqueId(m_last{{ ft.request }}UniqueId); fro.setUniqueId(m_last{{ ft.request }}UniqueId);
cb(fro); cb(fro);