Files
qt-migration-legatus/qt6-after/qt6-migrated-legatus/build4/Lts/Services/ProjectDataManagement/pdm_json.h
T
torstenandCopilot 7173785915 Qt6 Migration: Complete migration with DDS/RTI support and build validation
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>
2026-09-15 18:20:26 +00:00

261 lines
13 KiB
C++

/**
* Json <-> DDS conversion routines
* $Id$
* $HeadURL$
* $Author$
* Created by Christian Ehrlicher, SLSE, 2017-11-30
*/
// filename: pdm_json.h
#pragma once
#include "pdm.hpp"
#include "pdm_export.h"
#include <QJsonObject>
#include <QJsonValue>
namespace ProjectDataManagement
{
template<typename T>
struct type{};
template<typename T>
T fromJson(const QJsonValue &val, type<T>);
template<typename T>
T fromJson(const QJsonValue &val)
{
return fromJson(val, type<T>{});
}
// BiteComponentText
PDM_COMMON_EXPORT QJsonObject toJson(const BiteComponentText &element);
template<> PDM_COMMON_EXPORT BiteComponentText fromJson(const QJsonValue &val, type<BiteComponentText>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< BiteComponentText > &element);
template<> PDM_COMMON_EXPORT std::vector<BiteComponentText> fromJson(const QJsonValue &value, type< std::vector< BiteComponentText > >);
// BuildingChargeEffect
PDM_COMMON_EXPORT QJsonObject toJson(const BuildingChargeEffect &element);
template<> PDM_COMMON_EXPORT BuildingChargeEffect fromJson(const QJsonValue &val, type<BuildingChargeEffect>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< BuildingChargeEffect > &element);
template<> PDM_COMMON_EXPORT std::vector<BuildingChargeEffect> fromJson(const QJsonValue &value, type< std::vector< BuildingChargeEffect > >);
// CanComponentString
PDM_COMMON_EXPORT QJsonObject toJson(const CanComponentString &element);
template<> PDM_COMMON_EXPORT CanComponentString fromJson(const QJsonValue &val, type<CanComponentString>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< CanComponentString > &element);
template<> PDM_COMMON_EXPORT std::vector<CanComponentString> fromJson(const QJsonValue &value, type< std::vector< CanComponentString > >);
// ChargeType
PDM_COMMON_EXPORT QJsonObject toJson(const ChargeType &element);
template<> PDM_COMMON_EXPORT ChargeType fromJson(const QJsonValue &val, type<ChargeType>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< ChargeType > &element);
template<> PDM_COMMON_EXPORT std::vector<ChargeType> fromJson(const QJsonValue &value, type< std::vector< ChargeType > >);
// ChargeTypeIgniterTypeIgniterFunction
PDM_COMMON_EXPORT QJsonObject toJson(const ChargeTypeIgniterTypeIgniterFunction &element);
template<> PDM_COMMON_EXPORT ChargeTypeIgniterTypeIgniterFunction fromJson(const QJsonValue &val, type<ChargeTypeIgniterTypeIgniterFunction>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< ChargeTypeIgniterTypeIgniterFunction > &element);
template<> PDM_COMMON_EXPORT std::vector<ChargeTypeIgniterTypeIgniterFunction> fromJson(const QJsonValue &value, type< std::vector< ChargeTypeIgniterTypeIgniterFunction > >);
// ChargeTypeLoadType
PDM_COMMON_EXPORT QJsonObject toJson(const ChargeTypeLoadType &element);
template<> PDM_COMMON_EXPORT ChargeTypeLoadType fromJson(const QJsonValue &val, type<ChargeTypeLoadType>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< ChargeTypeLoadType > &element);
template<> PDM_COMMON_EXPORT std::vector<ChargeTypeLoadType> fromJson(const QJsonValue &value, type< std::vector< ChargeTypeLoadType > >);
// EquipmentSystemEventFilter
PDM_COMMON_EXPORT QJsonObject toJson(const EquipmentSystemEventFilter &element);
template<> PDM_COMMON_EXPORT EquipmentSystemEventFilter fromJson(const QJsonValue &val, type<EquipmentSystemEventFilter>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< EquipmentSystemEventFilter > &element);
template<> PDM_COMMON_EXPORT std::vector<EquipmentSystemEventFilter> fromJson(const QJsonValue &value, type< std::vector< EquipmentSystemEventFilter > >);
// EventFilterHgrMineSearch
PDM_COMMON_EXPORT QJsonObject toJson(const EventFilterHgrMineSearch &element);
template<> PDM_COMMON_EXPORT EventFilterHgrMineSearch fromJson(const QJsonValue &val, type<EventFilterHgrMineSearch>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< EventFilterHgrMineSearch > &element);
template<> PDM_COMMON_EXPORT std::vector<EventFilterHgrMineSearch> fromJson(const QJsonValue &value, type< std::vector< EventFilterHgrMineSearch > >);
// FirePurpose
PDM_COMMON_EXPORT QJsonObject toJson(const FirePurpose &element);
template<> PDM_COMMON_EXPORT FirePurpose fromJson(const QJsonValue &val, type<FirePurpose>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< FirePurpose > &element);
template<> PDM_COMMON_EXPORT std::vector<FirePurpose> fromJson(const QJsonValue &value, type< std::vector< FirePurpose > >);
// GearType
PDM_COMMON_EXPORT QJsonObject toJson(const GearType &element);
template<> PDM_COMMON_EXPORT GearType fromJson(const QJsonValue &val, type<GearType>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< GearType > &element);
template<> PDM_COMMON_EXPORT std::vector<GearType> fromJson(const QJsonValue &value, type< std::vector< GearType > >);
// GearTypeChargeType
PDM_COMMON_EXPORT QJsonObject toJson(const GearTypeChargeType &element);
template<> PDM_COMMON_EXPORT GearTypeChargeType fromJson(const QJsonValue &val, type<GearTypeChargeType>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< GearTypeChargeType > &element);
template<> PDM_COMMON_EXPORT std::vector<GearTypeChargeType> fromJson(const QJsonValue &value, type< std::vector< GearTypeChargeType > >);
// IgniterFunction
PDM_COMMON_EXPORT QJsonObject toJson(const IgniterFunction &element);
template<> PDM_COMMON_EXPORT IgniterFunction fromJson(const QJsonValue &val, type<IgniterFunction>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< IgniterFunction > &element);
template<> PDM_COMMON_EXPORT std::vector<IgniterFunction> fromJson(const QJsonValue &value, type< std::vector< IgniterFunction > >);
// IgniterType
PDM_COMMON_EXPORT QJsonObject toJson(const IgniterType &element);
template<> PDM_COMMON_EXPORT IgniterType fromJson(const QJsonValue &val, type<IgniterType>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< IgniterType > &element);
template<> PDM_COMMON_EXPORT std::vector<IgniterType> fromJson(const QJsonValue &value, type< std::vector< IgniterType > >);
// LanguageHmi
PDM_COMMON_EXPORT QJsonObject toJson(const LanguageHmi &element);
template<> PDM_COMMON_EXPORT LanguageHmi fromJson(const QJsonValue &val, type<LanguageHmi>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< LanguageHmi > &element);
template<> PDM_COMMON_EXPORT std::vector<LanguageHmi> fromJson(const QJsonValue &value, type< std::vector< LanguageHmi > >);
// LanguageXdu
PDM_COMMON_EXPORT QJsonObject toJson(const LanguageXdu &element);
template<> PDM_COMMON_EXPORT LanguageXdu fromJson(const QJsonValue &val, type<LanguageXdu>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< LanguageXdu > &element);
template<> PDM_COMMON_EXPORT std::vector<LanguageXdu> fromJson(const QJsonValue &value, type< std::vector< LanguageXdu > >);
// LoadType
PDM_COMMON_EXPORT QJsonObject toJson(const LoadType &element);
template<> PDM_COMMON_EXPORT LoadType fromJson(const QJsonValue &val, type<LoadType>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< LoadType > &element);
template<> PDM_COMMON_EXPORT std::vector<LoadType> fromJson(const QJsonValue &value, type< std::vector< LoadType > >);
// NuclearPreset
PDM_COMMON_EXPORT QJsonObject toJson(const NuclearPreset &element);
template<> PDM_COMMON_EXPORT NuclearPreset fromJson(const QJsonValue &val, type<NuclearPreset>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< NuclearPreset > &element);
template<> PDM_COMMON_EXPORT std::vector<NuclearPreset> fromJson(const QJsonValue &value, type< std::vector< NuclearPreset > >);
// PdmBase
PDM_COMMON_EXPORT QJsonObject toJson(const PdmBase &element);
template<> PDM_COMMON_EXPORT PdmBase fromJson(const QJsonValue &val, type<PdmBase>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< PdmBase > &element);
template<> PDM_COMMON_EXPORT std::vector<PdmBase> fromJson(const QJsonValue &value, type< std::vector< PdmBase > >);
// PdmBaseName
PDM_COMMON_EXPORT QJsonObject toJson(const PdmBaseName &element);
template<> PDM_COMMON_EXPORT PdmBaseName fromJson(const QJsonValue &val, type<PdmBaseName>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< PdmBaseName > &element);
template<> PDM_COMMON_EXPORT std::vector<PdmBaseName> fromJson(const QJsonValue &value, type< std::vector< PdmBaseName > >);
// RadioGroup
PDM_COMMON_EXPORT QJsonObject toJson(const RadioGroup &element);
template<> PDM_COMMON_EXPORT RadioGroup fromJson(const QJsonValue &val, type<RadioGroup>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< RadioGroup > &element);
template<> PDM_COMMON_EXPORT std::vector<RadioGroup> fromJson(const QJsonValue &value, type< std::vector< RadioGroup > >);
// SanitationInjury
PDM_COMMON_EXPORT QJsonObject toJson(const SanitationInjury &element);
template<> PDM_COMMON_EXPORT SanitationInjury fromJson(const QJsonValue &val, type<SanitationInjury>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< SanitationInjury > &element);
template<> PDM_COMMON_EXPORT std::vector<SanitationInjury> fromJson(const QJsonValue &value, type< std::vector< SanitationInjury > >);
// SanitationInjuryKind
PDM_COMMON_EXPORT QJsonObject toJson(const SanitationInjuryKind &element);
template<> PDM_COMMON_EXPORT SanitationInjuryKind fromJson(const QJsonValue &val, type<SanitationInjuryKind>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< SanitationInjuryKind > &element);
template<> PDM_COMMON_EXPORT std::vector<SanitationInjuryKind> fromJson(const QJsonValue &value, type< std::vector< SanitationInjuryKind > >);
// SanitationInjuryPlace1
PDM_COMMON_EXPORT QJsonObject toJson(const SanitationInjuryPlace1 &element);
template<> PDM_COMMON_EXPORT SanitationInjuryPlace1 fromJson(const QJsonValue &val, type<SanitationInjuryPlace1>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< SanitationInjuryPlace1 > &element);
template<> PDM_COMMON_EXPORT std::vector<SanitationInjuryPlace1> fromJson(const QJsonValue &value, type< std::vector< SanitationInjuryPlace1 > >);
// SanitationInjuryPlace2
PDM_COMMON_EXPORT QJsonObject toJson(const SanitationInjuryPlace2 &element);
template<> PDM_COMMON_EXPORT SanitationInjuryPlace2 fromJson(const QJsonValue &val, type<SanitationInjuryPlace2>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< SanitationInjuryPlace2 > &element);
template<> PDM_COMMON_EXPORT std::vector<SanitationInjuryPlace2> fromJson(const QJsonValue &value, type< std::vector< SanitationInjuryPlace2 > >);
// SanitationMaterial
PDM_COMMON_EXPORT QJsonObject toJson(const SanitationMaterial &element);
template<> PDM_COMMON_EXPORT SanitationMaterial fromJson(const QJsonValue &val, type<SanitationMaterial>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< SanitationMaterial > &element);
template<> PDM_COMMON_EXPORT std::vector<SanitationMaterial> fromJson(const QJsonValue &value, type< std::vector< SanitationMaterial > >);
// SanitationProcedure
PDM_COMMON_EXPORT QJsonObject toJson(const SanitationProcedure &element);
template<> PDM_COMMON_EXPORT SanitationProcedure fromJson(const QJsonValue &val, type<SanitationProcedure>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< SanitationProcedure > &element);
template<> PDM_COMMON_EXPORT std::vector<SanitationProcedure> fromJson(const QJsonValue &value, type< std::vector< SanitationProcedure > >);
// TargetSubType
PDM_COMMON_EXPORT QJsonObject toJson(const TargetSubType &element);
template<> PDM_COMMON_EXPORT TargetSubType fromJson(const QJsonValue &val, type<TargetSubType>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< TargetSubType > &element);
template<> PDM_COMMON_EXPORT std::vector<TargetSubType> fromJson(const QJsonValue &value, type< std::vector< TargetSubType > >);
// TargetType
PDM_COMMON_EXPORT QJsonObject toJson(const TargetType &element);
template<> PDM_COMMON_EXPORT TargetType fromJson(const QJsonValue &val, type<TargetType>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< TargetType > &element);
template<> PDM_COMMON_EXPORT std::vector<TargetType> fromJson(const QJsonValue &value, type< std::vector< TargetType > >);
// TargetTypeTargetSubType
PDM_COMMON_EXPORT QJsonObject toJson(const TargetTypeTargetSubType &element);
template<> PDM_COMMON_EXPORT TargetTypeTargetSubType fromJson(const QJsonValue &val, type<TargetTypeTargetSubType>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< TargetTypeTargetSubType > &element);
template<> PDM_COMMON_EXPORT std::vector<TargetTypeTargetSubType> fromJson(const QJsonValue &value, type< std::vector< TargetTypeTargetSubType > >);
// TranslationBlob
PDM_COMMON_EXPORT QJsonObject toJson(const TranslationBlob &element);
template<> PDM_COMMON_EXPORT TranslationBlob fromJson(const QJsonValue &val, type<TranslationBlob>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< TranslationBlob > &element);
template<> PDM_COMMON_EXPORT std::vector<TranslationBlob> fromJson(const QJsonValue &value, type< std::vector< TranslationBlob > >);
// VulnerabilityKind
PDM_COMMON_EXPORT QJsonObject toJson(const VulnerabilityKind &element);
template<> PDM_COMMON_EXPORT VulnerabilityKind fromJson(const QJsonValue &val, type<VulnerabilityKind>);
PDM_COMMON_EXPORT QJsonValue toJson(const std::vector< VulnerabilityKind > &element);
template<> PDM_COMMON_EXPORT std::vector<VulnerabilityKind> fromJson(const QJsonValue &value, type< std::vector< VulnerabilityKind > >);
//
// extensions to support sequence of seqence of Non-POD :
//
} // namespace ProjectDataManagement