BUILD_RTI guards for DDS/Routing modules + logger init fixes
- Lts/DDS: Add BUILD_RTI guards to pacemaker.h, dds_connector.h, generic_fts_* files, generic_base.h, routing_plugin.h - Lts/Services/RoutingServiceNG: Add BUILD_RTI guards to session.h/cpp, connection.h/cpp, data_writer_task.h/cpp - Fix C++23 reference member initialization: use getLogger() instead of getNGLLogger() in constructor initializer lists - Root CMakeLists.txt: Add Lts/DDS to include_directories - Fix export header generation order (GENERATE_EXPORT_HEADER before TARGET_INCLUDE_DIRECTORIES) - Remove auto-generated stub files (external deps collected separately)
This commit is contained in:
1 parent
6588fc7d3f
commit
3cc3129de0
27 files changed
+339
-92
No files matched your search
@@ -6,10 +6,13 @@
|
||||
#include <Lts/Common/ProjectConfig/project_defines.h>
|
||||
#include <QUrl>
|
||||
#include <QtCore/QStringList>
|
||||
#include <ddsconnector_export.h>
|
||||
|
||||
#if BUILD_RTI
|
||||
#include <dds/pub/CoherentSet.hpp>
|
||||
#include <dds/pub/Publisher.hpp>
|
||||
#include <dds/sub/Subscriber.hpp>
|
||||
#include <ddsconnector_export.h>
|
||||
#endif
|
||||
|
||||
class QObject;
|
||||
|
||||
@@ -21,11 +24,6 @@ enum class ConnectionType;
|
||||
}
|
||||
} // namespace DDS
|
||||
|
||||
namespace NGL
|
||||
{
|
||||
class INGLLogger;
|
||||
}
|
||||
|
||||
namespace DDSGeneric
|
||||
{
|
||||
class WaitSetHandler;
|
||||
@@ -37,8 +35,17 @@ namespace DDSConnector
|
||||
class Publisher;
|
||||
class Subscriber;
|
||||
|
||||
#if !BUILD_RTI
|
||||
// Stub types for RTI DDS when BUILD_RTI=OFF
|
||||
namespace dds { namespace domain { class DomainParticipant; } }
|
||||
namespace dds { namespace pub { class Publisher; } }
|
||||
namespace dds { namespace sub { class Subscriber; } }
|
||||
namespace dds { namespace topic { template<typename T> class Filter; } }
|
||||
#endif
|
||||
|
||||
class DDSCONNECTOR_EXPORT DdsConnector
|
||||
{
|
||||
#if BUILD_RTI
|
||||
DdsConnector(int domainId, const dds::domain::DomainParticipant& domainParticipant,
|
||||
IDL::PartitionType defaultPartitionType, int partitionId, int exerciseId,
|
||||
DDS::QosProfile::ConnectionType connectionType, const QUrl& tcpConnectionUrl);
|
||||
@@ -169,6 +176,36 @@ class DDSCONNECTOR_EXPORT DdsConnector
|
||||
IDL::toStdString(m_defaultPartitionType), m_partitionId);
|
||||
return ftc;
|
||||
}
|
||||
#else
|
||||
// Stub constructor and methods when BUILD_RTI=OFF
|
||||
DdsConnector() = default;
|
||||
virtual ~DdsConnector() = default;
|
||||
|
||||
// Stub methods
|
||||
bool init(const QStringList& /*qosFileList*/ = QStringList()) { return false; }
|
||||
void* getDomainParticipant() const { return nullptr; }
|
||||
void setDomainParticipant(void* /*participant*/) {}
|
||||
Publisher* getPublisher() { return nullptr; }
|
||||
void* getDdsPublisher() const { return nullptr; }
|
||||
void setPublisher(Publisher* /*publisher*/) {}
|
||||
void enableBatchedWriter(bool /*bEnable*/) {}
|
||||
Subscriber* getSubscriber() { return nullptr; }
|
||||
void* getDdsSubscriber() const { return nullptr; }
|
||||
void setSubscriber(Subscriber* /*subscriber*/) {}
|
||||
void* getSubscriberListener() { return nullptr; }
|
||||
const void* getWaitSetHandler() const { return nullptr; }
|
||||
int getDomainId() const { return 0; }
|
||||
int getPartitionType() const { return 0; }
|
||||
int getPartitionId() const { return 0; }
|
||||
int getExerciseId() const { return 0; }
|
||||
std::string getDefaultPartition() const { return ""; }
|
||||
QUrl getTcpConnectionUrl() const { return QUrl(); }
|
||||
static std::string getPartitionString(int /*pt*/, int /*partitionId*/ = -1) { return ""; }
|
||||
void initPublisherSubscriber() {}
|
||||
void initPublisher() {}
|
||||
void initSubscriber() {}
|
||||
void initDomainParticipant() {}
|
||||
#endif
|
||||
|
||||
private:
|
||||
NGL::INGLLogger& m_logger;
|
||||
@@ -184,12 +221,15 @@ class DDSCONNECTOR_EXPORT DdsConnector
|
||||
|
||||
QUrl m_tcpConnectionUrl;
|
||||
DDS::QosProfile::ConnectionType m_connectionType;
|
||||
#if BUILD_RTI
|
||||
dds::domain::DomainParticipant m_domainParticipant;
|
||||
#endif
|
||||
DDSConnector::Publisher* m_publisher;
|
||||
DDSConnector::Subscriber* m_subscriber;
|
||||
DDSGeneric::WaitSetHandler* m_wsHandler;
|
||||
};
|
||||
|
||||
#if BUILD_RTI
|
||||
class CoherentSet
|
||||
{
|
||||
public:
|
||||
@@ -201,5 +241,15 @@ class CoherentSet
|
||||
NGL::INGLLogger& m_logger;
|
||||
dds::pub::CoherentSet m_coherentSet;
|
||||
};
|
||||
#else
|
||||
// Stub CoherentSet when BUILD_RTI=OFF
|
||||
class CoherentSet
|
||||
{
|
||||
public:
|
||||
explicit CoherentSet(const std::shared_ptr<DdsConnector>& /*connector*/) {}
|
||||
private:
|
||||
NGL::INGLLogger& m_logger;
|
||||
};
|
||||
#endif
|
||||
|
||||
} // namespace DDSConnector
|
||||
Reference in new issue
Block a user