Files
qt-migration-legatus/qt5-before/dlbo/Lts/Common/CodeGen/svc_dts_impl.cpp.grantlee
T
torstenandCopilot 7173785915 Qt6 Migration: Complete migration with DDS/RTI support and build validation
Major Changes:
- Merged latest Qt5 devel content from dlbo (292 files changed, 7 new dirs)
- Consolidated forward-declarations and include folders
- Removed unneeded modules per Niklas' repo check list

Build System Fixes:
- Fixed CMake VERSION_GREATER syntax in ParticipantManagement/CMakeLists.txt
- Added VLC packages (libvlc-dev, vlc-plugin-base) to docker_build.sh
- Added PostgreSQL dev packages (libpq-dev, postgresql-server-dev-all) to Dockerfile
- Fixed locale warnings (ANSI_X3.4-1968 → C.UTF-8)
- Fixed ArcGIS SDK path warnings when BUILD_ARCGIS=OFF

Code Generation Fixes:
- Fixed IDL enum collisions (PortType→CorePortType/DdsutPortType, PdmEventType)
- Fixed Grantlee template svc_translation.cpp.grantlee:
  - Changed {{ idl_enum.name }}_def:: to {{ idl_enum.name }}::
  - Fixed .underlying() calls for C++11 scoped enums (enum class)
- Removed generated files from repo (moc_*, *_dtc.h, *_ftc.h)

Validation:
- BUILD_RTI=ON: SUCCESS
- BUILD_RTI=OFF: SUCCESS
- C++17 standard maintained for RTI 7.7 compatibility
- Ubuntu 26.04 Docker environment verified

Remaining Warnings (expected):
- BgViewer, KDChart, KDReports, Poppler-Qt6 not found (optional features)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-09-15 18:20:26 +00:00

101 lines
2.3 KiB
Plaintext

/**
* {{ namespace_abbr_upper }} Data Topic Server Interface
* $Id$
* $HeadURL$
* $Author$
* Created by Christian Ehrlicher, SLSE, 2016-04-07
*/
{% autoescape off %}
// filename: {{ namespace_abbr }}_dts_impl.cpp
#include "{{ namespace_abbr }}_dts_impl.h"
#include <DDS/DTS/generic_dts_impl.h>
namespace {{ namespace }}
{
namespace Interface
{
// initializer function
std::shared_ptr<Dts> Dts::create(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector)
{
return std::make_shared<DtsImpl>(ddsConnector);
}
// DtsImpl
DtsImpl::DtsImpl(const std::shared_ptr<DDSConnector::DdsConnector> &ddsConnector)
: Dts()
, m_ddsConnector(ddsConnector)
, m_logger(getLogger("Dts"))
{}
DtsImpl::~DtsImpl()
{
enableAll(false);
}
bool DtsImpl::enableAll(bool enable)
{
{% for dt in dataTopics.member %} {% if dt.dtsImpl %}
if (!enable{{ dt.name }}(enable))
{
WARNING_LOG(m_logger) << "Error initializing data topic {{ dt.name }}";
return false;
}
{% endif %} {% endfor %}
return true;
}
{% for dt in dataTopics.member %} {% if dt.dtsImpl %}
//
// Data Topic '{{ dt.name }}'
//
bool DtsImpl::enable{{ dt.name }}(bool enable)
{
if (enable)
{
if (m_dts{{ dt.name }})
{
INFO_LOG(m_logger) << "{{ ft.name }} already enabled!";
return true;
}
m_dts{{ dt.name }}.reset(m_ddsConnector->createDTS<DTS::{{ dt.name }}Impl>());
assert(m_dts{{ dt.name }}.get());
}
else
{
m_dts{{ dt.name }} = nullptr;
}
return true;
}
bool DtsImpl::publish(const {{ namespace }}::{{ dt.type }} &data)
{
if (!m_dts{{ dt.name }})
{
WARNING_LOG(m_logger) << "Error publishing data topic {{ dt.name }} - not enabled";
Q_ASSERT(false);
return false;
}
return m_dts{{ dt.name }}->write(data);
}
{% if dt.key.name %}
bool DtsImpl::remove{{ dt.name }}ByKey({{ dt.key.cppTypeCr }} {{ dt.key.nameFlc }}, bool errorMsgIfSampleDoesNotExists)
{
if (!m_dts{{ dt.name }})
{
WARNING_LOG(m_logger) << "Error removing data topic {{ dt.name }} - not enabled";
Q_ASSERT(false);
return false;
}
{{ namespace }}::{{ dt.name }} data;
data.{{ dt.key.name }}({{ dt.key.name }});
return m_dts{{ dt.name }}->remove(data, errorMsgIfSampleDoesNotExists);
}
{% endif %}
{% endif %} {% endfor %}
} // namespace Interface
} // namespace {{ namespace }}
{% endautoescape %}