- 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)
78 lines
1.7 KiB
C++
78 lines
1.7 KiB
C++
|
|
|
|
#pragma once
|
|
|
|
#include "svccoreclient_export.h"
|
|
|
|
#if BUILD_RTI
|
|
#include <DDS/Core/core_dts_types.h>
|
|
#endif
|
|
#include <QtCore/QObject>
|
|
#include <QtCore/QThread>
|
|
|
|
namespace DDSConnector
|
|
{
|
|
class DdsConnector;
|
|
}
|
|
class QTimer;
|
|
|
|
namespace NGL
|
|
{
|
|
class INGLLogger;
|
|
}
|
|
|
|
namespace Core
|
|
{
|
|
class CORE_CLIENT_EXPORT Pacemaker final : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
#if BUILD_RTI
|
|
explicit Pacemaker(const std::shared_ptr<DDSConnector::DdsConnector>& ddsConnector) : Pacemaker(ddsConnector.get())
|
|
{
|
|
}
|
|
|
|
explicit Pacemaker(DDSConnector::DdsConnector* ddsConnector);
|
|
#else
|
|
explicit Pacemaker(void* /*ddsConnector*/) {}
|
|
explicit Pacemaker() {}
|
|
#endif
|
|
~Pacemaker();
|
|
|
|
#if BUILD_RTI
|
|
void startTimer();
|
|
#endif
|
|
|
|
public Q_SLOTS:
|
|
#if BUILD_RTI
|
|
void setNewState(Core::RunningState newState, const QString& errorString = QString());
|
|
void addPort(unsigned short number, Core::PortType portType, const QString& properties = QStringLiteral(""));
|
|
|
|
void publishState();
|
|
#endif
|
|
|
|
private:
|
|
NGL::INGLLogger& m_logger;
|
|
#if BUILD_RTI
|
|
void init(DDSConnector::DdsConnector* ddsConnector);
|
|
void setNewStateInternal(Core::RunningState newState, const QString& errorString = QString());
|
|
void addPortInternal(unsigned short number, Core::PortType portType,
|
|
const QString& properties = QStringLiteral(""));
|
|
#endif
|
|
|
|
private:
|
|
NGL::INGLLogger& m_logger;
|
|
static constexpr const int m_publishTimerDelay = 3000;
|
|
|
|
#if BUILD_RTI
|
|
CurrentRunningState m_state;
|
|
#endif
|
|
QTimer* m_publishTimer = nullptr;
|
|
QThread* m_paceThread = nullptr;
|
|
|
|
#if BUILD_RTI
|
|
DTS::CurrentRunningStateImpl* m_dtsCurrentRunningState;
|
|
#endif
|
|
};
|
|
} // namespace Core
|