- LtsWidgets: Fixed Qt6 API compatibility issues - QWheelEvent::delta() → angleDelta().y() - QStyleOption::init() → initFrom() - QComboBox activated signal signature change - QTextCodec removal (UTF-8 default in Qt6) - Missing widget includes added - LtsWebSocket: Fixed m_logger reference initialization - Added NGLLoggerBootstrap includes - Proper initialization in constructor initializer lists - CMake: Added BUILD_LTSWEBSOCKET option for temporary exclusion - Docker: RTI Connext permanent installation script added - ci/install-rti-in-docker.sh for persistent RTI setup - Removes need for volume mounting RTI into container - BUILD options: FilterManagement, RTI, Codification, Grantlee, LtsWebSocket can be disabled for partial builds during migration Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
69 lines
1.5 KiB
C++
69 lines
1.5 KiB
C++
|
|
|
|
#pragma once
|
|
|
|
#include "client_message.h"
|
|
#include "ltswebsocketcommon_export.h"
|
|
#include "reply_message.h"
|
|
|
|
#include <QJsonParseError>
|
|
#include <QString>
|
|
|
|
namespace NGL
|
|
{
|
|
class INGLLogger;
|
|
}
|
|
|
|
namespace LtsWebSocket
|
|
{
|
|
|
|
class LTSWEBSOCKETCOMMON_EXPORT AbstractClientMessageFactory
|
|
{
|
|
public:
|
|
explicit AbstractClientMessageFactory(NGL::INGLLogger& logger) : m_logger(logger) {}
|
|
|
|
virtual ~AbstractClientMessageFactory() {}
|
|
|
|
QJsonParseError parseMessage(const QString& message);
|
|
|
|
virtual AbstractClientMessage* createMessage(ReplyHandler* client, const QString& message) = 0;
|
|
|
|
protected:
|
|
AbstractClientMessage* checkAttributes(ReplyHandler* client, const QString& message) const;
|
|
AbstractClientMessage* checkResult(ReplyHandler* client, const QString& message,
|
|
AbstractClientMessage* result) const;
|
|
|
|
protected:
|
|
NGL::INGLLogger& m_logger;
|
|
QString m_type;
|
|
int m_typeId;
|
|
QString m_uuid;
|
|
QJsonValue m_data;
|
|
};
|
|
|
|
class PongMessage final : public ReplyMessage
|
|
{
|
|
public:
|
|
static QString strPong()
|
|
{
|
|
return QStringLiteral("pong");
|
|
}
|
|
|
|
static int idPong()
|
|
{
|
|
return 2;
|
|
}
|
|
|
|
explicit PongMessage(const QString& payload) : ReplyMessage(strPong(), idPong(), QString()), m_payload(payload) {}
|
|
|
|
QString toJsonString() const override
|
|
{
|
|
return m_payload.isEmpty() ? strPong() : QStringLiteral("%1 %2").arg(strPong(), m_payload);
|
|
}
|
|
|
|
private:
|
|
QString m_payload;
|
|
};
|
|
|
|
} // namespace LtsWebSocket
|