Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/Lts/Services/ServiceManagement/licence_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

70 lines
1.9 KiB
C++
Executable File

/**
* LicenceHandler class.
* $Id$
* $HeadURL$
* $Author$
* Created by hjl, SLSE, 2016-05-11
*/
#pragma once
#include "licence_donator.h"
#include "dds_handler.h"
#include "logger.h"
#include <QtCore/QObject>
#include <QtCore/QString>
#include <QtCore/QVector>
#include <LtsLicence/lts_licence.h>
namespace ServiceManagement
{
class LicenceHandler final
: public QObject
, public LicenceDonator
, protected Interface::Fts::GetLicenceRequestHandler
, protected Interface::Fts::FreeLicenceRequestHandler
{
Q_OBJECT
public:
explicit LicenceHandler(const std::shared_ptr<DdsHandler> &ddsHandler,
const QString &licenceFile);
~LicenceHandler();
bool init();
bool isServiceLicensed(const QString &licenceName) const;
void onGetLicenceRequest(const rti::core::SampleIdentity &cookie,
const LicenceRequest &request) override;
void onFreeLicenceRequest(const rti::core::SampleIdentity &cookie,
const LicenceRequest &request) override;
bool getLicence(const QString &licenceName) override;
bool freeLicence(const QString &licenceName) override;
private: // Methoden
NGL::INGLLogger &m_logger;
bool readLicenceFile();
Core::FunctionReplyObject getLicenceInternal(const QString &licenceName);
Core::FunctionReplyObject freeLicenceInternal(const QString &licenceName);
bool isLicenceValid(const LtsLicence::Licence &licence) const;
static QString dumpLicenceInformation(const LtsLicence::Licence &licence);
void publishAllData();
void publishData(const LtsLicence::Licence &data);
ServiceManagement::LicenceInformation toDdsData(const LtsLicence::Licence &data);
private: // attributes
std::shared_ptr<DdsHandler> m_ddsHandler;
QString m_xmlFileName;
QVector<LtsLicence::Licence> m_licenceVec;
}; // class LicenceHandler
} // namespace ServiceManagement