ITK_DISALLOW_COPY_AND_ASSIGN?

Ready for review: fixing the 43 DISALLOW_COPY macro calls that were overlooked by my script:

http://review.source.kitware.com/#/c/23294/

1 Like

PR submitted to the ITK Software Guide to update the corresponding sections.

3 Likes

Sorry, had to do another follow-up, because my script originally only looked at *.h files:

COMP: Moved ITK_DISALLOW_COPY_AND_ASSIGN calls in *.cxx to public section
http://review.source.kitware.com/#/c/23298/

Please review!

1 Like

@Niels_Dekker the script is impressive indeed!

Is the associated gist up to date with your latest changes for .cpp files?

I got a missing header in linux (g++: 7.3.1 and clang++: 7.00) for std::strlen, solved with:

#include <cstring>

And the compiling command:

g++ Move_DISALLOW_COPY_to_public_section.cpp -lstdc++fs
clang++ Move_DISALLOW_COPY_to_public_section.cpp -lstdc++fs

I have just used it in the ITKIsotropicWavelets RemoteModule and worked flawlessly. I don’t have any class in .cpp files, so, the latest update doesn’t affect the module.

Thanks again!

As a note regarding the ISC fork of the the module, @hjmjohnson you can pull from my master, it includes all the c++11 work you have done in the ISC fork.

2 Likes

@phcerdan I’m glad to hear the script did so well on the ITKIsotropicWavelets RemoteModule as well! And I’m also very glad that you could port it to linux so easily! (I was afraid that the use of std::experimental::filesystem::v1 would break portability.)

I’m sorry I did not update the script anymore. The original script still has at line 261:

if ( (!extension.empty()) && (extension.string() == ".h") && is_regular_file(path))
{
  const auto statisticsPerFile = ProcessFile(path);
    ...

Clearly you should adapt, or remove && (extension.string() == “.h”) if you want to support other source file extensions. Good luck!

1 Like

Cool! I have forked your gist with the header addition and docs for the compiling command. I guess the script should be maintained somewhere more reliably in the long run, but do merge into yours if you think it will work.

Also, added this into that line to work with .cxx files as well. I think it should work!

  if ( (!extension.empty()) &&
       (extension.string() == ".h" || extension.string() == ".cxx") &&
       is_regular_file(path))

The changes can be viewed here:

That script is a great candidate to add to this folder in ITK.

PR to add it: http://review.source.kitware.com/#/c/23305/

2 Likes

Using the script right now to move the macro to the public section. Will come up with the results.

PRs for the remote modules

Note that these need sync between forks:

and

Note that many classes of the LesionSizingToolkit module are missing
the ITK_DISALLOW_COPY_AND_ASSIGN declaration or the pre-macro/legacy copy and assign declarations.

BTW, thanks to the excellent job by @Niels_Dekker and @phcerdan , a bug (wrong class name as argument) could also be fixed for the file itkGPUSmoothingRecursiveYvvGaussianImageFilter.h in the
SmoothingRecursiveYvvGaussianFilter module. Mentioned in the PR.

Some remote may be missing. Please review.

Disclaimer: I have not checked that the modules build without issues.

I’ll take care of updating the commit hashes in the ITK remotes directory once the PRs merged.

4 Likes

PR just submitted for

Remote module commit hash updates topic submitted for review to gerrit:
http://review.source.kitware.com/#/c/23337/

Just for the records and to wrap up, the gerrit topic was merged to ITK master today.

1 Like