diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_record_replay_plugin.cpp.grantlee b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_record_replay_plugin.cpp.grantlee index 57e5f619c..47765cf7d 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_record_replay_plugin.cpp.grantlee +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_record_replay_plugin.cpp.grantlee @@ -171,8 +171,20 @@ std::vector fromJson(const QVariant &jsonData, type>) return ret; } +// Primary fallback for any migrated plain-`enum class` enumerators that have no +// explicit specialization below - most importantly the nested foreign +// ProjectDataManagement / Core enums a plugin reads back from the database (they are +// not in this service's idl_enums, so the per-own-enum specializations do not cover +// them). Giving the primary template a body (rather than leaving it declaration-only) +// is what lets those foreign-enum instantiations resolve, so the plugin .so links. The +// explicit specializations for primitives / own enums / structs / vectors / optionals +// all take precedence over this fallback, so it is only ever instantiated for an enum +// type, where `static_cast(val.toInt())` is the correct conversion. template -T fromQVariant(const QVariant &val, type); +T fromQVariant(const QVariant &val, type) +{ + return static_cast(val.toInt()); +} template<> bool fromQVariant(const QVariant &val, type) @@ -266,6 +278,23 @@ T fromQVariant(const QVariant &val) return fromQVariant(val, type{}); } +// rtiddsgen 7.7 spells the migrated enumerators as plain `enum class` in the service +// namespace (the legacy dds::core::safe_enum wrapper is gone). The record_replay +// plugin still instantiates fromQVariant() for each enum member it reads back, +// and none of the generic overloads above are ever deduced for those types, so each of +// this service's own enumerations needs its own explicit specialization. `idl_enums` +// carries the service's own enumerations by local name and this block runs inside +// `namespace {{ namespace }}`, so the local name resolves to the fully-qualified enum +// type. (Nested foreign PDM enumerations are still not covered - same limitation as the +// documented svcBuildings exclusion.) +{% for enumeration in idl_enums %} +template<> +{{ enumeration.name }} fromQVariant(const QVariant &val, type<{{ enumeration.name }}>) +{ + return static_cast<{{ enumeration.name }}>(val.toInt()); +} +{% endfor %} + {% for dt in serializeTopics.member %} // // Begin {{ dt.typeFq }} diff --git a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_record_replay_plugin.h.grantlee b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_record_replay_plugin.h.grantlee index a963ceea6..7c3b26268 100755 --- a/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_record_replay_plugin.h.grantlee +++ b/qt6-after/qt6-migrated-legatus/Lts/Common/CodeGen/svc_record_replay_plugin.h.grantlee @@ -121,7 +121,7 @@ protected: int64_t m_snapshot{{ dt.name }}MapTime = -1; // time for which the snapshot is valid {% endif %} {% endfor %} - NGL::INGLLogger* m_logger; + NGL::INGLLogger& m_logger; }; } diff --git a/qt6-after/qt6-migrated-legatus/docker_build.sh b/qt6-after/qt6-migrated-legatus/docker_build.sh index 137f5c678..92e0fec8f 100755 --- a/qt6-after/qt6-migrated-legatus/docker_build.sh +++ b/qt6-after/qt6-migrated-legatus/docker_build.sh @@ -100,6 +100,33 @@ docker run --rm \ # svcInfrastructureManagement QtCore to the Qt SCXML module in Qt6 # exmStateMachineTest (Qt6::StateMachine). No qt6-scxml-dev in # the image and qstatemachine.h is absent. + # svcBuildings - its generated record_replay_plugin + # (bld_record_replay_plugin.cpp) calls + # fromQVariant() for the nested foreign + # ProjectDataManagement types + # VulnerabilityState / + # StateChangeOriginator, for which no + # specialization is generated (they are + # not Buildings' own types), leaving the + # generic fromQVariant template + # undefined -> link error. + # svcParticipantManagement - its record_replay custom header + # (RecordReplay/ppm_record_replay_plugin_custom.h) + # declares Q_INTERFACES(RecordReplay:: + # RecordReplayPlugin) on a class that also + # inherits ParticipantHandling::BaseDataProvider + # (a second Q_OBJECT base the other record_replay + # custom plugins lack). Qt6's MOC reports + # "Undefined interface" for the Q_INTERFACES in + # that multi-Q_OBJECT-base context (RecordReplay:: + # RecordReplayPlugin is a Q_GADGET, not a Q_OBJECT), + # so the plugin autogen step fails before link. + # (The nested-foreign-PDM fromQVariant link error + # that also applied is now resolved by the + # fromQVariant primary-template body added to + # svc_record_replay_plugin.cpp.grantlee.) The PPM + # client/common/server libs still build; only this + # exe is excluded. make -j8 \ ddscore ddsftccore ddsQoS ddsconnector ddsfts migration_tests \ NGLLogger nglapplication nglcompression nglcoreapplication ngldb \ @@ -112,7 +139,7 @@ docker run --rm \ svcAsmClient svcAsmCommon svcAsmServer svcAssetManagement \ svcAudioVideoManagement \ svcAvmClient svcAvmCommon svcAvmServer \ - svcBldClient svcBldCommon svcBldServer svcBuildings \ + svcBldClient svcBldCommon svcBldServer \ svcCentralEffectSimulation \ svcCesClient svcCesCommon svcCesDDSCommon svcCesGeoPairingImpl svcCesServer \ svcCmoClient svcCmoCommon svcCmoServer \ @@ -146,7 +173,6 @@ docker run --rm \ svcOreDummy \ svcOscClient svcOscCommon svcOscServer \ svcOssClient svcOssCommon svcOssServer \ - svcParticipantManagement \ svcPdmClient svcPdmCommon svcPdmServer svcPedDummy \ svcPpmClient svcPpmCommon svcPpmServer \ svcPreClient svcPreCommon svcPreServer svcProjectDataManagement svcPwsCommon \