BUILD_RTI guards: svcTabCommon export header + GuezMinelayerProcessing stubs

- TrainingAreaBase/CMakeLists.txt: Wrap RTIDDSGEN with BUILD_RTI, add fallback target
- GuezMinelayerProcessing: BUILD_RTI guards for HandlerMinelayerData + stubs
- ddsfts/CMakeLists.txt: Fix INTERFACE→PUBLIC, add svcTabCommon dependency
- Add stub headers for BUILD_RTI=OFF compilation

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
torstenandCopilot committed 2026-08-21 19:27:34 +02:00
1 parent 950d669538
commit 6588fc7d3f
8 files changed
+109 -39

No files matched your search

@@ -28,17 +28,18 @@ SET(SRCS
) )
NGL_ADD_LIBRARY2(WS AAR SV HLA ddsfts SHARED ${SRCS}) NGL_ADD_LIBRARY2(WS AAR SV HLA ddsfts SHARED ${SRCS})
NGL_TARGET_INCLUDE_DIRECTORIES( NGL_TARGET_INCLUDE_DIRECTORIES(ddsfts
INTERFACE PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../../ ${CMAKE_CURRENT_SOURCE_DIR}/../../
${CMAKE_CURRENT_BINARY_DIR}/../../Proxies/TrainingAreaBase
) )
IF(BUILD_RTI) IF(BUILD_RTI)
IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(ddsfts NGL_TARGET_LINK_LIBRARIES(ddsfts
PRIVATE PRIVATE
RTI::nddscore RTI::nddscore
ProjectConfig ProjectConfig
ddsQoS ddsQoS
svcTabCommon
PUBLIC PUBLIC
Qt6::Core Qt6::Core
RTI::nddsc RTI::nddsc
@@ -46,12 +47,12 @@ NGL_TARGET_LINK_LIBRARIES(ddsfts
ddsgen ddsgen
ddsfts_connext ddsfts_connext
) )
ENDIF(BUILD_RTI)
ELSE() ELSE()
NGL_TARGET_LINK_LIBRARIES(ddsfts NGL_TARGET_LINK_LIBRARIES(ddsfts
PRIVATE PRIVATE
ProjectConfig ProjectConfig
ddsQoS ddsQoS
svcTabCommon
PUBLIC PUBLIC
Qt6::Core Qt6::Core
ddsgen ddsgen
@@ -73,33 +73,54 @@ CODEGEN_IDL_SVC(SRCS_common ${xml_FILE})
# Generate tab_db_impl.cpp/.h, tab_db.h # Generate tab_db_impl.cpp/.h, tab_db.h
CODEGEN_DATABASE(SRCS_common ${xml_FILE}) CODEGEN_DATABASE(SRCS_common ${xml_FILE})
# Generate *.cpp/*.hpp from idl # Generate *.cpp/*.hpp from idl (only with BUILD_RTI)
RTIDDSGEN(SRCS_common tab_enums.idl) IF(BUILD_RTI)
RTIDDSGEN(SRCS_common tab.idl) RTIDDSGEN(SRCS_common tab_enums.idl)
RTIDDSGEN(SRCS_common tab.idl)
# Generate tab_dt[s,c]_types.h, tab_ft[s,c]_types.h # Generate tab_dt[s,c]_types.h, tab_ft[s,c]_types.h
CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE}) CODEGEN_TOPIC_TYPEDEFS(SRCS_common ${xml_FILE})
# generate tab_[d|f]tc.h # generate tab_[d|f]tc.h
CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE}) CODEGEN_CLIENT_TOPICS_IFC(SRCS_common ${xml_FILE})
ELSE()
# Stub files for BUILD_RTI=OFF
SET(SRCS_common ${SRCS_common}
stubs/tab_enums_stub.hpp
stubs/tab_stub.hpp
)
ENDIF()
# Create target only if component flags allow
NGL_ADD_LIBRARY2(AAR SV WS HLA svcTabCommon SHARED ${SRCS_common}) NGL_ADD_LIBRARY2(AAR SV WS HLA svcTabCommon SHARED ${SRCS_common})
# Generate export header ALWAYS (needed for logger.h even if target not built)
# Use custom command to create minimal export header if target wasn't created
IF(NOT TARGET svcTabCommon)
# Create a dummy static library just for export header generation
ADD_LIBRARY(svcTabCommon STATIC ${SRCS_common})
ENDIF()
GENERATE_EXPORT_HEADER(svcTabCommon EXPORT_FILE_NAME "svctabcommon_export.h")
NGL_TARGET_INCLUDE_DIRECTORIES(svcTabCommon NGL_TARGET_INCLUDE_DIRECTORIES(svcTabCommon
PUBLIC PUBLIC
${CMAKE_CURRENT_SOURCE_DIR}/../ ${CMAKE_CURRENT_SOURCE_DIR}/../
${CMAKE_CURRENT_BINARY_DIR}/../ ${CMAKE_CURRENT_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/stubs
)
NGL_TARGET_LINK_LIBRARIES(svcTabCommon
PUBLIC
Qt6::Core
Qt6::Sql
NGLLogger
ngldb
svcPdmCommon
LtsUtilsCoreHeaderOnly
) )
IF(BUILD_RTI) IF(BUILD_RTI)
NGL_TARGET_LINK_LIBRARIES(svcTabCommon NGL_TARGET_LINK_LIBRARIES(svcTabCommon
PRIVATE PRIVATE
RTI::nddscpp2 RTI::nddscpp2
PUBLIC PUBLIC
Qt6::Core
Qt6::Sql
ddscore ddscore
NGLLogger
ngldb
svcPdmCommon
LtsUtilsCoreHeaderOnly
) )
ENDIF(BUILD_RTI) ENDIF(BUILD_RTI)
NGL_INSTALL_TARGET(svcTabCommon) NGL_INSTALL_TARGET(svcTabCommon)
@@ -0,0 +1,11 @@
// Stub for tab_enums.hpp when BUILD_RTI=OFF
#pragma once
namespace TrainingAreaBase {
// Stub enums - replace with actual values as needed
enum class DataModification {
INSERT = 0,
UPDATE = 1,
DELETE = 2
};
}
@@ -0,0 +1,7 @@
// Stub for tab.hpp when BUILD_RTI=OFF
#pragma once
// Forward declarations and stubs for RTI types
namespace TrainingAreaBase {
// Add stub types as needed
}
@@ -24,7 +24,6 @@ DdsHandler::DdsHandler(const std::shared_ptr<DDSConnector::DdsConnector> &ddsCon
#else #else
DdsHandler::DdsHandler() DdsHandler::DdsHandler()
: m_logger(getNGLLogger("GuezMinelayerProcessing.DdsHandler")) : m_logger(getNGLLogger("GuezMinelayerProcessing.DdsHandler"))
, m_topicLockMaster(std::make_shared<Core::TopicLockMaster>())
{ {
DEBUG_LOG(m_logger) << "DdsHandler() - RTI DDS not enabled"; DEBUG_LOG(m_logger) << "DdsHandler() - RTI DDS not enabled";
} }
@@ -29,15 +29,15 @@ public:
#if BUILD_RTI #if BUILD_RTI
std::shared_ptr<DDSConnector::DdsConnector> ddsConnector() const { return m_ddsConnector; } std::shared_ptr<DDSConnector::DdsConnector> ddsConnector() const { return m_ddsConnector; }
#endif
std::shared_ptr<Core::TopicLockMaster> topicLockMaster() const { return m_topicLockMaster; } std::shared_ptr<Core::TopicLockMaster> topicLockMaster() const { return m_topicLockMaster; }
#endif
private: private:
NGL::INGLLogger &m_logger; NGL::INGLLogger &m_logger;
#if BUILD_RTI #if BUILD_RTI
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector; std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
#endif
std::shared_ptr<Core::TopicLockMaster> m_topicLockMaster; std::shared_ptr<Core::TopicLockMaster> m_topicLockMaster;
#endif
}; };
} }
@@ -29,9 +29,9 @@ HandlerMinelayerData::HandlerMinelayerData(const std::shared_ptr<DdsHandler> &dd
QObject *parent) QObject *parent)
: QObject(parent) : QObject(parent)
, m_ddsHandler(ddsHandler) , m_ddsHandler(ddsHandler)
#if BUILD_RTI
, m_tabDtc(nullptr) , m_tabDtc(nullptr)
, m_ppmDtc(nullptr) , m_ppmDtc(nullptr)
#if BUILD_RTI
, m_aesFtc(nullptr) , m_aesFtc(nullptr)
#endif #endif
, m_minefieldInterpreter(new ZSSI_WI_Minenfeld_Interpreter(this)) , m_minefieldInterpreter(new ZSSI_WI_Minenfeld_Interpreter(this))
@@ -97,7 +97,7 @@ bool HandlerMinelayerData::init()
return ret; return ret;
} }
void HandlerMinelayerData::onSpecialSensorDataChanged(const TrainingAreaBase::SpecialSensorData &data, DataModification modType) void HandlerMinelayerData::onSpecialSensorDataChanged(const TrainingAreaBase::SpecialSensorData &data, ParticipantManagement::DataModification modType)
{ {
if (modType != DataModification::eAdded && if (modType != DataModification::eAdded &&
modType != DataModification::eModified) modType != DataModification::eModified)
@@ -158,7 +158,7 @@ void HandlerMinelayerData::convertMinelayerDataToXdrData(const TrainingAreaBase:
outData.verlegedaten.anzahl_verlegter_minen = inData.mineCount(); outData.verlegedaten.anzahl_verlegter_minen = inData.mineCount();
} }
void HandlerMinelayerData::onMinelayerTrailerData(const TrainingAreaBase::MinelayerTrailerData &data, DataModification modType) void HandlerMinelayerData::onMinelayerTrailerData(const TrainingAreaBase::MinelayerTrailerData &data, ParticipantManagement::DataModification modType)
{ {
if ((modType == DataModification::eAdded) || if ((modType == DataModification::eAdded) ||
(modType == DataModification::eModified)) (modType == DataModification::eModified))
@@ -201,7 +201,7 @@ void HandlerMinelayerData::onMinelayerTrailerData(const TrainingAreaBase::Minela
} }
} }
void HandlerMinelayerData::onMinelayerThrowerData(const TrainingAreaBase::MinelayerThrowerData &data, DataModification modType) void HandlerMinelayerData::onMinelayerThrowerData(const TrainingAreaBase::MinelayerThrowerData &data, ParticipantManagement::DataModification modType)
{ {
if ((modType == DataModification::eAdded) || if ((modType == DataModification::eAdded) ||
(modType == DataModification::eModified)) (modType == DataModification::eModified))
@@ -367,4 +367,20 @@ void HandlerMinelayerData::onMineAreaModifyFromCtaDataReply(const Core::Function
} // namespace GuezMinelayerProcessing } // namespace GuezMinelayerProcessing
#else // BUILD_RTI
namespace GuezMinelayerProcessing
{
HandlerMinelayerData::HandlerMinelayerData(const std::shared_ptr<DdsHandler> &ddsHandler,
QObject *parent)
: QObject(parent)
, m_ddsHandler(ddsHandler)
{}
HandlerMinelayerData::~HandlerMinelayerData()
{}
} // namespace GuezMinelayerProcessing
#endif // BUILD_RTI #endif // BUILD_RTI
@@ -12,24 +12,25 @@
#include <QPointF> #include <QPointF>
#include <QTimer> #include <QTimer>
#if BUILD_RTI
#include <AreaEffectSimulation/aes_ftc.h>
#include <Proxies/TrainingAreaBase/tab_dtc.h>
#endif
#include <LtsCoordTrans/lts_coord_trans.h> #include <LtsCoordTrans/lts_coord_trans.h>
#include <ParticipantManagement/ppm.hpp> #include <ParticipantManagement/ppm.hpp>
#include "GFS_map_cont.h" #include "GFS_map_cont.h"
#include "logger.h" #include "logger.h"
#if BUILD_RTI
#include <AreaEffectSimulation/aes_ftc.h>
#include <Proxies/TrainingAreaBase/tab_dtc.h>
#endif
namespace GuezMinelayerProcessing namespace GuezMinelayerProcessing
{ {
class DdsHandler; class DdsHandler;
class ZSSI_WI_Minenfeld_Interpreter; class ZSSI_WI_Minenfeld_Interpreter;
class HandlerMinelayerData : public QObject
#if BUILD_RTI #if BUILD_RTI
class HandlerMinelayerData : public QObject
, protected AreaEffectSimulation::Interface::Ftc::MineAreaModifyFromCtaDataReplyHandler , protected AreaEffectSimulation::Interface::Ftc::MineAreaModifyFromCtaDataReplyHandler
#endif
{ {
Q_OBJECT Q_OBJECT
public: public:
@@ -39,14 +40,12 @@ public:
bool init(); bool init();
#if BUILD_RTI
void onMineAreaModifyFromCtaDataReply(const Core::FunctionReplyObject &replyObject) override final; void onMineAreaModifyFromCtaDataReply(const Core::FunctionReplyObject &replyObject) override final;
#endif
private slots: private slots:
void onSpecialSensorDataChanged(const TrainingAreaBase::SpecialSensorData &data, DataModification modType); void onSpecialSensorDataChanged(const TrainingAreaBase::SpecialSensorData &data, ParticipantManagement::DataModification modType);
void onMinelayerTrailerData(const TrainingAreaBase::MinelayerTrailerData &data, DataModification modType); void onMinelayerTrailerData(const TrainingAreaBase::MinelayerTrailerData &data, ParticipantManagement::DataModification modType);
void onMinelayerThrowerData(const TrainingAreaBase::MinelayerThrowerData &data, DataModification modType); void onMinelayerThrowerData(const TrainingAreaBase::MinelayerThrowerData &data, ParticipantManagement::DataModification modType);
void onSendMinefield(const wirkfeld_minensperre_rt &minefield, int fzArt); void onSendMinefield(const wirkfeld_minensperre_rt &minefield, int fzArt);
void onStartMinefieldInterpreter (); void onStartMinefieldInterpreter ();
@@ -61,13 +60,29 @@ private:
std::shared_ptr<DdsHandler> m_ddsHandler; std::shared_ptr<DdsHandler> m_ddsHandler;
std::shared_ptr<TrainingAreaBase::Interface::Dtc> m_tabDtc; std::shared_ptr<TrainingAreaBase::Interface::Dtc> m_tabDtc;
std::shared_ptr<ParticipantManagement::Interface::Dtc> m_ppmDtc; std::shared_ptr<ParticipantManagement::Interface::Dtc> m_ppmDtc;
#if BUILD_RTI
std::shared_ptr<AreaEffectSimulation::Interface::Ftc> m_aesFtc; std::shared_ptr<AreaEffectSimulation::Interface::Ftc> m_aesFtc;
#endif
LtsCoordTrans::UtmCoordinate m_baseCoord; LtsCoordTrans::UtmCoordinate m_baseCoord;
ZSSI_WI_Minenfeld_Interpreter *m_minefieldInterpreter; ZSSI_WI_Minenfeld_Interpreter *m_minefieldInterpreter;
QTimer *m_minefieldInterpreterTimer; QTimer *m_minefieldInterpreterTimer;
}; };
#else
// Stub implementation when BUILD_RTI is OFF
class HandlerMinelayerData : public QObject
{
Q_OBJECT
public:
explicit HandlerMinelayerData(const std::shared_ptr<DdsHandler> &ddsHandler,
QObject *parent = nullptr);
~HandlerMinelayerData();
bool init() { return false; }
private:
NGL::INGLLogger &m_logger;
std::shared_ptr<DdsHandler> m_ddsHandler;
};
#endif // BUILD_RTI
} // namespace GuezMinelayerProcessing } // namespace GuezMinelayerProcessing