Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Services/AudioVideoManagement/dds_handler.h
T
torstenandCopilot 7a6be7474e Qt6 migration: Fix BUILD_RTI=OFF build errors in TrainingAreaBase
- training_area_telegrams.cpp: Fixed QJsonObject initializer syntax (Qt6 requires {{}} not ({}))
- training_area_telegrams.cpp: Fixed fromJson() methods to access m_* members directly
- training_area_telegrams.cpp: Fixed brace mismatches in multiple toJson() methods
- training_area_telegrams.h: Changed Header struct to public members for consistency
- tx_mixin.cpp: Fixed getEquipmentNumber() template for direct member access
- lts_coordinate.cpp: Added missing #include <iomanip>
- MIGRATION_STATUS.md: Added migration progress tracking document

C++17 constraint enforced due to RTI Connext DDS 7.7.0 incompatibility with C++20+

Build status: BUILD_RTI=OFF successful (0 errors, warnings only)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-08-23 20:49:23 +02:00

109 lines
2.9 KiB
C++
Executable File

/**
* DdsHandler for DDS
* $Id$
* $HeadURL$
* $Author$
* Created by Hanna E. Rathje, SLSE, 2015-09-02
*/
#pragma once
#include "logger.h"
#if BUILD_RTI
#include <dds/domain/DomainParticipant.hpp>
#endif
#include <DDS/Core/topic_lock_master.h>
#include <QtCore/QStringList>
#include <DDS/DDSConnector/dds_connector.h>
#include <DDS/Core/core_dts_types.h>
#include <AudioVideoManagement/avm_dts.h>
#include <AudioVideoManagement/avm_fts.h>
#include <boost/optional.hpp>
namespace Core
{
class Pacemaker;
}
namespace DDSConnector
{
class DdsConnector;
}
namespace ExerciseManagement { namespace Interface
{
class Dtc;
}}
namespace InfrastructureManagement { namespace Interface
{
class Dtc;
}}
namespace AssetManagement { namespace Interface
{
class Dtc;
}}
namespace AudioVideoManagement
{
template<class T>
boost::optional<T> toBoost(const dds::core::optional<T> &optionalValue)
{
if (!optionalValue.is_set())
return boost::none;
return optionalValue.get();
}
class DdsHandler final
{
public:
explicit DdsHandler(int domainId);
~DdsHandler() = default;
bool init(const QStringList &qosFileList = QStringList());
/**
* Must be called *after* init and *after* all DTC-consuming instances
* have been setup. This is to avoid data races that otherwise could arise
* when
* - connecting to the onFooChanged() signal and
* - shortly after that calling foo() to get all received entities so far.
*/
bool enableDtcClients();
#if BUILD_RTI
dds::domain::DomainParticipant domainParticipant() const;
#else
void* domainParticipant() const { return nullptr; }
#endif
std::shared_ptr<Core::Pacemaker> pacemaker() const { return m_pacemaker; }
std::shared_ptr<Core::TopicLockMaster> topicLockMaster() const { return m_topicLockMaster; }
Interface::Dts *dts() const { return m_dts.get(); }
Interface::Fts *fts() const { return m_fts.get(); }
ExerciseManagement::Interface::Dtc *exmDtc() const { return m_exmDtc.get(); }
InfrastructureManagement::Interface::Dtc *ismDtc() const { return m_ismDtc.get(); }
AssetManagement::Interface::Dtc *asmDtc() const { return m_asmDtc.get(); }
std::shared_ptr<DDSConnector::DdsConnector> ddsConnector() const { return m_ddsConnector; }
private:
NGL::INGLLogger &m_logger;
std::shared_ptr<DDSConnector::DdsConnector> m_ddsConnector;
std::shared_ptr<Core::Pacemaker> m_pacemaker;
std::shared_ptr<Core::TopicLockMaster> m_topicLockMaster;
std::shared_ptr<Interface::Dts> m_dts;
std::shared_ptr<ExerciseManagement::Interface::Dtc> m_exmDtc;
std::shared_ptr<InfrastructureManagement::Interface::Dtc> m_ismDtc;
std::shared_ptr<AssetManagement::Interface::Dtc> m_asmDtc;
std::shared_ptr<Interface::Fts> m_fts;
};
}