Ticket #2843 (closed: fixed)

Opened 9 years ago

Last modified 5 years ago

Remove auto_ptr from MDAlgorithms

Reported by: Owen Arnold Owned by: Owen Arnold
Priority: minor Milestone: Iteration 29
Component: VATES Keywords:
Cc: Blocked By:
Blocking: Tester: Janik Zikovsky

Description

C++0x compatibility. Switch out auto_ptr types for more suitable smart_ptr types in MDAlgorithms.

Change History

comment:1 Changed 9 years ago by Owen Arnold

  • Status changed from new to accepted

comment:2 Changed 9 years ago by Owen Arnold

(In [10947]) re #2843 implemented plus some other minor fixes to get tests passing.

comment:3 Changed 9 years ago by Owen Arnold

(In [10948]) re #2843 Should fix failing test buid on windows. Cannot have a using declaration to a nested type with VS compiler.

comment:4 Changed 9 years ago by Owen Arnold

(In [10949]) re #2843 Should fix failing test buid on windows. Fixed scope resolution.

comment:5 Changed 9 years ago by Owen Arnold

  • Status changed from accepted to verify
  • Resolution set to fixed

comment:6 Changed 9 years ago by Janik Zikovsky

  • Status changed from verify to verifying
  • Tester set to Janik Zikovsky

comment:7 Changed 9 years ago by Janik Zikovsky

  • Status changed from verifying to verify
  • Tester Janik Zikovsky deleted

comment:8 Changed 9 years ago by Michael Whitty

  • Status changed from verify to verifying
  • Tester set to Michael Whitty

comment:9 Changed 9 years ago by Michael Whitty

  • Status changed from verifying to reopened
  • Resolution fixed deleted

auto_ptr still used in several places in MDAlgorithms.

