Qt6 migration fixes: RTI DDS alias targets, ErrorMessage namespace, DDS header include path

This commit is contained in:
torsten committed 2026-08-27 09:02:26 +02:00
1 parent 8050bca545
commit bb1447c858
18635 files changed
+2466913 -906310

No files matched your search

@@ -22,10 +22,10 @@
#ifdef BUILD_RTI
#include <dds/domain/DomainParticipant.hpp>
#include "INGLLogger.h"
namespace DDSConnector { class DdsConnector; }
namespace DTC { template<typename T> class GenericDTCImpl; }
namespace Core { struct PartitionTime; }
namespace NGL { class INGLLogger; }
namespace DataPluginBase { class Interface; }
class Fetcher;
#else
@@ -137,10 +137,18 @@ class LTSSESSIONDATADDS_EXPORT LtsSessionDataDds : public QObject
QMap<QString, std::shared_ptr<DataPluginBase::Interface>> availableDataPluginInterfaces() const;
void addAvailablaeDataPluginInterfaces(const QMap<QString, std::shared_ptr<DataPluginBase::Interface>>& dataPlugins);
#else
// Stub returns empty map - void* doesn't work well in QMap template
QMap<QString, void*> availableDataPluginInterfaces() const { return QMap<QString, void*>(); }
void addAvailablaeDataPluginInterfaces(const QMap<QString, void*>& /*dataPlugins*/) {}
#endif
// retrieve DTC/FTC inside DataPlugin::createDataInterface() - always available
template<typename T>
bool createTopicClient(std::shared_ptr<T> &member, bool bEnableAll = false, bool bGlobal = false);
template<typename T, typename S>
bool createTopicClient(std::shared_ptr<T> &dtc, std::shared_ptr<S> &ftc, bool bEnableAll = false, bool bGlobal = false);
template<typename T, typename S>
bool getDtc(std::shared_ptr<S> &val) const;
signals:
void partitionTimeChanged(qint64 newPartitionTime);
@@ -161,6 +169,7 @@ class LTSSESSIONDATADDS_EXPORT LtsSessionDataDds : public QObject
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnectorGlobal;
std::shared_ptr<DTC::GenericDTCImpl<Core::PartitionTime>> m_dtcPartitionTime;
NGL::INGLLogger& m_logger;
QMap<QString, std::shared_ptr<DataPluginBase::Interface>> m_dataPluginInterfaces;
#else
// Stub implementation - minimal members
bool initInternal();
@@ -175,3 +184,74 @@ class LTSSESSIONDATADDS_EXPORT LtsSessionDataDds : public QObject
};
} // namespace LtsSession
// Template method implementations - must be in header
#ifdef BUILD_RTI
template<typename T>
bool LtsSession::LtsSessionDataDds::createTopicClient(std::shared_ptr<T> &member, bool bEnableAll, bool bGlobal)
{
member = T::create(bGlobal ? m_ddsConnectorGlobal : m_ddsConnector);
if ( bEnableAll && !member->enableAll())
{
member = nullptr;
if (m_logger.isErrorEnabled())
NGL::LogStreamHelper(m_logger, NGL::LogLevel::Error, __FILE__, __LINE__, Q_FUNC_INFO) << "Error initializing dtc/ftc for service " << T::identifier();
return false;
}
return true;
}
template<typename T, typename S>
bool LtsSession::LtsSessionDataDds::createTopicClient(std::shared_ptr<T> &dtc, std::shared_ptr<S> &ftc, bool bEnableAll, bool bGlobal)
{
dtc = T::create(bGlobal ? m_ddsConnectorGlobal : m_ddsConnector);
ftc = S::create(bGlobal ? m_ddsConnectorGlobal : m_ddsConnector);
if ( (bEnableAll && !dtc->enableAll()) || !ftc->enableAll())
{
dtc = nullptr;
ftc = nullptr;
if (m_logger.isErrorEnabled())
NGL::LogStreamHelper(m_logger, NGL::LogLevel::Error, __FILE__, __LINE__, Q_FUNC_INFO) << "Error initializing dtc/ftc for service " << T::identifier();
return false;
}
return true;
}
template<typename T, typename S>
bool LtsSession::LtsSessionDataDds::getDtc(std::shared_ptr<S> &val) const
{
for (const auto &i : m_dataPluginInterfaces)
{
auto ifc = std::dynamic_pointer_cast<T>(i);
if (ifc)
{
val = ifc->getDtc();
return val != nullptr;
}
}
val.reset();
if (m_logger.isDebugEnabled())
NGL::LogStreamHelper(m_logger, NGL::LogLevel::Debug, __FILE__, __LINE__, Q_FUNC_INFO) << "Trying to load dtc " << typeid(T).name() << " - " << typeid(S).name() << " failed!"
<< ", m_dataPluginInterfaces.size() = " << m_dataPluginInterfaces.size() << " - " << this;
return false;
}
#else
// Stub implementations for non-BUILD_RTI
template<typename T>
bool LtsSession::LtsSessionDataDds::createTopicClient(std::shared_ptr<T> &/*member*/, bool /*bEnableAll*/, bool /*bGlobal*/)
{
return false;
}
template<typename T, typename S>
bool LtsSession::LtsSessionDataDds::createTopicClient(std::shared_ptr<T> &/*dtc*/, std::shared_ptr<S> &/*ftc*/, bool /*bEnableAll*/, bool /*bGlobal*/)
{
return false;
}
template<typename T, typename S>
bool LtsSession::LtsSessionDataDds::getDtc(std::shared_ptr<S> &/*val*/) const
{
return false;
}
#endif // BUILD_RTI