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>
107 lines
3.0 KiB
C++
107 lines
3.0 KiB
C++
#pragma once
|
|
|
|
#include <dds/dds.hpp>
|
|
#include <QtCore/QObject>
|
|
#include <QtCore/QMap>
|
|
#include <QtCore/QReadWriteLock>
|
|
#include <DDS/QosProfile/DDS_DefaultQos.h>
|
|
|
|
#include <rti/core/ListenerBinder.hpp>
|
|
|
|
#ifndef TOPICDISCOVER_EXPORT
|
|
# ifdef BUILD_STATIC_LIBRARIES
|
|
# define TOPICDISCOVER_EXPORT
|
|
# else
|
|
# if defined(MAKE_TOPICDISCOVER_LIB)
|
|
# define TOPICDISCOVER_EXPORT Q_DECL_EXPORT
|
|
# else
|
|
# define TOPICDISCOVER_EXPORT Q_DECL_IMPORT
|
|
# endif
|
|
# endif
|
|
#endif
|
|
|
|
namespace NGL {
|
|
class INGLLogger;
|
|
}
|
|
|
|
class BuiltinAnyListener
|
|
: public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
dds::core::xtypes::StructType structType(const std::string &typeName);
|
|
|
|
protected:
|
|
template <typename S>
|
|
void on_data_available(dds::sub::DataReader<S>& reader);
|
|
|
|
explicit BuiltinAnyListener(QObject *parent = nullptr);
|
|
virtual ~BuiltinAnyListener() = default;
|
|
|
|
signals:
|
|
void topicDescription(const std::string &topicName,
|
|
const std::string &typeName);
|
|
|
|
protected:
|
|
QMap<std::string, dds::core::xtypes::StructType> m_structTypes;
|
|
QReadWriteLock m_safeTypeLock;
|
|
NGL::INGLLogger &m_logger;
|
|
};
|
|
|
|
class BuiltinPublicationListener
|
|
: public BuiltinAnyListener
|
|
, public dds::sub::NoOpDataReaderListener<dds::topic::PublicationBuiltinTopicData>
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit BuiltinPublicationListener(QObject *parent = nullptr);
|
|
virtual ~BuiltinPublicationListener() = default;
|
|
void on_data_available(dds::sub::DataReader<dds::topic::PublicationBuiltinTopicData> &reader) override final;
|
|
};
|
|
|
|
class BuiltinSubscriberListener
|
|
: public BuiltinAnyListener
|
|
, public dds::sub::NoOpDataReaderListener<dds::topic::SubscriptionBuiltinTopicData>
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit BuiltinSubscriberListener(QObject *parent = nullptr);
|
|
virtual ~BuiltinSubscriberListener() = default;
|
|
|
|
void on_data_available(dds::sub::DataReader<dds::topic::SubscriptionBuiltinTopicData> &reader) override final;
|
|
};
|
|
|
|
class TOPICDISCOVER_EXPORT TopicDiscoverer
|
|
: public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit TopicDiscoverer(int domainId, QObject *parent = nullptr);
|
|
virtual ~TopicDiscoverer() = default;
|
|
|
|
void init(DDS::QosProfile::ConnectionType ct, const QUrl &tcpDiscoveryUrl);
|
|
const dds::domain::DomainParticipant &getDomainParticipant() const { return m_domainParticipant; }
|
|
|
|
signals:
|
|
void topicDescription(const std::string &topicName,
|
|
const std::string &typeName,
|
|
const dds::core::xtypes::StructType &type);
|
|
|
|
private slots:
|
|
void onTopicDescription(const std::string &topicName,
|
|
const std::string &typeName);
|
|
|
|
private:
|
|
|
|
int m_domainId;
|
|
dds::domain::DomainParticipant m_domainParticipant;
|
|
rti::core::ListenerBinder< dds::sub::DataReader<dds::topic::PublicationBuiltinTopicData> > m_publisherListener;
|
|
rti::core::ListenerBinder< dds::sub::DataReader<dds::topic::SubscriptionBuiltinTopicData> > m_subscriberListener;
|
|
NGL::INGLLogger &m_logger;
|
|
|
|
};
|