Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use coordinate type, remove itkTypeMacro and itkStaticConstMacro #675

Merged
merged 4 commits into from
Jan 27, 2025

Conversation

SimonRit
Copy link
Collaborator

@SimonRit SimonRit commented Jan 27, 2025

Supersedes and closes #673 and #674.

hjmjohnson and others added 4 commits January 27, 2025 08:17
Clarifies that the macro does not just disallow copy and assign, but
also move operations. Note that in this context, the term 'move' refers
to both move-construct and move-assign.

With this commit, the old macro name will remain available, as long as
'ITK_FUTURE_LEGACY_REMOVE = OFF' (which is the default).
Use static constexpr directly now that C++11 conformance
is required by all compilers.

:%s/itkStaticConstMacro *( *\([^,]*\),[ \_s]*\([^,]*\),\_s*\([^)]*\)) */static constexpr \2 \1 = \3/ge

'itkStaticConstMacro(name, type, value)' became unconditionally
identical to 'static constexpr type name = value' with ITK commit
aec95193ab00e1322039911e1032da00f3a103b6 "ENH: Update compiler macros (#810)",
maekclena, 7 May 2019.

'itkGetStaticConstMacro(name)' became unconditionally identical to
'(Self::name)' with ITK commit 84e490b81e3f3c2b0edb89ae7b9de53bfc52f2b2
"Removing some outdated compiler conditionals", Hans Johnson, 31 July
2010.

Most 'itkStaticConstMacro' calls were removed by ITK commit 5c14741e1e063a132ea7e7ee69c5bd0a4e49af74
For the sake of code readability, a new 'CoordinateType' alias is added for
each nested 'CoordRepType' alias. The old 'CoordRepType' aliases will still be
available with ITK 6.0, but it is recommended to use 'CoordinateType' instead.
The 'CoordRepType' aliases will be removed when 'ITK_FUTURE_LEGACY_REMOVE' is
enabled. Similarly, 'InputCoordinateType', 'OutputCoordinateType', and
'ImagePointCoordinateType' replace 'InputCoordRepType', 'OutputCoordRepType',
and 'ImagePointCoordRepType', respectively.
The macros, introduced by eb90fb4, are
no longer required as ITK has been released since and we only maintain
compatibility with the latest ITK release and the master's head.

The sed command used for this is
find -type f -exec sed -i  -e '1h;2,$H;$!d;g' -e 's/# *ifdef itkOverrideGetNameOfClassMacro\n\(  itkOverrideGetNameOfClassMacro([ _a-zA-Z0-9]*);\)\n# *else\n  itkTypeMacro([ _a-zA-Z0-9,:\n]*);\n# *endif/\1/g' {} \;
@SimonRit SimonRit merged commit c5e020c into RTKConsortium:master Jan 27, 2025
17 of 19 checks passed
@SimonRit SimonRit mentioned this pull request Jan 27, 2025
@SimonRit SimonRit deleted the use-CoordinateType branch January 27, 2025 15:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants