Clean up the properties code and Tie methods.#1317
Clean up the properties code and Tie methods.#1317agodemar merged 3 commits intoJSBSim-Team:masterfrom
Tie methods.#1317Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1317 +/- ##
==========================================
- Coverage 24.87% 24.85% -0.02%
==========================================
Files 169 169
Lines 19655 19649 -6
==========================================
- Hits 4889 4884 -5
+ Misses 14766 14765 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Pull Request Overview
This PR cleans up property handling code and improves the Tie methods implementation. It removes obsolete code that is no longer needed due to the introduction of SGRawValueMethodsEnum, modernizes C++ usage patterns, and addresses compiler warnings.
- Removes deprecated
PropertyTraitsspecializations andgetValuefunction from property manager - Modernizes C++ patterns using
override,std::enable_if_t, and safer casting with debug assertions - Fixes member initialization order in constructors to prevent compiler warnings
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/simgear/props/props.cxx |
Introduces safer casting with debug checks and fixes constructor member initialization order |
src/models/atmosphere/FGWinds.cpp |
Removes obsolete PropertyTraits specializations |
src/models/FGPropagate.cpp |
Removes obsolete PropertyTraits specializations |
src/input_output/FGPropertyManager.h |
Modernizes raw value classes and Tie method templates |
|
Looks good. The |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
The same with me 😄 BTW does MSVC define the flag jsbsim/.github/workflows/cpp-python-build.yml Line 673 in b005a91 I am concerned that if it does not define NDEBUG then the Windows version of the Python wheels will use dynamic_cast<> instead of static_cast<>.
|
|
Hmm, in terms of
So it doesn't say it supports all macros specified by ISO standards, just 'these', and I don't see Also this post - taglib/taglib#790 mentions Visual Studio not defining And from Stackoverflow: https://stackoverflow.com/questions/2290509/debug-vs-ndebug
Hmm, so this person is claiming it is standardized across compilers, but maybe they've never used MSVC? I see they also complain about the negative logic 😉 Having said all that, I'm fairly familiar with Looking at the JSBSim vcxproj (as opposed to CMAKE) I see
|
|
Hmm, so this details CMAKE's Build Types. https://gist.github.com/MangaD/475b8b413aff7682b803fb007083fb5c Now it only lists compiler flages for GCC/Clang, and interestingly it explicitly defines So we need to figure out what compiler flags are passed to MSVC for CMAKE's |
|
Please note that I have updated the PR and removed 2 templates of the
They are not used anywhere and this will reduce the number of lines in |
|
So are we ready to merge this PR ? I will address the |
Yep, I thought the only outstanding thing was the potential issue with |
Indeed, as you mentioned, we are already setting it up correctly in the MSVC project files and, according to GitHub Copilot, |
|
Yep, setting When I initially took a look I thought I'd be able to fairly easily find a reference to some config file in the CMake installation listing the compiler options per compiler per build type, but wasn't able to at the time until I ran out of steam. I did come across this link which mentions how you can get CMake to output the compiler options. |
|
Green light to merge? |
|
Looks good! Go for it |
|
And for future reference the topic about |

This PR is a follow up of the PRs #1304, #1311 and #1312.
getValueinFGPropertyManager.has well as thePropertyTraitsconversions inFGWinds.cppandFGPropagate.cppare no longer needed due to the introduction of the classSGRawValueMethodsEnum. This PR removes the corresponding code.SGRawValueMethodsEnumandSGRawValueMethodsIndexedEnum:overrideinstead of repeating thevirtualkeyword from the mother class.0bynullptrfor pointers.std::enable_if_t<>instead ofstd::enable_if<>::typeTie<C, T, U>replace thestatic_assertby the templatestd::enable_if_t<>, similarly to what has been done by the PR Add raw values enumeration to fix segfaults #1312dynamic_castin the methodSGPropertyNode::get_intand it siblings to check that no illegal conversions are made, as per Add raw values enumeration to fix segfaults #1312 (comment)dynamic_cast<>is limited to compilations whereNDEBUGis not defined. Otherwisestatic_cast<>is used for performance reasons.SGPropertyNodeconstructors to avoid some warnings from the compilers (with gcc flag-Wreorder).