Find all "auto_ptr", Subfolders, Find Results 1, "C:\MANTID\Code\Mantid\Framework\MDAlgorithms", "*.cpp; *.h"
  C:\MANTID\Code\Mantid\Framework\MDAlgorithms\inc\MantidMDAlgorithms\InvalidParameterParser.h(62):            std::auto_ptr<ImplicitFunctionParameterParser> m_successor;
  C:\MANTID\Code\Mantid\Framework\MDAlgorithms\src\CenterpieceRebinning.cpp(140):   std::auto_ptr<IDynamicRebinning> pRebin = std::auto_ptr<IDynamicRebinning>(new CpRebinningNx3(inputWS,pSlicing,outputWS,keep_pixels));
  C:\MANTID\Code\Mantid\Framework\MDAlgorithms\src\CenterpieceRebinning.cpp(141):  //  std::auto_ptr<IDynamicRebinning> pRebin = std::auto_ptr<IDynamicRebinning>(new CpRebinning4x3StructHR(inputWS,pSlicing,outputWS));
  C:\MANTID\Code\Mantid\Framework\MDAlgorithms\src\CenterpieceRebinning.cpp(153):    std::auto_ptr<API::Progress> pProgress;
  C:\MANTID\Code\Mantid\Framework\MDAlgorithms\src\CenterpieceRebinning.cpp(155):      pProgress = std::auto_ptr<API::Progress>(new Progress(this,0,1,occurance));
  C:\MANTID\Code\Mantid\Framework\MDAlgorithms\src\Load_MDWorkspace.cpp(60):   std::auto_ptr<IMD_FileFormat> pFileReader;
  C:\MANTID\Code\Mantid\Framework\MDAlgorithms\src\Load_MDWorkspace.cpp(75):   std::auto_ptr<MDGeometryBasis> pBasis = std::auto_ptr<MDGeometryBasis>(new Geometry::MDGeometryBasis());
  C:\MANTID\Code\Mantid\Framework\MDAlgorithms\test\CompositeBuilderTest.h(55):        void addParameter(std::auto_ptr<Mantid::API::ImplicitFunctionParameter> parameter)
  C:\MANTID\Code\Mantid\Framework\MDAlgorithms\test\CPR_preselectCellsTest.h(45):    std::auto_ptr<Geometry::MDGeometryDescription> pTargDescr;
  C:\MANTID\Code\Mantid\Framework\MDAlgorithms\test\CPR_preselectCellsTest.h(47):    std::auto_ptr<DynamicCPRRt>    pRebin;
  C:\MANTID\Code\Mantid\Framework\MDAlgorithms\test\CPR_preselectCellsTest.h(59):         std::auto_ptr<MDTestWorkspace> tw = std::auto_ptr<MDTestWorkspace>(new MDTestWorkspace());
  C:\MANTID\Code\Mantid\Framework\MDAlgorithms\test\CPR_preselectCellsTest.h(67):             std::auto_ptr<Geometry::MDGeometryDescription>(new Geometry::MDGeometryDescription(pOrigin->get_const_MDGeometry())));
  C:\MANTID\Code\Mantid\Framework\MDAlgorithms\test\CPR_preselectCellsTest.h(79):             std::auto_ptr<DynamicCPRRt>(new DynamicCPRRt(pOrigin,pTargDescr.get(),pTarget)));
  C:\MANTID\Code\Mantid\Framework\MDAlgorithms\test\CPRebinKeepPixTest.h(33):      std::auto_ptr<MDTestWorkspace> tw = std::auto_ptr<MDTestWorkspace>(new MDTestWorkspace());
  C:\MANTID\Code\Mantid\Framework\MDAlgorithms\test\NormalParameterParserTest.h(77):        std::auto_ptr<NormalParameter> nparam = std::auto_ptr<NormalParameter>(pNormalParam);
  C:\MANTID\Code\Mantid\Framework\MDAlgorithms\test\OriginParameterParserTest.h(73):        std::auto_ptr<OriginParameter> oparam = std::auto_ptr<OriginParameter>(pOriginParam);
  C:\MANTID\Code\Mantid\Framework\MDAlgorithms\test\PerpendicularParameterParserTest.h(77):        std::auto_ptr<PerpendicularParameter> nparam = std::auto_ptr<PerpendicularParameter>(pNormalParam);
  C:\MANTID\Code\Mantid\Framework\MDAlgorithms\test\testCPComponents.h(21):       std::auto_ptr<MockMDWorkspace> pOrigin;
  C:\MANTID\Code\Mantid\Framework\MDAlgorithms\test\testCPrebinning.h(22):	//	 std::auto_ptr<IMD_FileFormat> pFile = MD_FileFormatFactory::getFileReader("../../../../../Test/VATES/fe_demo.sqw",old_4DMatlabReader);
  C:\MANTID\Code\Mantid\Framework\MDAlgorithms\test\UpParameterParserTest.h(77):        std::auto_ptr<UpParameter> nparam = std::auto_ptr<UpParameter>(pNormalParam);
  Matching lines: 20    Matching files: 12    Total files searched: 125

Above is quick search result. Can most likely be delayed until next iteration unless for some reason C++0x compatibility is important to you?

comment:10 Changed 9 years ago by Nick Draper

  • Milestone changed from Iteration 28 to Iteration 29

comment:11 Changed 9 years ago by Owen Arnold

(In [11281]) re #2843. More instances replaced/removed.

comment:12 Changed 9 years ago by Owen Arnold

(In [11283]) re #2843. More instances replaced/removed. Offending and active instances in MDAlgorithms removed/replaced. Note that there seem to be tests in MDAlgorithms, which are part of the SVN base-line, but are not included in the CMakeLists.txt test section. Some of these still contain auto_ptr. These instances are being ignored.

comment:13 Changed 9 years ago by Owen Arnold

  • Status changed from reopened to accepted

comment:14 Changed 9 years ago by Owen Arnold

  • Status changed from accepted to verify
  • Resolution set to fixed

comment:15 Changed 9 years ago by Janik Zikovsky

  • Status changed from verify to verifying
  • Tester changed from Michael Whitty to Janik Zikovsky

comment:16 Changed 9 years ago by Janik Zikovsky

  • Status changed from verifying to closed

There are still some left (outside of tests) but that doesn't seem like such a big issue for now. Passing.

comment:17 Changed 5 years ago by Stuart Campbell

This ticket has been transferred to github issue 3690

Note: See TracTickets for help on using tickets.