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>
This commit is contained in:
18662 files changed
+4115092
-5435
No files matched your search
@@ -10,209 +10,292 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QtCore/QObject>
|
||||
#include <QtCore/QStringList>
|
||||
#include <QtCore/QUrl>
|
||||
#include <QObject>
|
||||
#include <QMap>
|
||||
#include <QUrl>
|
||||
#include <memory>
|
||||
|
||||
#include <QtCore/QMap>
|
||||
|
||||
// Export macro for shared library
|
||||
#include "ltssessiondatadds_export.h"
|
||||
|
||||
#ifdef BUILD_RTI
|
||||
#include <dds/domain/DomainParticipant.hpp>
|
||||
#include <NGLLogger/INGLLogger.h>
|
||||
#include <DDS/Core/core_dtc_types.h>
|
||||
//#include <NGLLogger/INGLLogger.h>
|
||||
#include <NGLLogger/NGLLoggerBootstrap.h>
|
||||
#include "Core/core.hpp"
|
||||
#include "Core/core_dtc_types.h"
|
||||
#include "Lts/Common/ProjectConfig/project_defines.h"
|
||||
#include <Common/ProjectConfig/project_defines.h>
|
||||
#include <LtsSession/ltssessiondatadds_export.h>
|
||||
|
||||
|
||||
namespace DataPluginBase { class Interface; }
|
||||
namespace DDSConnector { class DdsConnector; }
|
||||
namespace DataPluginBase { class Interface; }
|
||||
namespace GuiPluginBase { class Interface; }
|
||||
#else
|
||||
// Forward declarations for stub types
|
||||
namespace DataPluginBase { class Interface; }
|
||||
namespace GuiPluginBase { class Interface; }
|
||||
#endif
|
||||
|
||||
namespace LtsSession
|
||||
{
|
||||
struct DdsConnectionParams
|
||||
{
|
||||
int domainId = -1;
|
||||
int partitionId = 0;
|
||||
int exerciseId = 0;
|
||||
IDL::PartitionType partitionType = IDL::PartitionType::Any;
|
||||
QUrl tcpConnectionUrl;
|
||||
QStringList qos_file;
|
||||
|
||||
// Stub enum for PartitionType
|
||||
enum class PartitionType {
|
||||
Any = 0,
|
||||
Exercise,
|
||||
Replay,
|
||||
AllExercises,
|
||||
Global,
|
||||
Invalid = -1
|
||||
DdsConnectionParams() = default;
|
||||
explicit DdsConnectionParams(const Core::ReplayPartition &rp)
|
||||
: domainId(rp.domainId())
|
||||
, partitionId(rp.id())
|
||||
, exerciseId(rp.exerciseId())
|
||||
, partitionType(IDL::PartitionType::Replay)
|
||||
{
|
||||
setTcpConnectionUrl(rp.tcpConnectionUrl());
|
||||
}
|
||||
|
||||
bool isValid() const { return domainId >= 0 && partitionType != IDL::PartitionType::Any; }
|
||||
bool hasSameDomainParams(const DdsConnectionParams &o) const
|
||||
{
|
||||
return domainId == o.domainId &&
|
||||
tcpConnectionUrl == o.tcpConnectionUrl;
|
||||
}
|
||||
bool operator==(const DdsConnectionParams &o) const
|
||||
{
|
||||
return domainId == o.domainId &&
|
||||
partitionId == o.partitionId &&
|
||||
exerciseId == o.exerciseId &&
|
||||
qos_file == o.qos_file &&
|
||||
partitionType == o.partitionType &&
|
||||
tcpConnectionUrl == o.tcpConnectionUrl;
|
||||
}
|
||||
bool operator !=(const DdsConnectionParams &o) const
|
||||
{
|
||||
return !operator==(o);
|
||||
}
|
||||
bool operator <(const DdsConnectionParams &o) const
|
||||
{
|
||||
if (domainId != o.domainId)
|
||||
return domainId < o.domainId;
|
||||
if (partitionId != o.partitionId)
|
||||
return partitionId < o.partitionId;
|
||||
if (exerciseId != o.exerciseId)
|
||||
return exerciseId < o.exerciseId;
|
||||
if (qos_file != o.qos_file)
|
||||
return qos_file < o.qos_file;
|
||||
if (partitionType != o.partitionType)
|
||||
return partitionType < o.partitionType;
|
||||
return tcpConnectionUrl.toString() < o.tcpConnectionUrl.toString();
|
||||
}
|
||||
|
||||
void setTcpConnectionUrl(const std::string &url)
|
||||
{
|
||||
tcpConnectionUrl = QUrl::fromUserInput(QString::fromStdString(url));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
class Fetcher;
|
||||
|
||||
struct DdsConnectionParams
|
||||
|
||||
class LTSSESSIONDATADDS_EXPORT LtsSessionDataDds /* FIXME: Name ist irrefuehrend. "LtsSessionData" hat mit "LtsSessionDataDds" nichts zu tun, klingen aber fast identisch. */
|
||||
: public QObject
|
||||
{
|
||||
int domainId = -1;
|
||||
int partitionId = 0;
|
||||
int exerciseId = 0;
|
||||
PartitionType partitionType = PartitionType::Any;
|
||||
QUrl tcpConnectionUrl;
|
||||
QStringList qos_file;
|
||||
Q_OBJECT
|
||||
protected:
|
||||
// only used from LtsSession, no direct instantiation
|
||||
explicit LtsSessionDataDds(QObject *parent = nullptr);
|
||||
public:
|
||||
~LtsSessionDataDds();
|
||||
|
||||
DdsConnectionParams() = default;
|
||||
bool init(const DdsConnectionParams &connParams);
|
||||
bool init(const dds::domain::DomainParticipant &dp,
|
||||
const DdsConnectionParams &connParams);
|
||||
|
||||
bool isValid() const
|
||||
std::shared_ptr<DDSConnector::DdsConnector> ddsConnector() { return m_ddsConnector; }
|
||||
std::shared_ptr<DDSConnector::DdsConnector> ddsConnectorGlobal() { return m_ddsConnectorGlobal; }
|
||||
int domainId() const;
|
||||
int exerciseId() const;
|
||||
int partitionId() const;
|
||||
QStringList qosFile() const;
|
||||
IDL::PartitionType partitionType() const;
|
||||
static QString partitionTypeString(IDL::PartitionType partitionType);
|
||||
bool isExercisePartition() const { return (partitionType() == IDL::PartitionType::Exercise); }
|
||||
bool isReplayPartition() const { return (partitionType() == IDL::PartitionType::Replay); }
|
||||
QString toString() const;
|
||||
Fetcher *fetcher(const QString &yourPluginsName);
|
||||
|
||||
QUrl tcpConnectionUrl() const;
|
||||
DdsConnectionParams connParams() const;
|
||||
|
||||
qint64 partitionTime() const { return m_curMSecSinceEpoch; }
|
||||
|
||||
// retrieve DTC/FTC inside DataPlugin::createDataInterface()
|
||||
template<typename T>
|
||||
bool createTopicClient(std::shared_ptr<T> &member, bool bEnableAll = false, bool bGlobal = false)
|
||||
{
|
||||
member = T::create(bGlobal ? m_ddsConnectorGlobal : m_ddsConnector);
|
||||
if ( bEnableAll && !member->enableAll())
|
||||
{
|
||||
return domainId >= 0 && partitionType != PartitionType::Any;
|
||||
}
|
||||
|
||||
bool operator==(const DdsConnectionParams& o) const
|
||||
{
|
||||
return domainId == o.domainId && partitionId == o.partitionId && exerciseId == o.exerciseId &&
|
||||
qos_file == o.qos_file && partitionType == o.partitionType && tcpConnectionUrl == o.tcpConnectionUrl;
|
||||
}
|
||||
|
||||
bool operator!=(const DdsConnectionParams& o) const
|
||||
{
|
||||
return !operator==(o);
|
||||
}
|
||||
|
||||
bool operator<(const DdsConnectionParams& o) const
|
||||
{
|
||||
if (domainId != o.domainId)
|
||||
return domainId < o.domainId;
|
||||
if (partitionId != o.partitionId)
|
||||
return partitionId < o.partitionId;
|
||||
if (exerciseId != o.exerciseId)
|
||||
return exerciseId < o.exerciseId;
|
||||
if (qos_file != o.qos_file)
|
||||
return qos_file < o.qos_file;
|
||||
if (partitionType != o.partitionType)
|
||||
return partitionType < o.partitionType;
|
||||
return tcpConnectionUrl.toString() < o.tcpConnectionUrl.toString();
|
||||
}
|
||||
|
||||
#ifdef BUILD_RTI
|
||||
bool hasSameDomainParams(const DdsConnectionParams& o) const
|
||||
{
|
||||
return domainId == o.domainId && partitionType == o.partitionType;
|
||||
}
|
||||
#endif
|
||||
};
|
||||
|
||||
// Base class for session DDS data - always compiled, but RTI functionality guarded
|
||||
class LTSSESSIONDATADDS_EXPORT LtsSessionDataDds : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit LtsSessionDataDds(QObject* parent = nullptr);
|
||||
~LtsSessionDataDds();
|
||||
|
||||
// Initialization
|
||||
#ifdef BUILD_RTI
|
||||
bool init(const DdsConnectionParams& connParams);
|
||||
bool init(const dds::domain::DomainParticipant& dp, const DdsConnectionParams& connParams);
|
||||
Fetcher* fetcher(const QString& yourPluginsName);
|
||||
#else
|
||||
virtual bool init(const DdsConnectionParams& connParams);
|
||||
virtual bool init(const void* dp, const DdsConnectionParams& connParams);
|
||||
virtual void* fetcher(const QString& yourPluginsName);
|
||||
#endif
|
||||
|
||||
// Accessors
|
||||
int domainId() const;
|
||||
int exerciseId() const;
|
||||
int partitionId() const;
|
||||
PartitionType partitionType() const;
|
||||
static QString partitionTypeString(PartitionType partitionType);
|
||||
QStringList qosFile() const;
|
||||
QUrl tcpConnectionUrl() const;
|
||||
DdsConnectionParams connParams() const;
|
||||
|
||||
bool isExercisePartition() const { return partitionType() == PartitionType::Exercise; }
|
||||
bool isReplayPartition() const { return partitionType() == PartitionType::Replay; }
|
||||
|
||||
QString toString() const;
|
||||
|
||||
qint64 partitionTime() const { return m_emittedTime; }
|
||||
|
||||
// Data plugin interfaces
|
||||
#ifdef BUILD_RTI
|
||||
QMap<QString, std::shared_ptr<DataPluginBase::Interface>> availableDataPluginInterfaces() const;
|
||||
void addAvailablaeDataPluginInterfaces(const QMap<QString, std::shared_ptr<DataPluginBase::Interface>>& dataPlugins);
|
||||
#else
|
||||
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;
|
||||
|
||||
// Foreign GUI interface retrieval - used by Fetcher helper class
|
||||
template<typename S>
|
||||
bool getForeignGuiInterface(std::shared_ptr<S> &val) const
|
||||
{
|
||||
#ifdef BUILD_RTI
|
||||
for (const auto &i : m_guiPluginInterfaces)
|
||||
{
|
||||
val = std::dynamic_pointer_cast<S>(i);
|
||||
if (val)
|
||||
return true;
|
||||
}
|
||||
val.reset();
|
||||
if (m_logger.isDebugEnabled())
|
||||
DEBUG_LOG(m_logger) << "Cannot find foreign gui ifc " << typeid(S).name() << " in " << toString();
|
||||
#else
|
||||
val.reset();
|
||||
#endif
|
||||
member = nullptr;
|
||||
ERROR_LOG(m_logger) << "Error initializing dtc/ftc for service " << T::identifier();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
signals:
|
||||
void partitionTimeChanged(qint64 newPartitionTime);
|
||||
void partitionTimeChangedInternal();
|
||||
template<typename T, typename S>
|
||||
bool createTopicClient(std::shared_ptr<T> &dtc, std::shared_ptr<S> &ftc, bool bEnableAll = false, bool bGlobal = false)
|
||||
{
|
||||
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;
|
||||
ERROR_LOG(m_logger) << "Error initializing dtc/ftc for service " << T::identifier();
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
protected:
|
||||
#ifdef BUILD_RTI
|
||||
bool initInternal();
|
||||
void onPartitionTimeChangedInternal();
|
||||
static LtsSession::PartitionType toPartitionType(IDL::PartitionType idlType);
|
||||
static IDL::PartitionType toIdlPartitionType(LtsSession::PartitionType type);
|
||||
template<typename T, typename S>
|
||||
bool 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();
|
||||
DEBUG_LOG(m_logger) << "Trying to load dtc " << typeid(T).name() << " - " << typeid(S).name() << " failed!"
|
||||
<< ", m_dataPluginInterfaces.size() = " << m_dataPluginInterfaces.size() << " - " << this;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Member variables - only with RTI
|
||||
int m_exerciseId;
|
||||
qint64 m_emittedTime;
|
||||
qint64 m_curMSecSinceEpoch;
|
||||
bool m_active;
|
||||
Fetcher* m_fetcher;
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnectorGlobal;
|
||||
std::shared_ptr<DTC::PartitionTime> m_dtcPartitionTime;
|
||||
NGL::INGLLogger& m_logger;
|
||||
QMap<QString, std::shared_ptr<DataPluginBase::Interface>> m_dataPluginInterfaces;
|
||||
QMap<QString, std::shared_ptr<GuiPluginBase::Interface>> m_guiPluginInterfaces;
|
||||
QStringList m_qosFileList;
|
||||
#else
|
||||
// Stub implementation - minimal members
|
||||
bool initInternal();
|
||||
void onPartitionTimeChangedInternal();
|
||||
// TODO: merge with getDtc() --> std::is_same, std::enable_if
|
||||
template<typename T, typename S>
|
||||
bool getFtc(std::shared_ptr<S> &val) const
|
||||
{
|
||||
for (const auto &i : m_dataPluginInterfaces)
|
||||
{
|
||||
auto ifc = std::dynamic_pointer_cast<T>(i);
|
||||
if (ifc)
|
||||
{
|
||||
val = ifc->getFtc();
|
||||
return val != nullptr;
|
||||
}
|
||||
}
|
||||
val.reset();
|
||||
DEBUG_LOG(m_logger) << "Trying to load ftc " << typeid(T).name() << " - " << typeid(S).name() << " failed!"
|
||||
<< ", m_dataPluginInterfaces.size() = " << m_dataPluginInterfaces.size() << " - " << this;
|
||||
return false;
|
||||
}
|
||||
|
||||
int m_exerciseId;
|
||||
qint64 m_emittedTime;
|
||||
qint64 m_curMSecSinceEpoch;
|
||||
bool m_active;
|
||||
void* m_fetcher;
|
||||
#endif
|
||||
|
||||
// TODO: merge with getDtc() --> std::is_same, std::enable_if
|
||||
template<typename T, typename S>
|
||||
bool getForeignDataInterface(std::shared_ptr<S> &val) const
|
||||
{
|
||||
//qWarning() << "getForeignDataInterface is deprecated! get the plugin's dtc/ftc directly with getDtc or getFtc!";
|
||||
|
||||
for (const auto &i : m_dataPluginInterfaces)
|
||||
{
|
||||
auto ifc = std::dynamic_pointer_cast<T>(i);
|
||||
if (ifc)
|
||||
{
|
||||
val = ifc->getForeignDataInterface();
|
||||
return val != nullptr;
|
||||
}
|
||||
}
|
||||
val.reset();
|
||||
DEBUG_LOG(m_logger) << "Trying to load foreign data ifc " << typeid(T).name() << " - " << typeid(S).name() << " failed!"
|
||||
<< ", m_dataPluginInterfaces.size() = " << m_dataPluginInterfaces.size() << " - " << this;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/* MWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMW */
|
||||
/* MW DEPRECATED - DO NOT USE IN NEW IMPLEMENTATIONS - CAN BE REMOVED AT ANY TIME WITHOUT WARNING ! MW */
|
||||
/* MWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMW */
|
||||
/* MW */ /* MW */
|
||||
/* MW */ template<typename S> /* MW */
|
||||
/* MW */ bool getForeignDataInterface_NEW(std::shared_ptr<S> &val) const /* MW */
|
||||
/* MW */ { /* MW */
|
||||
/* MW */ //qWarning() << "getForeignDataInterface is deprecated! get the plugin's dtc/ftc directly with getDtc or getFtc!"; /* MW */
|
||||
/* MW */ /* MW */
|
||||
/* MW */ for (const auto &i : m_dataPluginInterfaces) /* MW */
|
||||
/* MW */ { /* MW */
|
||||
/* MW */ val = std::dynamic_pointer_cast<S>(i); /* MW */
|
||||
/* MW */ if (val) /* MW */
|
||||
/* MW */ return true; /* MW */
|
||||
/* MW */ } /* MW */
|
||||
/* MW */ val.reset(); /* MW */
|
||||
/* MW */ DEBUG_LOG(m_logger) << "Trying to load foreign data ifc " << typeid(S).name() << " failed!" /* MW */
|
||||
/* MW */ << ", m_guiPluginInterfaces.size() = " << m_guiPluginInterfaces.size() << " - " << this; /* MW */
|
||||
/* MW */ return false; /* MW */
|
||||
/* MW */ } /* MW */
|
||||
/* MW */ /* MW */
|
||||
/* MWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMWMW */
|
||||
|
||||
|
||||
template<typename S>
|
||||
bool getForeignGuiInterface(std::shared_ptr<S> &val) const
|
||||
{
|
||||
for (const auto &i : m_guiPluginInterfaces)
|
||||
{
|
||||
val = std::dynamic_pointer_cast<S>(i);
|
||||
if (val)
|
||||
return true;
|
||||
}
|
||||
val.reset();
|
||||
DEBUG_LOG(m_logger) << "Cannot find foreign gui ifc " << typeid(S).name() << " in " << toString();
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
template<typename T, typename S>
|
||||
bool interfaceFromGui(std::shared_ptr<S> &val) const // for generic gui interfaces
|
||||
{
|
||||
for (const auto &i : m_guiPluginInterfaces)
|
||||
{
|
||||
val = std::dynamic_pointer_cast<T>(i);
|
||||
if (val)
|
||||
return true;
|
||||
}
|
||||
val.reset();
|
||||
DEBUG_LOG(m_logger) << "Trying to load foreign gui ifc #2 " << typeid(S).name() << " failed!"
|
||||
<< ", m_guiPluginInterfaces.size() = " << m_guiPluginInterfaces.size() << " - " << this;
|
||||
return false;
|
||||
}
|
||||
|
||||
signals:
|
||||
void partitionTimeChanged(qint64 newPartitionTime);
|
||||
void partitionTimeChangedInternal();
|
||||
|
||||
private:
|
||||
void onPartitionTimeChangedInternal();
|
||||
bool initInternal();
|
||||
|
||||
protected:
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
|
||||
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnectorGlobal;
|
||||
int m_exerciseId;
|
||||
std::shared_ptr<DTC::PartitionTime> m_dtcPartitionTime;
|
||||
qint64 m_emittedTime;
|
||||
qint64 m_curMSecSinceEpoch;
|
||||
bool m_active;
|
||||
void setInactive() { m_active = false; }
|
||||
|
||||
|
||||
QMap<QString, std::shared_ptr<DataPluginBase::Interface>> availableDataPluginInterfaces() const;
|
||||
void addAvailablaeDataPluginInterfaces(const QMap<QString, std::shared_ptr<DataPluginBase::Interface>> &dataPlugins);
|
||||
QMap<QString, std::shared_ptr<DataPluginBase::Interface>> m_dataPluginInterfaces;
|
||||
QMap<QString, std::shared_ptr<GuiPluginBase::Interface>> m_guiPluginInterfaces;
|
||||
QMap<QString, std::shared_ptr<GuiPluginBase::Interface>> m_initializeThesePlugins;
|
||||
Fetcher *m_fetcher;
|
||||
QStringList m_qosFileList;
|
||||
NGL::INGLLogger &m_logger;
|
||||
};
|
||||
|
||||
#ifdef BUILD_RTI
|
||||
|
||||
class Fetcher
|
||||
{
|
||||
public:
|
||||
@@ -269,77 +352,5 @@ public:
|
||||
}
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
} // 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
|
||||
Reference in new issue
Block a user