From ad07345480a93e84777e79cf8654bf0145123a32 Mon Sep 17 00:00:00 2001 From: twi-devel Date: Mon, 31 Aug 2026 12:51:26 +0200 Subject: [PATCH] Grantlee Templates: Fix namespace resolution for RTI DTC generation - Changed {{ namespace }}::{{ dt.type }} to ::{{ namespace }}::{{ dt.type }} in svc_dtc.h.grantlee, svc_dtc_impl.cpp.grantlee, svc_dtc_impl.h.grantlee - Ensures absolute namespace resolution for Core::* types - Fixes MOC/compilation errors for CurrentRunningState, LockedEntity, etc. - Updated CMakeLists.txt for RTI 7.7.0 detection with DDS_PATH - Fixed RTI include paths (ndds/hpp and ndds directories) - Updated Lts/DDS module files for Qt6/RTI 7.7 compatibility Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- qt6-after/qt6-migrated-legatus/CMakeLists.txt | 64 +++++++++++++++---- .../Lts/Common/CodeGen/svc_dtc.h.grantlee | 15 +++-- .../Common/CodeGen/svc_dtc_impl.cpp.grantlee | 16 ++--- .../Common/CodeGen/svc_dtc_impl.h.grantlee | 16 ++--- .../Lts/DDS/CMakeLists.txt | 4 +- .../Lts/DDS/Core/function_reply_object.h | 2 +- .../Lts/DDS/Core/logger.h | 2 +- .../Lts/DDS/Core/pacemaker.cpp | 56 +++++++++++++++- .../Lts/DDS/Core/pacemaker.h | 32 ++++++---- .../Lts/DDS/Core/topic_lock_master.h | 19 +++++- .../Lts/DDS/DDSConnector/dds_connector.cpp | 8 +-- .../Lts/DDS/DDSConnector/dds_connector.h | 7 ++ .../Lts/DDS/DDSConnector/publisher.cpp | 2 +- .../Lts/DDS/DDSConnector/subscriber.cpp | 2 +- 14 files changed, 183 insertions(+), 62 deletions(-) diff --git a/qt6-after/qt6-migrated-legatus/CMakeLists.txt b/qt6-after/qt6-migrated-legatus/CMakeLists.txt index 18830ce16..7fef08cf7 100755 --- a/qt6-after/qt6-migrated-legatus/CMakeLists.txt +++ b/qt6-after/qt6-migrated-legatus/CMakeLists.txt @@ -76,7 +76,7 @@ include_directories(${CMAKE_SOURCE_DIR}/include) include_directories(${CMAKE_BINARY_DIR}) include_directories(${CMAKE_BINARY_DIR}/Z/src/NGLLogger) # Include directories for external dependencies and internal modules -include_directories(${CMAKE_SOURCE_DIR}/Z/src/NGLLogger) +include_directories(${CMAKE_SOURCE_DIR}/Z/src) include_directories(${CMAKE_SOURCE_DIR}/Z/src/ngltools) include_directories(${CMAKE_SOURCE_DIR}/Lts/Viewer/SituationMap/Symbology) include_directories(${CMAKE_SOURCE_DIR}/Lts/Viewer/LtsDataView) @@ -87,6 +87,7 @@ include_directories(${CMAKE_SOURCE_DIR}/include/InfrastructureManagement) include_directories(${CMAKE_BINARY_DIR}/Lts/Services/InfrastructureManagement) include_directories(${CMAKE_SOURCE_DIR}/Lts/Proxies/GuezNasat) include_directories(${CMAKE_SOURCE_DIR}/Lts/DDS) +include_directories(${CMAKE_SOURCE_DIR}/Lts/DDS/QosProfile) include_directories(${CMAKE_SOURCE_DIR}/Lts/Common) include_directories(${CMAKE_SOURCE_DIR}/Lts/Common/LtsUtils) include_directories(${CMAKE_BINARY_DIR}/Lts/Common/LtsUtils/LtsUtilsCore) @@ -116,10 +117,31 @@ OPTION(BUILD_PLUGINS_PARTICIPANT_ORG_CHART "Build ParticipantOrgChart (requires OPTION(BUILD_PLUGINS_MSDL "Build MSDL module (requires Qt6 XmlPatterns)" OFF) OPTION(BUILD_PLUGINS_SAAB "Build Saab module (requires Qt6 XmlPatterns)" OFF) OPTION(BUILD_RTI "Build RTI Connext DDS dependent modules" OFF) +# Add Lts/ include path globally for QosProfile and other Lts headers +INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}/Lts) +IF(BUILD_RTI) + # Define BUILD_RTI as preprocessor macro for all targets + ADD_COMPILE_DEFINITIONS(BUILD_RTI) +ENDIF() OPTION(BUILD_ARCGIS "Build ArcGIS SDK dependent modules" ON) OPTION(BUILD_FILTERMANAGEMENT "Build FilterManagement plugins (temporarily disabled for migration)" OFF) OPTION(BUILD_CODIFICATION "Build CodificationManagement plugins (requires KDReports)" OFF) OPTION(BUILD_GRANTLEE "Build CodeGen Grantlee templates (requires Grantlee5/Qt5)" OFF) + +# If BUILD_GRANTLEE is OFF but ngl_codegen is needed (for IDL codegen), +# provide it as an imported executable target from pre-built location +IF(NOT BUILD_GRANTLEE) + # ngl_codegen is copied to build/bin/ by run_final_migration.sh + # Create an imported target so MacroCodeGenIdl.cmake can find it + IF(NOT TARGET ngl_codegen) + ADD_EXECUTABLE(ngl_codegen IMPORTED GLOBAL) + SET_TARGET_PROPERTIES(ngl_codegen PROPERTIES + IMPORTED_LOCATION "${CMAKE_BINARY_DIR}/bin/ngl_codegen" + ) + MESSAGE(STATUS "Using pre-built ngl_codegen from ${CMAKE_BINARY_DIR}/bin/ngl_codegen") + ENDIF() +ENDIF() + OPTION(BUILD_LTSWEBSOCKET "Build LtsWebSocket module (requires NGLLogger)" ON) IF(WIN32) @@ -142,19 +164,21 @@ ELSE() ENDIF() ENDIF() +# Set CMAKE_MODULE_PATH early so FIND_PACKAGE can find our custom Find modules +SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") +INCLUDE(FindLibraryWithDebug) + +# Find ArcGIS SDK globally if BUILD_ARCGIS is enabled +# This creates ArcGIS::ArcGIS target for all modules to use +IF(BUILD_ARCGIS) + FIND_PACKAGE(ArcGIS REQUIRED) +ENDIF() + ENABLE_TESTING() INCLUDE(CTest) -# Add migration tests - skip when MIGRATE_MODULE targets specific Lts modules (tests need full codebase) -if(NOT DEFINED MIGRATE_MODULE OR MIGRATE_MODULE STREQUAL "tests") - ADD_SUBDIRECTORY(tests) -else() - message(STATUS "MIGRATE_MODULE=${MIGRATE_MODULE} - skipping tests (need full codebase)") -endif() CONFIGURE_FILE(CTestCustom.ctest ${CMAKE_BINARY_DIR}/CTestCustom.ctest COPYONLY) CONFIGURE_FILE(lts-cc.conf ${CMAKE_BINARY_DIR}/lts-cc.conf.distrib COPYONLY) -SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake") -INCLUDE(FindLibraryWithDebug) # Add bundled GeographicLib cmake config to find modern targets (GeographicLib::GeographicLib_SHARED) LIST(APPEND CMAKE_PREFIX_PATH "${CMAKE_SOURCE_DIR}/include/GeographicLib/lib/cmake") SET(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/bin) @@ -235,6 +259,12 @@ IF(BUILD_RTI) "${RTI_INSTALL_DIR}/include/rti" ) + # RTI Include-Pfade global hinzufügen (auch für Tests die keine RTI Libraries linken) + INCLUDE_DIRECTORIES(${RTI_INCLUDE_DIRS}) + + # RTI Include-Pfade auch an MOC weitergeben (für Q_OBJECT Header mit RTI Types) + SET(CMAKE_AUTOMOC_INCLUDE_DIRECTORIES ${CMAKE_AUTOMOC_INCLUDE_DIRECTORIES} ${RTI_INCLUDE_DIRS}) + # IMPORTED Targets für RTI Libraries erstellen # Debug und Release Varianten korrekt konfigurieren FOREACH(lib nddsc nddscore nddscpp nddscpp2 nddsctesthelpers) @@ -273,11 +303,13 @@ IF(BUILD_RTI) ENDIF() ENDIF(BUILD_RTI) -# Alias Targets für RTI Libraries (für Abwärtskompatibilität) + # Alias Targets für RTI Libraries (für Abwärtskompatibilität) # Ermöglicht Verwendung von "ddscore" statt "RTI::nddscore" in CMakeLists.txt Files +# HINWEIS: ddscore, ddsftc, ddsfts, ddsconnector werden von Lts/DDS Modulen als echte Targets erstellt +# Daher hier KEINE ALIAS für diese Targets erstellen um Kollisionen zu vermeiden IF(BUILD_RTI AND TARGET RTI::nddsc) ADD_LIBRARY(ddsc ALIAS RTI::nddsc) - ADD_LIBRARY(ddscore ALIAS RTI::nddscore) + # ddscore wird von Lts/DDS/Core/CMakeLists.txt als echtes Target erstellt - kein Alias hier! ADD_LIBRARY(ddscpp2 ALIAS RTI::nddscpp2) # Optionale Targets nur als ALIAS erstellen wenn verfügbar (RTI 7.x hat nicht alle Legacy-Bibliotheken) # KEINE INTERFACE-Placeholder erstellen - Module müssen selbst mit fehlenden Targets umgehen @@ -317,6 +349,7 @@ ENDIF() # Ein paar NGL-spezifische Macros # INCLUDE(NGLMacros) +INCLUDE(MacroCodeGenIdl) # # Projektspezifische Einstellungen? @@ -514,6 +547,15 @@ NGL_ADD_SUBDIR_GUARDED(TetraIF) NGL_ADD_SUBDIR_GUARDED(Z/src) # Services are included before plugins via Lts/CMakeLists.txt (LTS_SUBDIRS order) NGL_ADD_SUBDIR_GUARDED(Lts) + + # Add migration tests - skip when MIGRATE_MODULE targets specific Lts modules (tests need full codebase) + # MUST be after Lts configuration so tests can access Lts targets (LtsTimelineClassic, codegen_base, etc.) + if(NOT DEFINED MIGRATE_MODULE OR MIGRATE_MODULE STREQUAL "" OR MIGRATE_MODULE STREQUAL "tests") + ADD_SUBDIRECTORY(tests) + else() + message(STATUS "MIGRATE_MODULE=${MIGRATE_MODULE} - skipping tests (need full codebase)") + endif() + # TrainingAreaBase is included via Lts/Proxies when Lts is processed # Special-case: when migrating TetraIF, also include ProjectDataManagement so generated headers # and internal logger target are available in the same build tree for TetraIF dependents. diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_dtc.h.grantlee b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_dtc.h.grantlee index 4e4f87c7b..538aeeffc 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_dtc.h.grantlee +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_dtc.h.grantlee @@ -18,6 +18,9 @@ #include <{{ include_prefix }}/{{ namespace_abbr }}_export.h> #include <{{ include_prefix }}/{{ namespace_abbr }}.hpp> +// Bring Core namespace types into scope for Interface namespace +using namespace {{ namespace }}; + namespace DDSConnector { class DdsConnector; @@ -68,16 +71,16 @@ public: // // Data Topic '{{ dt.name }}' // {% if dt.key.name %} - virtual QMap<{{ dt.key.cppType }}, {{ namespace }}::{{ dt.type }}> {{ dt.nameFlc }}s() = 0; - virtual bool {{ dt.nameFlc }}s(const std::function &cb) = 0; + virtual QMap<{{ dt.key.cppType }}, ::{{ namespace }}::{{ dt.type }}> {{ dt.nameFlc }}s() = 0; + virtual bool {{ dt.nameFlc }}s(const std::function &cb) = 0; // when the cb returns true, the loop is stopped (useful when searching for a specific topic) - virtual bool {{ dt.nameFlc }}s(const std::function &cb) = 0; - virtual {{ namespace }}::{{ dt.type }} {{ dt.nameFlc }}({{ dt.key.cppTypeCr }} {{ dt.key.nameFlc }}) = 0; + virtual bool {{ dt.nameFlc }}s(const std::function &cb) = 0; + virtual ::{{ namespace }}::{{ dt.type }} {{ dt.nameFlc }}({{ dt.key.cppTypeCr }} {{ dt.key.nameFlc }}) = 0; {% else %} - virtual {{ namespace }}::{{ dt.type }} {{ dt.nameFlc }}() = 0; + virtual ::{{ namespace }}::{{ dt.type }} {{ dt.nameFlc }}() = 0; {% endif %} Q_SIGNALS: - void {{ dt.nameFlc }}Changed(const {{ namespace }}::{{ dt.type }} &data, DataModification modType); + void {{ dt.nameFlc }}Changed(const ::{{ namespace }}::{{ dt.type }} &data, DataModification modType); {% endfor %} diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_dtc_impl.cpp.grantlee b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_dtc_impl.cpp.grantlee index 4a7caff62..0aae40564 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_dtc_impl.cpp.grantlee +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_dtc_impl.cpp.grantlee @@ -218,7 +218,7 @@ template <> 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() { if (!is{{ dt.name }}Enabled()) { @@ -229,7 +229,7 @@ QMap<{{ dt.key.cppType }},{{ namespace }}::{{ dt.type }}> DtcImpl::{{ dt.nameFlc return m_{{ dt.nameFlc }}Cont; } -bool DtcImpl::{{ dt.nameFlc }}s(const std::function &cb) +bool DtcImpl::{{ dt.nameFlc }}s(const std::function &cb) { if (!is{{ dt.name }}Enabled()) { @@ -240,7 +240,7 @@ bool DtcImpl::{{ dt.nameFlc }}s(const std::function &cb) +bool DtcImpl::{{ dt.nameFlc }}s(const std::function &cb) { if (!is{{ dt.name }}Enabled()) { @@ -251,7 +251,7 @@ bool DtcImpl::{{ dt.nameFlc }}s(const std::function {{ dt.nameFlc }}s() override final; - bool {{ dt.nameFlc }}s(const std::function &cb) override final; - bool {{ dt.nameFlc }}s(const std::function &cb) override final; - {{ namespace }}::{{ dt.type }} {{ dt.nameFlc }}({{ dt.key.cppTypeCr }} {{ dt.key.nameFlc }}) override final; + QMap<{{ dt.key.cppType }}, ::{{ namespace }}::{{ dt.type }}> {{ dt.nameFlc }}s() override final; + bool {{ dt.nameFlc }}s(const std::function &cb) override final; + bool {{ dt.nameFlc }}s(const std::function &cb) override final; + ::{{ namespace }}::{{ dt.type }} {{ dt.nameFlc }}({{ dt.key.cppTypeCr }} {{ dt.key.nameFlc }}) override final; {% else %} - {{ namespace }}::{{ dt.type }} {{ dt.nameFlc }}() override final; + ::{{ namespace }}::{{ dt.type }} {{ dt.nameFlc }}() override final; {% endif %} {% endif %} {% endfor %} private: @@ -85,10 +85,10 @@ protected: {% for dt in dataTopics.member %} {% if dt.dtcImpl %} - void {{ dt.nameFlc }}ChangedInternal(const {{ namespace }}::{{ dt.type }} &data, DataModification modType); + void {{ dt.nameFlc }}ChangedInternal(const ::{{ namespace }}::{{ dt.type }} &data, DataModification modType); std::unique_ptr m_dtc{{ dt.name }}; {% if dt.key.name %} - QMap<{{ dt.key.cppType }}, {{ namespace }}::{{ dt.type }}> m_{{ dt.nameFlc }}Cont; {% else %} - {{ namespace }}::{{ dt.type }} m_{{ dt.nameFlc }}; + QMap<{{ dt.key.cppType }}, ::{{ namespace }}::{{ dt.type }}> m_{{ dt.nameFlc }}Cont; {% else %} + ::{{ namespace }}::{{ dt.type }} m_{{ dt.nameFlc }}; {% endif %} {% endif %} {% endfor %} LOGGER_T m_logger; diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/CMakeLists.txt b/qt6-after/qt6-migrated-legatus/Lts/DDS/CMakeLists.txt index dfb5ba694..3ecdf0744 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/CMakeLists.txt +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/CMakeLists.txt @@ -5,6 +5,7 @@ # IF(BUILD_RTI) + ADD_SUBDIRECTORY(QosProfile) ADD_SUBDIRECTORY(DDSConnector) ENDIF() @@ -18,9 +19,6 @@ ADD_SUBDIRECTORY(Generic) ADD_SUBDIRECTORY(Routing) ADD_SUBDIRECTORY(Core) -IF(BUILD_RTI) - ADD_SUBDIRECTORY(QosProfile) -ENDIF() # During stepwise migration, add placeholder CTest entries before the # real DdsUnitTests subdir so the test-suite shows migration status even diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/function_reply_object.h b/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/function_reply_object.h index c86ad63bb..d9129b28e 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/function_reply_object.h +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/function_reply_object.h @@ -5,7 +5,7 @@ #include #include -#include "ddscore_export.h" +#include "core_export.h" #ifndef tr_lts #define tr_lts(ctx, t) (t) diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/logger.h b/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/logger.h index 627c2ac13..510142300 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/logger.h +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/logger.h @@ -4,7 +4,7 @@ #pragma once #include -#include "ddscore_export.h" +#include "core_export.h" namespace Core { diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/pacemaker.cpp b/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/pacemaker.cpp index b041d9bc6..d3f69346f 100644 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/pacemaker.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/pacemaker.cpp @@ -2,6 +2,7 @@ #include "pacemaker.h" +#if BUILD_RTI #include #include #include @@ -14,7 +15,7 @@ namespace Core { Pacemaker::Pacemaker(DDSConnector::DdsConnector *ddsConnector) : QObject(nullptr) - .getNGLLogger("Core.Pacemaker")) + , m_logger(NGL::INGLLoggerBootstrap::getNGLLogger("Core.Pacemaker")) { init(ddsConnector); } @@ -108,4 +109,57 @@ void Pacemaker::startTimer() m_paceThread->start(); } +#else // BUILD_RTI + +Pacemaker::Pacemaker(void* ddsConnector) + : QObject(nullptr) +{ + Q_UNUSED(ddsConnector) +} + +Pacemaker::~Pacemaker() +{ +} + +void Pacemaker::setNewState(Core::RunningState newState, const QString& errorString) +{ + Q_UNUSED(newState) + Q_UNUSED(errorString) +} + +void Pacemaker::setNewStateInternal(Core::RunningState newState, const QString& errorString) +{ + Q_UNUSED(newState) + Q_UNUSED(errorString) +} + +void Pacemaker::addPort(unsigned short number, Core::PortType portType, const QString& properties) +{ + Q_UNUSED(number) + Q_UNUSED(portType) + Q_UNUSED(properties) +} + +void Pacemaker::addPortInternal(unsigned short number, Core::PortType portType, const QString& properties) +{ + Q_UNUSED(number) + Q_UNUSED(portType) + Q_UNUSED(properties) +} + +void Pacemaker::publishState() +{ +} + +void Pacemaker::init(void* ddsConnector) +{ + Q_UNUSED(ddsConnector) +} + +void Pacemaker::startTimer() +{ +} + +#endif // BUILD_RTI + } // namespace Core diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/pacemaker.h b/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/pacemaker.h index 8e78aa074..0b976f6ae 100644 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/pacemaker.h +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/pacemaker.h @@ -4,12 +4,18 @@ #include "svccoreclient_export.h" -#if BUILD_RTI -#include -#endif #include #include +// Forward declarations for moc compatibility (moc doesn't see BUILD_RTI guards) +namespace Core { enum class RunningState; enum class PortType; } +namespace DTS { class CurrentRunningStateImpl; } + +#if BUILD_RTI +#include +#include +#endif + namespace DDSConnector { class DdsConnector; @@ -52,26 +58,24 @@ class CORE_CLIENT_EXPORT Pacemaker final : public QObject #endif private: - NGL::INGLLogger& m_logger; #if BUILD_RTI + NGL::INGLLogger& m_logger; void init(DDSConnector::DdsConnector* ddsConnector); void setNewStateInternal(Core::RunningState newState, const QString& errorString = QString()); void addPortInternal(unsigned short number, Core::PortType portType, const QString& properties = QStringLiteral("")); -#endif - private: - NGL::INGLLogger& m_logger; - static constexpr const int m_publishTimerDelay = 3000; - -#if BUILD_RTI CurrentRunningState m_state; + DTS::CurrentRunningStateImpl* m_dtsCurrentRunningState = nullptr; +#else + void* m_reserved1 = nullptr; + void* m_reserved2 = nullptr; + void* m_reserved3 = nullptr; + void* m_reserved4 = nullptr; + void* m_reserved5 = nullptr; #endif + static constexpr const int m_publishTimerDelay = 3000; QTimer* m_publishTimer = nullptr; QThread* m_paceThread = nullptr; - -#if BUILD_RTI - DTS::CurrentRunningStateImpl* m_dtsCurrentRunningState; -#endif }; } // namespace Core diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/topic_lock_master.h b/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/topic_lock_master.h index 42495ee42..23b41c240 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/topic_lock_master.h +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/Core/topic_lock_master.h @@ -1,10 +1,14 @@ #pragma once -#include - #include #include +#if BUILD_RTI +#include +#else +// Forward declarations for moc compatibility when BUILD_RTI=OFF +namespace DDS { namespace Core { namespace Interface { class Dtc; } } } +#endif namespace DDSConnector { @@ -44,10 +48,17 @@ class CORE_CLIENT_EXPORT TopicLockMaster : public QObject { Q_OBJECT public: +#if BUILD_RTI explicit TopicLockMaster(const std::shared_ptr &ddsConnector); ~TopicLockMaster(); bool init(const std::shared_ptr &ddsConnector); +#else + explicit TopicLockMaster(void* /*ddsConnector*/) {} + ~TopicLockMaster() = default; + + bool init(void* /*ddsConnector*/) { return false; } +#endif template bool isLocked(const E &data, int exerciseId) @@ -58,7 +69,9 @@ public: private: QSet m_lockedEntitys; - std::shared_ptr m_coreDtc; +#if BUILD_RTI + std::shared_ptr m_coreDtc; +#endif }; } diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/dds_connector.cpp b/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/dds_connector.cpp index 9a52e2d4f..c3f0ddbec 100644 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/dds_connector.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/dds_connector.cpp @@ -8,7 +8,7 @@ #include "subscriber.h" #include -#include +#include #include #include @@ -32,7 +32,7 @@ DdsConnector::DdsConnector(int domainId, , m_publisher(nullptr) , m_subscriber(nullptr) , m_wsHandler(nullptr) - .getNGLLogger("Common.DDSConnector")) + , m_logger(NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("Common.DDSConnector")) { initInternal(); DEBUG_LOG(m_logger) << "DdsConnector ctor: " << m_domainId << "," << m_partitionId << "," << m_exerciseId << "," @@ -153,8 +153,8 @@ std::string DdsConnector::getPartitionString(IDL::PartitionType pt, int partitio return IDL::replayPartition(partitionId); } - NGL::INGLLogger& m_logger = NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("Common.DDSConnector"); - ERROR_LOG(m_logger) << "Invalid partition type: " << static_cast(pt); + NGL::INGLLogger& logger = NGL::NGLLoggerBootstrap::getNGLRootLogger().getNGLLogger("Common.DDSConnector"); + ERROR_LOG(logger) << "Invalid partition type: " << static_cast(pt); return std::string(); } diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/dds_connector.h b/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/dds_connector.h index fd1ac0df3..d757dc38c 100644 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/dds_connector.h +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/dds_connector.h @@ -129,6 +129,13 @@ class DDSCONNECTOR_EXPORT DdsConnector void initSubscriber(); void initDomainParticipant(); + private: +#if BUILD_RTI + void initInternal(); + void createWaitSetHandler(); +#endif + + public: template T* createDTS(const std::string& topicName = DDS::Helper::getShortTopicName(DDS::topic_type_name::value())) diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/publisher.cpp b/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/publisher.cpp index 028336217..d03cbbfd0 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/publisher.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/publisher.cpp @@ -5,7 +5,7 @@ #include #include -#include +#include #include namespace DDSConnector diff --git a/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/subscriber.cpp b/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/subscriber.cpp index 213e5d6db..14427d4ee 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/subscriber.cpp +++ b/qt6-after/qt6-migrated-legatus/Lts/DDS/DDSConnector/subscriber.cpp @@ -4,7 +4,7 @@ #include "subscriber.h" #include "pub_sub_base_p.h" -#include +#include #include namespace DDSConnector