BUILD_RTI conditional fixes and Qt6 API updates

- cmake/FindRTI.cmake: Add INTERFACE placeholder targets when RTI not found
- cmake/FindRTI.cmake: Force BUILD_RTI=OFF when RTI not installed
- Lts/Common/LtsSession/CMakeLists.txt: Make LtsSessionDataDds conditional on BUILD_RTI
- Lts/Viewer/CMakeLists.txt: Make LtsDataView conditional on BUILD_RTI
- Lts/Plugins/*/CMakeLists.txt: 97 plugin files wrapped in BUILD_RTI conditionals
- cmake/NGLMacros.cmake: Fix NGL_ADD_BIG_RESOURCES macro (removed premature return())
- Multiple Qt6 API fixes: QLinkedList→std::list, QStringRef→QStringView, etc.
- BUILD_RTI_FIXES_SUMMARY.md: Comprehensive documentation of all fixes

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
torstenandCopilot committed 2026-08-19 09:24:50 +02:00
1 parent b774f4035c
commit 4c9861a469
2065 files changed
+48219 -1763

No files matched your search

@@ -20,9 +20,9 @@
#include <AreaEffectSimulation/aes_dtc.h>
#include <AreaEffectSimulation/aes_ftc.h>
#include <LtsUtilsCore/data_modification_enum.h>
#include <LtsUtilsGuiDds/request_helper.h>
#include <LtsUtils/LtsUtilsGui/LtsUtilsGuiDds/request_helper.h>
#include <ParticipantManagement/ppm.hpp>
#include <ParticipantManagement/ppm.hpp>
#include <ParticipantManagement/ppm_dtc.h>
namespace AdlerJson
{
@@ -13,7 +13,7 @@
#include <QObject>
#include <QVector>
#include <QWebSocket>
#include <DDS/Core/core_types.h> // tr_lts
#include <Core/core_types.h> // tr_lts
#include <TrainingAreaBase/tab_plugin_interface.h>
// #include "logger.h"
#include "aes_handler.h"
@@ -11,7 +11,7 @@
#include <QObject>
#include <TrainingAreaBase/tab_plugin_interface.h>
#include <DDS/Core/core_types.h> // tr_lts
#include <Core/core_types.h> // tr_lts
#include <TrainingAreaBase/dds_handler.h>
//#include "logger.h"
#include "ppm_handler.h"
@@ -13,7 +13,7 @@
#include "main_dispatcher.h"
#include "logger.h"
#include <ParticipantManagement/ppm.hpp>
#include <ParticipantManagement/ppm_dtc.h>
#include <ParticipantManagement/ppm.hpp>
#include <ParticipantManagement/ppm_ftc.h>
#include <LtsUtilsCore/data_modification_enum.h>
#include <QTimer>
@@ -1,74 +0,0 @@
#pragma once
// STUB-HEADER: Diese Datei wird normalerweise von DDS generiert
// Für die Migration erstellen wir minimale Typ-Definitionen
#include <QString>
#include <QList>
#include <QVector>
namespace AreaEffectSimulation
{
// Forward declarations
struct ExplosionSingle;
struct EffectCluster;
struct AirSupportImpact;
struct OffRouteMine;
struct TrajectoryAdler;
// ExplosionSingle - Einzelne Explosion
struct ExplosionSingle {
int id = 0;
double x = 0.0;
double y = 0.0;
double z = 0.0;
double radius = 0.0;
double damage = 0.0;
qint64 timestamp = 0;
QString type;
};
// EffectCluster - Gruppe von Effekten
struct EffectCluster {
int id = 0;
QString name;
double x = 0.0;
double y = 0.0;
double z = 0.0;
QList<int> effectIds;
qint64 timestamp = 0;
};
// AirSupportImpact - Luftunterstützungseffekt
struct AirSupportImpact {
int id = 0;
double x = 0.0;
double y = 0.0;
double z = 0.0;
QString aircraftType;
QString weaponType;
qint64 timestamp = 0;
};
// OffRouteMine - Abseits-Mine
struct OffRouteMine {
int id = 0;
double x = 0.0;
double y = 0.0;
double z = 0.0;
bool active = true;
QString mineType;
qint64 timestamp = 0;
};
// TrajectoryAdler - Flugbahn für Adler
struct TrajectoryAdler {
int id = 0;
QList<double> xPoints;
QList<double> yPoints;
QList<double> zPoints;
qint64 timestamp = 0;
QString trajectoryType;
};
} // namespace AreaEffectSimulation
@@ -1,71 +0,0 @@
#pragma once
// STUB-HEADER: Diese Datei wird normalerweise von ddsdtc generiert
// Für die Migration erstellen wir minimale Typ-Definitionen
#include <QString>
namespace AreaEffectSimulation
{
// Placeholder enums - werden durch echte DDS-Typen ersetzt
enum class SymbolAppearance : int {
Solid = 0,
Dashed = 1,
Dotted = 2
};
enum class SymbolVisibility : int {
Visible = 0,
Hidden = 1
};
struct UnitSymbolPosition {
double x = 0.0;
double y = 0.0;
double z = 0.0;
};
// AesType - Arten von Area Effect Simulation Entities
enum class AesType : int {
AtBCContamination = 0,
AtNContamination = 1,
AtDangerArea = 2,
AtMineArea = 3,
AtMineCorridor = 4,
AtExplosionSingle = 5,
AtExplosionArea = 6,
AtFunctionalArea = 7,
AtBorderline = 8,
AtMineAreaSingleMines = 9,
AtDusSingleMine = 10,
AtGasPipe = 11,
AtTechnicalArea = 12,
AtAirSupportImpact = 13,
AtUnknown = 99
};
// AesEffectState_def - Status eines AES Effekts (mit _def Suffix wie DDS generiert)
enum class AesEffectState_def : int {
EsCreated = 0,
EsPrepared = 1,
EsFired = 2,
EsActivated = 3,
EsPaused = 4,
EsExpired = 5,
EsRemoved = 6,
EsUnknown = 99,
EsError = 100
};
// AesEffectState - Alias für AesEffectState_def (Backward Compatibility)
using AesEffectState = AesEffectState_def;
// EffectStateStruct - Filter-Struktur für Effect States
struct EffectStateStruct {
bool showCreated = true;
bool showPrepared = true;
bool showActive = true;
bool showInactive = false;
bool showExpired = false;
};
} // namespace AreaEffectSimulation
@@ -0,0 +1,12 @@
/**
* @file core.hpp
* @brief Core DDS Sammel-Header
*
* Beinhaltet alle Core-Typen für DDS-Integration.
*/
#pragma once
#include <Core/core_types.h>
#include <Core/core_enums.hpp>
#include <Core/core_dtc.h>
@@ -0,0 +1,51 @@
/**
* @file core_dtc_types.h
* @brief DDS-Stub für Core-Typen (DTC = Data Transfer Component)
*
* Dieser Header enthält Stub-Definitionen für DDS-Core-Typen, die von RTI DDS generiert werden würden.
*/
#pragma once
#include <QString>
namespace IDL
{
enum class PartitionType
{
Any = 0,
Live = 1,
Replay = 2,
Record = 3,
Gateway = 4
};
} // namespace IDL
namespace Core
{
class ReplayPartition
{
public:
ReplayPartition() = default;
int domainId() const { return m_domainId; }
int id() const { return m_id; }
int exerciseId() const { return m_exerciseId; }
QString tcpConnectionUrl() const { return m_tcpConnectionUrl; }
void setDomainId(int id) { m_domainId = id; }
void setId(int id) { m_id = id; }
void setExerciseId(int id) { m_exerciseId = id; }
void setTcpConnectionUrl(const QString &url) { m_tcpConnectionUrl = url; }
private:
int m_domainId = -1;
int m_id = 0;
int m_exerciseId = 0;
QString m_tcpConnectionUrl;
};
} // namespace Core
@@ -14,6 +14,7 @@
#include <QJsonObject>
#include <Core/core_types.h>
#include <Core/core_enums.hpp>
#include <Services/AreaEffectSimulation/aes.hpp>
namespace rti {
namespace core {
@@ -57,7 +58,7 @@ public:
// Content getter/setter (wird von symbol_appearance_settings_impl.cpp verwendet)
QString content() const { return m_content; }
void content(const QString &c) { m_content = c; }
void setContent(const QString &c) { m_content = c; }
private:
QString m_name;
@@ -11,6 +11,7 @@
#include <cstdint>
#include <string>
#include "InfrastructureManagement/ism_enums.hpp"
#include "ParticipantManagement/ppm.hpp"
namespace InfrastructureManagement {
@@ -0,0 +1,73 @@
#pragma once
#include <string>
#include <ostream>
namespace IDL
{
enum class PartitionType
{
Any,
Global,
Exercise,
AllExercises,
Replay,
};
inline std::string toStdString(PartitionType pt)
{
switch (pt)
{
case PartitionType::Any:
return "Any";
case PartitionType::Global:
return "Global";
case PartitionType::Exercise:
return "Exercise";
case PartitionType::AllExercises:
return "AllExercises";
case PartitionType::Replay:
return "Replay";
}
return std::string("invalid:") + std::to_string(static_cast<int>(pt));
}
inline std::ostream& operator <<(std::ostream &o, PartitionType pt)
{
switch (pt)
{
case PartitionType::Any:
case PartitionType::Global:
case PartitionType::Exercise:
case PartitionType::AllExercises:
case PartitionType::Replay:
return o << std::string("PartitionType::") + toStdString(pt);
default:
return o << std::to_string(static_cast<int>(pt));
}
}
inline std::string exercisePartition(int exerciseId)
{
if (exerciseId < 0)
return { "ex_*" };
return std::string("ex_") + std::to_string(exerciseId);
}
inline std::string replayPartition(int partitionId)
{
if (partitionId < 0)
return { "srp_*" };
return std::string("srp_") + std::to_string(partitionId);
}
}
@@ -0,0 +1,21 @@
/**
* Export definitions for LtsSessionData
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include <QtCore/qglobal.h>
#ifndef LTSSESSIONDATA_EXPORT
# ifdef BUILD_STATIC_LIBRARIES
# define LTSSESSIONDATA_EXPORT
# else
# if defined(MAKE_LTSESSIONDATA_LIB)
# define LTSSESSIONDATA_EXPORT Q_DECL_EXPORT
# else
# define LTSSESSIONDATA_EXPORT Q_DECL_IMPORT
# endif
# endif
#endif
@@ -1,27 +1,26 @@
/**
* Logger interface
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include <string>
#include <sstream>
#include <type_traits>
#include <QString>
#include <QPointF>
#include <QSize>
#include <QRect>
#include <QRectF>
#include <QList>
#ifdef BUILDING_NGLLOGGER
#include "ngllogger_export.h"
#else
#define NGLLOGGER_EXPORT
#endif
#include "NGLLogger_export.h"
namespace NGL
{
class INGLLogger;
// keep in sync with log4qt/level.h
enum class LogLevel
{
Undefined = 0,
@@ -33,13 +32,6 @@ enum class LogLevel
Fatal = 214,
};
// Helper to stream enum classes as integers
template<typename T, typename = std::enable_if_t<std::is_enum_v<T>>>
inline std::ostream &operator<<(std::ostream &os, T value)
{
return os << static_cast<std::underlying_type_t<T>>(value);
}
class LogStreamHelper
{
public:
@@ -50,26 +42,26 @@ public:
, m_file(file)
, m_func(function)
{}
inline ~LogStreamHelper();
inline ~LogStreamHelper(); // after INGLLogger class definition
template<typename T>
inline LogStreamHelper &operator<<(const T &val);
private:
INGLLogger &m_logger;
std::ostringstream m_buffer;
NGL::INGLLogger &m_logger;
const LogLevel m_level;
const int m_line;
const char *const m_file;
const char *const m_func;
};
// Interface class for source code logging.
// Use NGLLoggerBootstrap to create an instance of this interface.
// Look below in this headerfile for the macros with which to insert logging
// code into your source code.
// Lookup the log4cxx documentation (http://logging.apache.org/log4cxx/) for
// information on logger-hierarchies, logging-levels, and configuration files.
class INGLLogger
{
public:
@@ -80,15 +72,15 @@ public:
using String = std::string;
// Creates an instance of an INGLLogger interface. The fullqualifiedname is
// a dottet sequence (i.e. "NGL.thisandthat.mylogger"). The same name will
// always return the same interface-instance. It is not required to create
// the parent nodes.
virtual INGLLogger &getNGLLogger(const char *fullqualifiedname) = 0;
virtual INGLLogger &getNGLLogger(const std::string &fullqualifiedname) = 0;
// True if this level is enabled.
virtual bool isTraceEnabled() const = 0;
virtual bool isDebugEnabled() const = 0;
virtual bool isInfoEnabled() const = 0;
@@ -97,38 +89,38 @@ public:
virtual bool isFatalEnabled() const = 0;
virtual bool isLevelEnabled(LogLevel level) const = 0;
// Submit a LOG message.
// Use __FILE__ and __NAME__ macros.
virtual void log(LogLevel level, const INGLLogger::String &message, const char *file = nullptr, int line = -1, const char *function = nullptr) = 0;
// Submit an TRACE message.
virtual void logTrace(const INGLLogger::String &message, const char *file = nullptr, int line = -1, const char *function = nullptr) = 0;
// Submit an DEBUG message.
virtual void logDebug(const INGLLogger::String &message, const char *file = nullptr, int line = -1, const char *function = nullptr) = 0;
// Submit an INFO message.
virtual void logInfo(const INGLLogger::String &message, const char *file = nullptr, int line = -1, const char *function = nullptr) = 0;
// Submit a WARNING message.
virtual void logWarning(const INGLLogger::String &message, const char *file = nullptr, int line = -1, const char *function = nullptr) = 0;
// Submit an ERROR message.
virtual void logError(const INGLLogger::String &message, const char *file = nullptr, int line = -1, const char *function = nullptr) = 0;
// Submit a FATAL message.
virtual void logFatal(const INGLLogger::String &message, const char *file = nullptr, int line = -1, const char *function = nullptr) = 0;
// Writes a startup message into the logfile
virtual void logStartup(const char *file, int line, const char *function = nullptr) = 0;
// Writes a shutdown message into the logfile
virtual void logShutdown(const char *file, int line, const char *function = nullptr) = 0;
// Get this loggers fullqualified name.
virtual std::string getLoggerName() const = 0;
virtual void setNoSpace(bool bNoSpace) = 0;
virtual bool noSpace() const = 0;
};
//
// LogStreamHelper
//
inline LogStreamHelper::~LogStreamHelper()
{
m_logger.log(m_level, m_buffer.str(), m_file, m_line, m_func);
@@ -144,7 +136,7 @@ inline LogStreamHelper &LogStreamHelper::operator<<(const T &val)
}
}
} //namespace NGL
inline std::ostream &operator<<(std::ostream &stream, const QByteArray &str)
{
@@ -152,9 +144,9 @@ inline std::ostream &operator<<(std::ostream &stream, const QByteArray &str)
return stream;
}
//
// operator to ease logging (at least via NglLogging)
//
inline std::ostream &operator<<(std::ostream &stream,
const QPointF &value)
{
@@ -162,7 +154,7 @@ inline std::ostream &operator<<(std::ostream &stream,
return stream;
}
//----------------------------------------------------------------------------
inline std::ostream &operator<< (std::ostream &stream,
const QPoint &value)
@@ -254,62 +246,65 @@ inline void hexDumpHelper(NGL::INGLLogger &logger,
{
return hexDumpHelper(logger, level, data.data(), data.size());
}
}
} // namespace NGLLoggerHelper
NGLLOGGER_EXPORT NGL::INGLLogger& getMemoryLogger();
NGLLOGGER_EXPORT std::string getMemoryData();
}
} // namespace NGL
//==============================================================================
// macros
//==============================================================================
#define LOGFUNCTION Q_FUNC_INFO
#define NOTICE_LOG(...) \
NGL::LogStreamHelper(NGL::getMemoryLogger(), NGL::LogLevel::Info, __FILE__,__LINE__, __func__)
// log this output every time, no matter what log level is enabled
#define NOTICE_LOG(logger) \
NGL::LogStreamHelper(logger, NGL::LogLevel::Info, __FILE__,__LINE__, Q_FUNC_INFO)
#ifdef LTS_DEBUG
#define TRACE_LOG(...) \
for (bool log_level_enabled = false; log_level_enabled; log_level_enabled = false) \
NGL::LogStreamHelper(NGL::getMemoryLogger(), NGL::LogLevel::Trace, __FILE__,__LINE__, __func__)
#define TRACE_LOG(logger) \
for (bool log_level_enabled = (logger).isTraceEnabled(); log_level_enabled; log_level_enabled = false) \
NGL::LogStreamHelper(logger, NGL::LogLevel::Trace, __FILE__,__LINE__, Q_FUNC_INFO)
#else
#define TRACE_LOG(...) \
#define TRACE_LOG(logger) \
for ( ; false; ) \
NGL::LogStreamHelper(NGL::getMemoryLogger(), NGL::LogLevel::Trace, __FILE__,__LINE__, __func__)
NGL::LogStreamHelper(logger, NGL::LogLevel::Trace, __FILE__,__LINE__, Q_FUNC_INFO)
#endif
#define DEBUG_LOG(...) \
for (bool log_level_enabled = false; log_level_enabled; log_level_enabled = false) \
NGL::LogStreamHelper(NGL::getMemoryLogger(), NGL::LogLevel::Debug, __FILE__,__LINE__, __func__)
#define INFO_LOG(...) \
for (bool log_level_enabled = false; log_level_enabled; log_level_enabled = false) \
NGL::LogStreamHelper(NGL::getMemoryLogger(), NGL::LogLevel::Info, __FILE__,__LINE__, __func__)
#define WARNING_LOG(...) \
for (bool log_level_enabled = false; log_level_enabled; log_level_enabled = false) \
NGL::LogStreamHelper(NGL::getMemoryLogger(), NGL::LogLevel::Warning, __FILE__,__LINE__, __func__)
#define ERROR_LOG(...) \
for (bool log_level_enabled = false; log_level_enabled; log_level_enabled = false) \
NGL::LogStreamHelper(NGL::getMemoryLogger(), NGL::LogLevel::Error, __FILE__,__LINE__, __func__)
#define FATAL_LOG(...) \
for (bool log_level_enabled = false; log_level_enabled; log_level_enabled = false) \
NGL::LogStreamHelper(NGL::getMemoryLogger(), NGL::LogLevel::Fatal, __FILE__,__LINE__, __func__)
#define STARTUP_LOG(...) { NGL::getMemoryLogger().logStartup(__FILE__, __LINE__, __func__); }
#define SHUTDOWN_LOG(...) { NGL::getMemoryLogger().logShutdown(__FILE__, __LINE__, __func__); }
#define DEBUG_LOG(logger) \
for (bool log_level_enabled = (logger).isDebugEnabled(); log_level_enabled; log_level_enabled = false) \
NGL::LogStreamHelper(logger, NGL::LogLevel::Debug, __FILE__,__LINE__, Q_FUNC_INFO)
#define INFO_LOG(logger) \
for (bool log_level_enabled = (logger).isInfoEnabled(); log_level_enabled; log_level_enabled = false) \
NGL::LogStreamHelper(logger, NGL::LogLevel::Info, __FILE__,__LINE__, Q_FUNC_INFO)
#define WARNING_LOG(logger) \
for (bool log_level_enabled = (logger).isWarningEnabled(); log_level_enabled; log_level_enabled = false) \
NGL::LogStreamHelper(logger, NGL::LogLevel::Warning, __FILE__,__LINE__, Q_FUNC_INFO)
#define ERROR_LOG(logger) \
for (bool log_level_enabled = (logger).isErrorEnabled(); log_level_enabled; log_level_enabled = false) \
NGL::LogStreamHelper(logger, NGL::LogLevel::Error, __FILE__,__LINE__, Q_FUNC_INFO)
#define FATAL_LOG(logger) \
for (bool log_level_enabled = (logger).isFatalEnabled(); log_level_enabled; log_level_enabled = false) \
NGL::LogStreamHelper(logger, NGL::LogLevel::Fatal, __FILE__,__LINE__, Q_FUNC_INFO)
#define STARTUP_LOG(logger) { (logger).logStartup(__FILE__, __LINE__, Q_FUNC_INFO); }
#define SHUTDOWN_LOG(logger) { (logger).logShutdown(__FILE__, __LINE__, Q_FUNC_INFO); }
//==============================================================================
// use like:
// MEMORY_LOG() << " before something nasty";
// do something nasty
// MEMORY_LOG() << " after something nasty";
#define MEMORY_LOG() \
for (bool log_level_enabled = (NGL::getMemoryLogger()).isInfoEnabled(); log_level_enabled; log_level_enabled = false) \
NGL::LogStreamHelper(NGL::getMemoryLogger(), NGL::LogLevel::Info, __FILE__,__LINE__, __func__) << NGL::getMemoryData()
NGL::LogStreamHelper(NGL::getMemoryLogger(), NGL::LogLevel::Info, __FILE__,__LINE__, Q_FUNC_INFO) << NGL::getMemoryData()
//==============================================================================
@@ -2,8 +2,11 @@
// STUB-HEADER: Diese Datei wird normalerweise von DDS generiert
// Für die Migration erstellen wir minimale Typ-Definitionen
#include <QObject>
#include <QString>
#include <QList>
#include <functional>
#include <memory>
namespace ParticipantManagement
{
@@ -29,6 +32,7 @@ struct Participant {
QString externalName;
int partyId = 0;
bool isVerbund = false;
int superiorId = 0;
// Additional fields as needed
double x = 0.0;
@@ -73,27 +77,39 @@ struct MainSchedule {
bool isActive = false;
};
namespace Interface
{
// Dtc - Data Transfer Component für Participant Management
// DDS-generierte Klasse mit participantChanged Signal
class Dtc {
class Dtc : public QObject {
Q_OBJECT
public:
Dtc() = default;
virtual ~Dtc() = default;
~Dtc() override = default;
// Teilnehmer-Liste abrufen
QList<Participant> participants() const { return m_participants; }
// Teilnehmer-Liste abrufen (Callback-basiert wie im Original)
void participants(const std::function<void(const Participant&)>& callback) const {
for (const auto& p : m_participants) {
callback(p);
}
}
// Teilnehmer-Liste als QList (für direkten Zugriff)
QList<Participant> participantsList() const { return m_participants; }
// Teilnehmer hinzufügen/entfernen/ändern
void addParticipant(const Participant& p) {
m_participants.append(p);
emit participantChanged(p, static_cast<int>(DataModification::eAdded));
emit participantChanged(p, DataModification::eAdded);
}
void updateParticipant(const Participant& p) {
for (auto& existing : m_participants) {
if (existing.id == p.id) {
existing = p;
emit participantChanged(p, static_cast<int>(DataModification::eModified));
emit participantChanged(p, DataModification::eModified);
return;
}
}
@@ -105,17 +121,20 @@ public:
if (it->id == id) {
Participant removed = *it;
m_participants.erase(it);
emit participantChanged(removed, static_cast<int>(DataModification::eRemoved));
emit participantChanged(removed, DataModification::eRemoved);
return;
}
}
}
// Signal für Teilnehmer-Änderungen (Qt6: als normale Methode, wird von Connects verwendet)
void emit participantChanged(const Participant& participant, int modificationType);
signals:
// Signal für Teilnehmer-Änderungen
void participantChanged(const Participant& participant, DataModification modificationType);
private:
QList<Participant> m_participants;
};
} // namespace Interface
} // namespace ParticipantManagement
@@ -1,12 +0,0 @@
#pragma once
// STUB-HEADER: Diese Datei wird normalerweise von ddsdtc generiert
// Für die Migration erstellen wir minimale Forward-Declarations
namespace ParticipantManagement
{
namespace Interface
{
class Dtc;
class Ftc;
}
}
@@ -0,0 +1,44 @@
#pragma once
// DDS-Stub-Header für ParticipantManagement FTC (Filter Topic Client)
// Generiert für Qt6-Migration ohne RTI DDS
#include <ParticipantManagement/ppm.hpp>
#include <Core/core_types.h>
#include <functional>
#include <memory>
#include <map>
namespace ParticipantManagement
{
namespace Interface
{
class Ftc
{
public:
class ModifyTypeReplyHandler
{
public:
virtual ~ModifyTypeReplyHandler() = default;
virtual void onModifyTypeReply(const Core::FunctionReplyObject &replyObject) = 0;
};
Ftc() = default;
virtual ~Ftc() = default;
virtual std::map<int32_t, Type> getTypes() const
{
return std::map<int32_t, Type>();
}
virtual Type type(int32_t typeId) const
{
Type t;
t.id = typeId;
return t;
}
};
} // namespace Interface
} // namespace ParticipantManagement
@@ -1,12 +1,171 @@
/**
* @file pre_dtc.h
* @brief DDS-generated Stub-Header für PresentationManagement DTC (Data Transfer Component)
*
* Dieser Header ist ein Stub für den von RTI DDS Generator erzeugten Header.
* Ermöglicht Build ohne echte DDS-Codegenerierung.
*/
#pragma once
// STUB-HEADER: Diese Datei wird normalerweise von ddsdtc generiert
// Für die Migration erstellen wir minimale Forward-Declarations
#include <QObject>
#include <QString>
#include <QList>
#include <functional>
#include <memory>
namespace PresentationManagement
{
// Forward declarations
struct Presentation;
struct PresentationContent;
struct GetPresentationContentReply;
// FileStatus Enum - Status einer Präsentation
enum class FileStatus : int {
Valid = 0,
Deleted = 1
};
// Presentation - DDS-generierter Typ für Präsentationen
struct Presentation {
int32_t id = 0;
QString name;
QString description;
int32_t operatorId = 0;
qint64 lastModified = 0;
FileStatus fileStatus = FileStatus::Valid;
};
// PresentationContent - Inhalt einer Präsentation
struct PresentationContent {
QString attributes;
QString channel;
QString description;
int32_t duration = 0;
double height = 0.0;
int32_t id = 0;
int32_t index = 0;
int32_t presentationId = 0;
QString presentationTopicType;
qint64 startTime = 0;
double width = 0.0;
double x = 0.0;
double y = 0.0;
};
// GetPresentationContentReply - Reply für GetPresentationContent Request
struct GetPresentationContentReply {
QList<PresentationContent> content;
};
namespace Interface
{
class Dtc;
class Ftc;
}
}
/**
* @brief Dtc - Data Transfer Component für Presentation Management
*
* DDS-generierte Klasse mit Präsentation-Daten und Signalen für Änderungen.
*/
class Dtc : public QObject {
Q_OBJECT
public:
Dtc() = default;
~Dtc() override = default;
// Präsentations-Liste abrufen (Callback-basiert)
void presentations(const std::function<void(const Presentation&)>& callback) const {
for (const auto& p : m_presentations) {
callback(p);
}
}
// Präsentations-Liste als QList (für direkten Zugriff)
QList<Presentation> presentationsList() const { return m_presentations; }
// Präsentation hinzufügen/entfernen/ändern
void addPresentation(const Presentation& p) {
m_presentations.append(p);
emit presentationChanged(p, 0); // 0 = added
}
void updatePresentation(const Presentation& p) {
for (auto& existing : m_presentations) {
if (existing.id == p.id) {
existing = p;
emit presentationChanged(p, 1); // 1 = modified
return;
}
}
addPresentation(p);
}
void removePresentation(int id) {
for (auto it = m_presentations.begin(); it != m_presentations.end(); ++it) {
if (it->id == id) {
Presentation removed = *it;
m_presentations.erase(it);
emit presentationChanged(removed, 2); // 2 = removed
return;
}
}
}
// Content getter/setter für PresentationContent
void content(const std::function<void(const PresentationContent&)>& callback) const {
for (const auto& c : m_content) {
callback(c);
}
}
QList<PresentationContent> contentList() const { return m_content; }
void setContent(const QList<PresentationContent>& content) {
m_content = content;
}
signals:
// Signal für Präsentations-Änderungen
void presentationChanged(const Presentation& presentation, int modificationType);
private:
QList<Presentation> m_presentations;
QList<PresentationContent> m_content;
};
/**
* @brief Ftc - Filter Topic Client für Presentation Management
*
* DDS-generierte Klasse für Presentation-Client-Operationen.
*/
class Ftc
{
public:
using ModifyTypeReplyHandler = std::function<void(bool success)>;
virtual ~Ftc() = default;
/**
* @brief Factory-Methode zur Erstellung einer Ftc-Instanz
* @param connector DDS-Connector (wird im Stub ignoriert)
* @return Shared Pointer zur Ftc-Instanz (nullptr im Stub)
*/
static std::shared_ptr<Ftc> create(void* /*connector*/)
{
return nullptr; // Stub returns nullptr - actual implementation requires DDS
}
// PresentationModify Reply Handler
virtual void presentationModifyReply(ModifyTypeReplyHandler handler) = 0;
// PresentationRemove Reply Handler
virtual void presentationRemoveReply(ModifyTypeReplyHandler handler) = 0;
// GetPresentationContent Reply Handler
virtual void getPresentationContentReply(const GetPresentationContentReply& reply) = 0;
};
} // namespace Interface
} // namespace PresentationManagement
@@ -77,11 +77,16 @@ public:
AesFilter() = default;
virtual ~AesFilter() = default;
// ID getter/setter
int id() const { return m_id; }
void setId(int id) { m_id = id; }
// Content getter/setter für DDS-Daten
QString content() const { return m_content; }
void setContent(const QString& content) { m_content = content; }
private:
int m_id = 0;
QString m_content;
};
@@ -0,0 +1,21 @@
/**
* Export definitions for svcPreCommon
* $Id$
* $HeadURL$
* $Author$
*/
#pragma once
#include <QtCore/qglobal.h>
#ifndef SVCCOMMON_EXPORT
# ifdef BUILD_STATIC_LIBRARIES
# define SVCCOMMON_EXPORT
# else
# if defined(MAKE_SVCCOMMON_LIB)
# define SVCCOMMON_EXPORT Q_DECL_EXPORT
# else
# define SVCCOMMON_EXPORT Q_DECL_IMPORT
# endif
# endif
#endif