Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
316f5ad7
Commit
316f5ad7
authored
Jun 04, 2019
by
Sam Jenkins
Browse files
Re #25841 Removed uses of kernel::make_unique
parent
a8a53523
Changes
1000
Hide whitespace changes
Inline
Side-by-side
Too many changes to show.
To preserve performance only
20 of 1000+
files are displayed.
Plain diff
Email patch
Framework/API/inc/MantidAPI/Algorithm.tcc
View file @
316f5ad7
...
...
@@ -43,7 +43,7 @@ template <typename T, const int AllowedIndexTypes, typename... WSPropArgs,
void Algorithm::declareWorkspaceInputProperties(const std::string &propertyName,
const std::string &doc,
WSPropArgs &&... wsPropArgs) {
auto wsProp =
Kernel
::make_unique<WorkspaceProperty<T>>(
auto wsProp =
std
::make_unique<WorkspaceProperty<T>>(
propertyName, "", Kernel::Direction::Input,
std::forward<WSPropArgs>(wsPropArgs)...);
const auto &wsPropRef = *wsProp;
...
...
@@ -51,7 +51,7 @@ void Algorithm::declareWorkspaceInputProperties(const std::string &propertyName,
auto indexTypePropName =
IndexTypeProperty::generatePropertyName(propertyName);
auto indexTypeProp =
Kernel
::make_unique<IndexTypeProperty>(
auto indexTypeProp =
std
::make_unique<IndexTypeProperty>(
indexTypePropName, AllowedIndexTypes);
const auto &indexTypePropRef = *indexTypeProp;
...
...
@@ -60,7 +60,7 @@ void Algorithm::declareWorkspaceInputProperties(const std::string &propertyName,
"performance WorkspaceIndex should be preferred;");
auto indexPropName = IndexProperty::generatePropertyName(propertyName);
declareProperty(
Kernel
::make_unique<IndexProperty>(indexPropName, wsPropRef,
declareProperty(
std
::make_unique<IndexProperty>(indexPropName, wsPropRef,
indexTypePropRef),
"An optional set of spectra that will be processed by the "
"algorithm; If not set, all spectra will be processed; The "
...
...
Framework/API/inc/MantidAPI/LogManager.h
View file @
316f5ad7
...
...
@@ -10,7 +10,7 @@
#include
"MantidAPI/DllConfig.h"
#include
"MantidKernel/PropertyWithValue.h"
#include
"MantidKernel/Statistics.h"
#include
"MantidKernel/make_unique.h"
#include
<memory>
#include
<vector>
...
...
@@ -212,7 +212,7 @@ template <class TYPE>
void
LogManager
::
addProperty
(
const
std
::
string
&
name
,
const
TYPE
&
value
,
bool
overwrite
)
{
addProperty
(
Mantid
::
Kernel
::
make_unique
<
Kernel
::
PropertyWithValue
<
TYPE
>>
(
name
,
value
),
std
::
make_unique
<
Kernel
::
PropertyWithValue
<
TYPE
>>
(
name
,
value
),
overwrite
);
}
...
...
@@ -229,7 +229,7 @@ template <class TYPE>
void
LogManager
::
addProperty
(
const
std
::
string
&
name
,
const
TYPE
&
value
,
const
std
::
string
&
units
,
bool
overwrite
)
{
auto
newProp
=
Mantid
::
Kernel
::
make_unique
<
Kernel
::
PropertyWithValue
<
TYPE
>>
(
name
,
value
);
std
::
make_unique
<
Kernel
::
PropertyWithValue
<
TYPE
>>
(
name
,
value
);
newProp
->
setUnits
(
units
);
addProperty
(
std
::
move
(
newProp
),
overwrite
);
}
...
...
Framework/API/inc/MantidAPI/WorkspaceFactory.h
View file @
316f5ad7
...
...
@@ -25,7 +25,7 @@
#include
"MantidAPI/Workspace_fwd.h"
#include
"MantidKernel/DynamicFactory.h"
#include
"MantidKernel/SingletonHolder.h"
#include
"MantidKernel/make_unique.h"
#include
<boost/make_shared.hpp>
namespace
Mantid
{
...
...
Framework/API/src/Algorithm.cpp
View file @
316f5ad7
...
...
@@ -105,7 +105,7 @@ Algorithm::Algorithm()
m_isAlgStartupLoggingEnabled
(
true
),
m_startChildProgress
(
0.
),
m_endChildProgress
(
0.
),
m_algorithmID
(
this
),
m_singleGroup
(
-
1
),
m_groupsHaveSimilarNames
(
false
),
m_inputWorkspaceHistories
(),
m_communicator
(
Kernel
::
make_unique
<
Parallel
::
Communicator
>
())
{}
m_communicator
(
std
::
make_unique
<
Parallel
::
Communicator
>
())
{}
/// Virtual destructor
Algorithm
::~
Algorithm
()
{}
...
...
@@ -1913,7 +1913,7 @@ const Parallel::Communicator &Algorithm::communicator() const {
/// Sets the (MPI) communicator of the algorithm.
void
Algorithm
::
setCommunicator
(
const
Parallel
::
Communicator
&
communicator
)
{
m_communicator
=
Kernel
::
make_unique
<
Parallel
::
Communicator
>
(
communicator
);
m_communicator
=
std
::
make_unique
<
Parallel
::
Communicator
>
(
communicator
);
}
//---------------------------------------------------------------------------
...
...
Framework/API/src/DetectorSearcher.cpp
View file @
316f5ad7
...
...
@@ -50,7 +50,7 @@ DetectorSearcher::DetectorSearcher(Geometry::Instrument_const_sptr instrument,
if
(
!
m_usingFullRayTrace
)
{
createDetectorCache
();
}
else
{
m_rayTracer
=
Kernel
::
make_unique
<
InstrumentRayTracer
>
(
instrument
);
m_rayTracer
=
std
::
make_unique
<
InstrumentRayTracer
>
(
instrument
);
}
}
...
...
@@ -92,7 +92,7 @@ void DetectorSearcher::createDetectorCache() {
// create KDtree of cached detector Q vectors
m_detectorCacheSearch
=
Kernel
::
make_unique
<
Kernel
::
NearestNeighbours
<
3
>>
(
points
);
std
::
make_unique
<
Kernel
::
NearestNeighbours
<
3
>>
(
points
);
}
/** Find the index of a detector given a vector in Qlab space
...
...
Framework/API/src/ExperimentInfo.cpp
View file @
316f5ad7
...
...
@@ -39,7 +39,7 @@
#include
"MantidKernel/Property.h"
#include
"MantidKernel/StringTokenizer.h"
#include
"MantidKernel/Strings.h"
#include
"MantidKernel/make_unique.h"
#include
"MantidTypes/SpectrumDefinition.h"
...
...
@@ -524,7 +524,7 @@ void ExperimentInfo::setNumberOfDetectorGroups(const size_t count) const {
if
(
m_spectrumInfo
)
m_spectrumDefinitionNeedsUpdate
.
clear
();
m_spectrumDefinitionNeedsUpdate
.
resize
(
count
,
1
);
m_spectrumInfo
=
Kernel
::
make_unique
<
Beamline
::
SpectrumInfo
>
(
count
);
m_spectrumInfo
=
std
::
make_unique
<
Beamline
::
SpectrumInfo
>
(
count
);
m_spectrumInfoWrapper
=
nullptr
;
}
...
...
@@ -1134,7 +1134,7 @@ const SpectrumInfo &ExperimentInfo::spectrumInfo() const {
cacheDefaultDetectorGrouping
();
if
(
!
m_spectrumInfoWrapper
)
{
static_cast
<
void
>
(
detectorInfo
());
m_spectrumInfoWrapper
=
Kernel
::
make_unique
<
SpectrumInfo
>
(
m_spectrumInfoWrapper
=
std
::
make_unique
<
SpectrumInfo
>
(
*
m_spectrumInfo
,
*
this
,
m_parmap
->
mutableDetectorInfo
());
}
}
...
...
@@ -1191,7 +1191,7 @@ ComponentInfo &ExperimentInfo::mutableComponentInfo() {
void
ExperimentInfo
::
setSpectrumDefinitions
(
Kernel
::
cow_ptr
<
std
::
vector
<
SpectrumDefinition
>>
spectrumDefinitions
)
{
if
(
spectrumDefinitions
)
{
m_spectrumInfo
=
Kernel
::
make_unique
<
Beamline
::
SpectrumInfo
>
(
m_spectrumInfo
=
std
::
make_unique
<
Beamline
::
SpectrumInfo
>
(
std
::
move
(
spectrumDefinitions
));
m_spectrumDefinitionNeedsUpdate
.
resize
(
0
);
m_spectrumDefinitionNeedsUpdate
.
resize
(
m_spectrumInfo
->
size
(),
0
);
...
...
Framework/API/src/IFunction.cpp
View file @
316f5ad7
...
...
@@ -30,7 +30,7 @@
#include
"MantidKernel/ProgressBase.h"
#include
"MantidKernel/Strings.h"
#include
"MantidKernel/UnitFactory.h"
#include
"MantidKernel/make_unique.h"
#include
<boost/lexical_cast.hpp>
...
...
@@ -181,7 +181,7 @@ void IFunction::unfix(size_t i) {
*/
void
IFunction
::
tie
(
const
std
::
string
&
parName
,
const
std
::
string
&
expr
,
bool
isDefault
)
{
auto
ti
=
Kernel
::
make_unique
<
ParameterTie
>
(
this
,
parName
,
expr
,
isDefault
);
auto
ti
=
std
::
make_unique
<
ParameterTie
>
(
this
,
parName
,
expr
,
isDefault
);
if
(
!
isDefault
&&
ti
->
isConstant
())
{
setParameter
(
parName
,
ti
->
eval
());
fix
(
getParameterIndex
(
*
ti
));
...
...
Framework/API/src/LogFilterGenerator.cpp
View file @
316f5ad7
...
...
@@ -8,7 +8,7 @@
#include
"MantidAPI/MatrixWorkspace.h"
#include
"MantidKernel/Logger.h"
#include
"MantidKernel/TimeSeriesProperty.h"
#include
"MantidKernel/make_unique.h"
using
Mantid
::
Kernel
::
LogFilter
;
using
Mantid
::
Kernel
::
Property
;
...
...
@@ -56,7 +56,7 @@ LogFilterGenerator::generateFilter(const std::string &logName) const {
// This will throw if the log is not a numeric time series.
// This behaviour is what we want, so don't catch the exception
auto
flt
=
Mantid
::
Kernel
::
make_unique
<
LogFilter
>
(
logData
);
auto
flt
=
std
::
make_unique
<
LogFilter
>
(
logData
);
switch
(
m_filterType
)
{
case
FilterType
::
None
:
...
...
Framework/API/src/LogManager.cpp
View file @
316f5ad7
...
...
@@ -101,16 +101,16 @@ const char *LogManager::PROTON_CHARGE_LOG_NAME = "gd_prtn_chrg";
//----------------------------------------------------------------------
LogManager
::
LogManager
()
:
m_manager
(
Kernel
::
make_unique
<
Kernel
::
PropertyManager
>
()),
:
m_manager
(
std
::
make_unique
<
Kernel
::
PropertyManager
>
()),
m_singleValueCache
(
Kernel
::
make_unique
<
Kernel
::
Cache
<
std
::
make_unique
<
Kernel
::
Cache
<
std
::
pair
<
std
::
string
,
Kernel
::
Math
::
StatisticType
>
,
double
>>
())
{
}
LogManager
::
LogManager
(
const
LogManager
&
other
)
:
m_manager
(
Kernel
::
make_unique
<
Kernel
::
PropertyManager
>
(
*
other
.
m_manager
)),
:
m_manager
(
std
::
make_unique
<
Kernel
::
PropertyManager
>
(
*
other
.
m_manager
)),
m_singleValueCache
(
Kernel
::
make_unique
<
Kernel
::
Cache
<
std
::
make_unique
<
Kernel
::
Cache
<
std
::
pair
<
std
::
string
,
Kernel
::
Math
::
StatisticType
>
,
double
>>
(
*
other
.
m_singleValueCache
))
{}
...
...
@@ -119,7 +119,7 @@ LogManager::~LogManager() = default;
LogManager
&
LogManager
::
operator
=
(
const
LogManager
&
other
)
{
*
m_manager
=
*
other
.
m_manager
;
m_singleValueCache
=
Kernel
::
make_unique
<
Kernel
::
Cache
<
m_singleValueCache
=
std
::
make_unique
<
Kernel
::
Cache
<
std
::
pair
<
std
::
string
,
Kernel
::
Math
::
StatisticType
>
,
double
>>
(
*
other
.
m_singleValueCache
);
return
*
this
;
...
...
Framework/API/src/MDGeometry.cpp
View file @
316f5ad7
...
...
@@ -11,7 +11,7 @@
#include
"MantidGeometry/MDGeometry/MDGeometryXMLBuilder.h"
#include
"MantidGeometry/MDGeometry/MDHistoDimension.h"
#include
"MantidKernel/System.h"
#include
"MantidKernel/make_unique.h"
#include
<Poco/NObserver.h>
#include
<boost/make_shared.hpp>
...
...
@@ -68,7 +68,7 @@ MDGeometry::MDGeometry()
:
m_dimensions
(),
m_originalWorkspaces
(),
m_origin
(),
m_transforms_FromOriginal
(),
m_transforms_ToOriginal
(),
m_notificationHelper
(
Kernel
::
make_unique
<
MDGeometryNotificationHelper
>
(
*
this
)),
std
::
make_unique
<
MDGeometryNotificationHelper
>
(
*
this
)),
m_Wtransf
(
3
,
3
,
true
),
m_basisVectors
()
{}
//----------------------------------------------------------------------------------------------
...
...
@@ -78,7 +78,7 @@ MDGeometry::MDGeometry(const MDGeometry &other)
:
m_dimensions
(),
m_originalWorkspaces
(),
m_origin
(
other
.
m_origin
),
m_transforms_FromOriginal
(),
m_transforms_ToOriginal
(),
m_notificationHelper
(
Kernel
::
make_unique
<
MDGeometryNotificationHelper
>
(
*
this
)),
std
::
make_unique
<
MDGeometryNotificationHelper
>
(
*
this
)),
m_Wtransf
(
other
.
m_Wtransf
),
m_basisVectors
(
other
.
m_basisVectors
)
{
// Perform a deep copy of the dimensions
std
::
vector
<
Mantid
::
Geometry
::
IMDDimension_sptr
>
dimensions
;
...
...
Framework/API/src/MatrixWorkspace.cpp
View file @
316f5ad7
...
...
@@ -27,7 +27,7 @@
#include
"MantidKernel/Strings.h"
#include
"MantidKernel/TimeSeriesProperty.h"
#include
"MantidKernel/VectorHelper.h"
#include
"MantidKernel/make_unique.h"
#include
"MantidParallel/Collectives.h"
#include
"MantidParallel/Communicator.h"
#include
"MantidTypes/SpectrumDefinition.h"
...
...
@@ -111,7 +111,7 @@ MatrixWorkspace::MatrixWorkspace(const MatrixWorkspace &other)
m_YUnitLabel
(
other
.
m_YUnitLabel
),
m_isCommonBinsFlag
(
other
.
m_isCommonBinsFlag
),
m_masks
(
other
.
m_masks
),
m_indexInfoNeedsUpdate
(
false
)
{
m_indexInfo
=
Kernel
::
make_unique
<
Indexing
::
IndexInfo
>
(
other
.
indexInfo
());
m_indexInfo
=
std
::
make_unique
<
Indexing
::
IndexInfo
>
(
other
.
indexInfo
());
m_axes
.
resize
(
other
.
m_axes
.
size
());
for
(
size_t
i
=
0
;
i
<
m_axes
.
size
();
++
i
)
m_axes
[
i
]
=
other
.
m_axes
[
i
]
->
clone
(
this
);
...
...
@@ -169,7 +169,7 @@ void MatrixWorkspace::setIndexInfo(const Indexing::IndexInfo &indexInfo) {
"does not match number of histograms in "
"workspace"
);
m_indexInfo
=
Kernel
::
make_unique
<
Indexing
::
IndexInfo
>
(
indexInfo
);
m_indexInfo
=
std
::
make_unique
<
Indexing
::
IndexInfo
>
(
indexInfo
);
m_indexInfoNeedsUpdate
=
false
;
if
(
!
m_indexInfo
->
spectrumDefinitions
())
buildDefaultSpectrumDefinitions
();
...
...
@@ -273,7 +273,7 @@ void MatrixWorkspace::initialize(const std::size_t &NVectors,
return
;
setNumberOfDetectorGroups
(
NVectors
);
m_indexInfo
=
Kernel
::
make_unique
<
Indexing
::
IndexInfo
>
(
NVectors
);
m_indexInfo
=
std
::
make_unique
<
Indexing
::
IndexInfo
>
(
NVectors
);
// Invoke init() method of the derived class inside a try/catch clause
try
{
...
...
@@ -1464,7 +1464,7 @@ public:
MWDimension
(
const
Axis
*
axis
,
const
std
::
string
&
dimensionId
)
:
m_axis
(
*
axis
),
m_dimensionId
(
dimensionId
),
m_haveEdges
(
dynamic_cast
<
const
BinEdgeAxis
*>
(
&
m_axis
)
!=
nullptr
),
m_frame
(
Kernel
::
make_unique
<
Geometry
::
GeneralFrame
>
(
m_frame
(
std
::
make_unique
<
Geometry
::
GeneralFrame
>
(
m_axis
.
unit
()
->
label
(),
m_axis
.
unit
()
->
label
()))
{}
/// the name of the dimennlsion as can be displayed along the axis
...
...
@@ -1550,7 +1550,7 @@ class MWXDimension : public Mantid::Geometry::IMDDimension {
public:
MWXDimension
(
const
MatrixWorkspace
*
ws
,
const
std
::
string
&
dimensionId
)
:
m_ws
(
ws
),
m_X
(
ws
->
readX
(
0
)),
m_dimensionId
(
dimensionId
),
m_frame
(
Kernel
::
make_unique
<
Geometry
::
GeneralFrame
>
(
m_frame
(
std
::
make_unique
<
Geometry
::
GeneralFrame
>
(
m_ws
->
getAxis
(
0
)
->
unit
()
->
label
(),
m_ws
->
getAxis
(
0
)
->
unit
()
->
label
()))
{}
...
...
@@ -1677,7 +1677,7 @@ std::vector<std::unique_ptr<IMDIterator>> MatrixWorkspace::createIterators(
size_t
end
=
((
i
+
1
)
*
numElements
)
/
numCores
;
if
(
end
>
numElements
)
end
=
numElements
;
out
.
push_back
(
Kernel
::
make_unique
<
MatrixWorkspaceMDIterator
>
(
this
,
function
,
out
.
push_back
(
std
::
make_unique
<
MatrixWorkspaceMDIterator
>
(
this
,
function
,
begin
,
end
));
}
return
out
;
...
...
Framework/API/src/MuParserUtils.cpp
View file @
316f5ad7
...
...
@@ -7,7 +7,7 @@
#include
"MantidAPI/MuParserUtils.h"
#include
"MantidKernel/PhysicalConstants.h"
#include
"MantidKernel/make_unique.h"
#include
<gsl/gsl_sf.h>
using
namespace
Mantid
::
PhysicalConstants
;
...
...
Framework/API/src/Run.cpp
View file @
316f5ad7
...
...
@@ -11,7 +11,7 @@
#include
"MantidKernel/PropertyManager.h"
#include
"MantidKernel/TimeSeriesProperty.h"
#include
"MantidKernel/VectorHelper.h"
#include
"MantidKernel/make_unique.h"
#include
<nexus/NeXusFile.hpp>
...
...
@@ -46,10 +46,10 @@ const char *OUTER_BKG_RADIUS_GROUP = "outer_bkg_radius";
Kernel
::
Logger
g_log
(
"Run"
);
}
// namespace
Run
::
Run
()
:
m_goniometer
(
Kernel
::
make_unique
<
Geometry
::
Goniometer
>
())
{}
Run
::
Run
()
:
m_goniometer
(
std
::
make_unique
<
Geometry
::
Goniometer
>
())
{}
Run
::
Run
(
const
Run
&
other
)
:
LogManager
(
other
),
m_goniometer
(
Kernel
::
make_unique
<
Geometry
::
Goniometer
>
(
:
LogManager
(
other
),
m_goniometer
(
std
::
make_unique
<
Geometry
::
Goniometer
>
(
*
other
.
m_goniometer
)),
m_histoBins
(
other
.
m_histoBins
)
{}
...
...
@@ -58,7 +58,7 @@ Run::~Run() = default;
Run
&
Run
::
operator
=
(
const
Run
&
other
)
{
LogManager
::
operator
=
(
other
);
m_goniometer
=
Kernel
::
make_unique
<
Geometry
::
Goniometer
>
(
*
other
.
m_goniometer
);
m_goniometer
=
std
::
make_unique
<
Geometry
::
Goniometer
>
(
*
other
.
m_goniometer
);
m_histoBins
=
other
.
m_histoBins
;
return
*
this
;
}
...
...
@@ -69,7 +69,7 @@ boost::shared_ptr<Run> Run::clone() {
clone
->
addProperty
(
property
->
clone
());
}
clone
->
m_goniometer
=
Kernel
::
make_unique
<
Geometry
::
Goniometer
>
(
*
this
->
m_goniometer
);
std
::
make_unique
<
Geometry
::
Goniometer
>
(
*
this
->
m_goniometer
);
clone
->
m_histoBins
=
this
->
m_histoBins
;
return
clone
;
}
...
...
@@ -324,7 +324,7 @@ void Run::setGoniometer(const Geometry::Goniometer &goniometer,
const
bool
useLogValues
)
{
auto
old
=
std
::
move
(
m_goniometer
);
try
{
m_goniometer
=
Kernel
::
make_unique
<
Geometry
::
Goniometer
>
(
goniometer
);
m_goniometer
=
std
::
make_unique
<
Geometry
::
Goniometer
>
(
goniometer
);
if
(
useLogValues
)
calculateGoniometerMatrix
();
}
catch
(
std
::
runtime_error
&
)
{
...
...
Framework/API/src/Workspace.cpp
View file @
316f5ad7
...
...
@@ -8,13 +8,13 @@
#include
"MantidAPI/WorkspaceHistory.h"
#include
"MantidKernel/IPropertyManager.h"
#include
"MantidKernel/Memory.h"
#include
"MantidKernel/make_unique.h"
namespace
Mantid
{
namespace
API
{
Workspace
::
Workspace
(
const
Parallel
::
StorageMode
storageMode
)
:
m_history
(
Kernel
::
make_unique
<
WorkspaceHistory
>
()),
:
m_history
(
std
::
make_unique
<
WorkspaceHistory
>
()),
m_storageMode
(
storageMode
)
{}
// Defined as default in source for forward declaration with std::unique_ptr.
...
...
@@ -23,7 +23,7 @@ Workspace::~Workspace() = default;
Workspace
::
Workspace
(
const
Workspace
&
other
)
:
Kernel
::
DataItem
(
other
),
m_title
(
other
.
m_title
),
m_comment
(
other
.
m_comment
),
m_name
(),
m_history
(
Kernel
::
make_unique
<
WorkspaceHistory
>
(
other
.
getHistory
())),
m_history
(
std
::
make_unique
<
WorkspaceHistory
>
(
other
.
getHistory
())),
m_storageMode
(
other
.
m_storageMode
)
{}
/** Set the title of the workspace
...
...
Framework/API/src/WorkspaceNearestNeighbourInfo.cpp
View file @
316f5ad7
...
...
@@ -8,7 +8,7 @@
#include
"MantidAPI/MatrixWorkspace.h"
#include
"MantidAPI/WorkspaceNearestNeighbours.h"
#include
"MantidGeometry/IDetector.h"
#include
"MantidKernel/make_unique.h"
namespace
Mantid
{
namespace
API
{
...
...
@@ -30,7 +30,7 @@ WorkspaceNearestNeighbourInfo::WorkspaceNearestNeighbourInfo(
for
(
size_t
i
=
0
;
i
<
nhist
;
++
i
)
spectrumNumbers
.
emplace_back
(
m_workspace
.
getSpectrum
(
i
).
getSpectrumNo
());
m_nearestNeighbours
=
Kernel
::
make_unique
<
WorkspaceNearestNeighbours
>
(
m_nearestNeighbours
=
std
::
make_unique
<
WorkspaceNearestNeighbours
>
(
nNeighbours
,
workspace
.
spectrumInfo
(),
std
::
move
(
spectrumNumbers
),
ignoreMaskedDetectors
);
}
...
...
Framework/API/test/AlgorithmMPITest.h
View file @
316f5ad7
...
...
@@ -58,7 +58,7 @@ public:
const
std
::
string
summary
()
const
override
{
return
""
;
}
void
init
()
override
{
declareProperty
(
make_unique
<
WorkspaceProperty
<>>
(
"InputWorkspace"
,
""
,
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<>>
(
"InputWorkspace"
,
""
,
Direction
::
Input
));
}
...
...
@@ -74,17 +74,17 @@ public:
const
std
::
string
category
()
const
override
{
return
""
;
}
const
std
::
string
summary
()
const
override
{
return
""
;
}
void
init
()
override
{
declareProperty
(
Kernel
::
make_unique
<
WorkspaceProperty
<>>
(
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<>>
(
"Input1"
,
""
,
Kernel
::
Direction
::
Input
));
declareProperty
(
Kernel
::
make_unique
<
WorkspaceProperty
<>>
(
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<>>
(
"Input2"
,
""
,
Kernel
::
Direction
::
Input
,
PropertyMode
::
Optional
));
declareProperty
(
Kernel
::
make_unique
<
WorkspaceProperty
<>>
(
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<>>
(
"Input3"
,
""
,
Kernel
::
Direction
::
Input
,
PropertyMode
::
Optional
));
declareProperty
(
make_unique
<
WorkspaceProperty
<
Workspace
>>
(
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<
Workspace
>>
(
"InOut1"
,
""
,
Direction
::
InOut
));
declareProperty
(
make_unique
<
WorkspaceProperty
<
Workspace
>>
(
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<
Workspace
>>
(
"InOut2"
,
""
,
Direction
::
InOut
,
PropertyMode
::
Optional
));
declareProperty
(
make_unique
<
WorkspaceProperty
<
Workspace
>>
(
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<
Workspace
>>
(
"InOut3"
,
""
,
Direction
::
InOut
,
PropertyMode
::
Optional
));
}
void
exec
()
override
{}
...
...
@@ -132,10 +132,10 @@ public:
const
std
::
string
category
()
const
override
{
return
""
;
}
const
std
::
string
summary
()
const
override
{
return
""
;
}
void
init
()
override
{
declareProperty
(
Kernel
::
make_unique
<
WorkspaceProperty
<>>
(
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<>>
(
"InputWorkspace"
,
""
,
Kernel
::
Direction
::
Input
,
Kernel
::
make_unique
<
HistogramValidator
>
()));
declareProperty
(
make_unique
<
WorkspaceProperty
<
Workspace
>>
(
std
::
make_unique
<
HistogramValidator
>
()));
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<
Workspace
>>
(
"OutputWorkspace"
,
""
,
Direction
::
Output
));
}
void
exec
()
override
{
...
...
@@ -158,12 +158,12 @@ public:
const
std
::
string
category
()
const
override
{
return
""
;
}
const
std
::
string
summary
()
const
override
{
return
""
;
}
void
init
()
override
{
declareProperty
(
Kernel
::
make_unique
<
WorkspaceProperty
<>>
(
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<>>
(
"InputWorkspace1"
,
""
,
Kernel
::
Direction
::
Input
,
Kernel
::
make_unique
<
HistogramValidator
>
()));
declareProperty
(
Kernel
::
make_unique
<
WorkspaceProperty
<>>
(
std
::
make_unique
<
HistogramValidator
>
()));
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<>>
(
"InputWorkspace2"
,
""
,
Kernel
::
Direction
::
Input
,
Kernel
::
make_unique
<
HistogramValidator
>
()));
std
::
make_unique
<
HistogramValidator
>
()));
}
void
exec
()
override
{
boost
::
shared_ptr
<
MatrixWorkspace
>
ws1
=
getProperty
(
"InputWorkspace1"
);
...
...
@@ -185,13 +185,13 @@ public:
const
std
::
string
category
()
const
override
{
return
""
;
}
const
std
::
string
summary
()
const
override
{
return
""
;
}
void
init
()
override
{
declareProperty
(
Kernel
::
make_unique
<
WorkspaceProperty
<>>
(
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<>>
(
"InputWorkspace1"
,
""
,
Kernel
::
Direction
::
Input
,
Kernel
::
make_unique
<
HistogramValidator
>
()));
declareProperty
(
Kernel
::
make_unique
<
WorkspaceProperty
<>>
(
std
::
make_unique
<
HistogramValidator
>
()));
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<>>
(
"InputWorkspace2"
,
""
,
Kernel
::
Direction
::
Input
,
Kernel
::
make_unique
<
HistogramValidator
>
()));
declareProperty
(
make_unique
<
WorkspaceProperty
<
Workspace
>>
(
std
::
make_unique
<
HistogramValidator
>
()));
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<
Workspace
>>
(
"OutputWorkspace"
,
""
,
Direction
::
Output
));
}
void
exec
()
override
{
...
...
@@ -218,11 +218,11 @@ public:
const
std
::
string
category
()
const
override
{
return
""
;
}
const
std
::
string
summary
()
const
override
{
return
""
;
}
void
init
()
override
{
declareProperty
(
make_unique
<
WorkspaceProperty
<
Workspace
>>
(
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<
Workspace
>>
(
"OutputWorkspace"
,
""
,
Direction
::
Output
));
}
void
exec
()
override
{
auto
ws
=
Kernel
::
make_unique
<
FakeWorkspaceA
>
(
storageMode
);
auto
ws
=
std
::
make_unique
<
FakeWorkspaceA
>
(
storageMode
);
ws
->
initialize
(
1
,
2
,
1
);
setProperty
(
"OutputWorkspace"
,
std
::
move
(
ws
));
}
...
...
@@ -246,16 +246,16 @@ public:
const
std
::
string
category
()
const
override
{
return
""
;
}
const
std
::
string
summary
()
const
override
{
return
""
;
}
void
init
()
override
{
declareProperty
(
Kernel
::
make_unique
<
WorkspaceProperty
<>>
(
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<>>
(
"InputWorkspace"
,
""
,
Kernel
::
Direction
::
Input
,
Kernel
::
make_unique
<
HistogramValidator
>
()));
declareProperty
(
make_unique
<
WorkspaceProperty
<
Workspace
>>
(
std
::
make_unique
<
HistogramValidator
>
()));
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<
Workspace
>>
(
"OutputWorkspace"
,
""
,
Direction
::
Output
));
}
void
exec
()
override
{
boost
::
shared_ptr
<
MatrixWorkspace
>
ws
=
getProperty
(
"InputWorkspace"
);
setProperty
(
"OutputWorkspace"
,
Kernel
::
make_unique
<
FakeWorkspaceA
>
(
storageModeOut
));
std
::
make_unique
<
FakeWorkspaceA
>
(
storageModeOut
));
}
protected:
...
...
Framework/API/test/AlgorithmPropertyTest.h
View file @
316f5ad7
...
...
@@ -52,7 +52,7 @@ private:
const
std
::
string
category
()
const
override
{
return
"Dummy"
;
}
const
std
::
string
summary
()
const
override
{
return
"Test summary"
;
}
void
init
()
override
{
declareProperty
(
make_unique
<
AlgorithmProperty
>
(
"CalculateStep"
));
declareProperty
(
std
::
make_unique
<
AlgorithmProperty
>
(
"CalculateStep"
));
}
void
exec
()
override
{}
};
...
...
@@ -64,7 +64,7 @@ private:
const
std
::
string
category
()
const
override
{
return
"Dummy"
;
}
const
std
::
string
summary
()
const
override
{
return
"Test summary"
;
}
void
init
()
override
{
declareProperty
(
make_unique
<
AlgorithmProperty
>
(
declareProperty
(
std
::
make_unique
<
AlgorithmProperty
>
(
"CalculateStep"
,
boost
::
make_shared
<
AlgorithmHasProperty
>
(
"Output1"
)));
}
...
...
Framework/API/test/AlgorithmTest.h
View file @
316f5ad7
...
...
@@ -46,16 +46,16 @@ public:
const
std
::
string
summary
()
const
override
{
return
"Test summary"
;
}
void
init
()
override
{
declareProperty
(
make_unique
<
WorkspaceProperty
<>>
(
"InputWorkspace1"
,
""
,
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<>>
(
"InputWorkspace1"
,
""
,
Direction
::
Input
));
declareProperty
(
make_unique
<
WorkspaceProperty
<>>
(
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<>>
(
"InputWorkspace2"
,
""
,
Direction
::
Input
,
PropertyMode
::
Optional
));
declareProperty
(
make_unique
<
WorkspaceProperty
<>>
(
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<>>
(
"InOutWorkspace"
,
""
,
Direction
::
InOut
,
PropertyMode
::
Optional
));
declareProperty
(
"Number"
,
0.0
);
declareProperty
(
make_unique
<
WorkspaceProperty
<>>
(
"OutputWorkspace1"
,
""
,
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<>>
(
"OutputWorkspace1"
,
""
,
Direction
::
Output
));
declareProperty
(
make_unique
<
WorkspaceProperty
<>>
(
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<>>
(
"OutputWorkspace2"
,
""
,
Direction
::
Output
,
PropertyMode
::
Optional
));
}
...
...
@@ -90,10 +90,10 @@ public:
const
std
::
string
category
()
const
override
{
return
"Cat;Leopard;Mink"
;
}
const
std
::
string
summary
()
const
override
{
return
"Test summary"
;
}
void
init
()
override
{
declareProperty
(
make_unique
<
WorkspaceProperty
<>>
(
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<>>
(
"NonLockingInputWorkspace"
,
""
,
Direction
::
Input
,
PropertyMode
::
Optional
,
LockMode
::
NoLock
));
declareProperty
(
make_unique
<
WorkspaceProperty
<>>
(
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<>>
(
"NonLockingOutputWorkspace"
,
""
,
Direction
::
Output
,
PropertyMode
::
Optional
,
LockMode
::
NoLock
));
}
...
...
@@ -150,7 +150,7 @@ public:
static
const
std
::
string
FAIL_MSG
;
void
init
()
override
{
declareProperty
(
make_unique
<
WorkspaceProperty
<>>
(
"InputWorkspace"
,
""
,
declareProperty
(
std
::
make_unique
<
WorkspaceProperty
<>>
(
"InputWorkspace"
,
""
,
Direction
::
Input
));
declareProperty
(
"WsNameToFail"
,
""
);
}
...
...
@@ -181,7 +181,7 @@ public:
void
init
()
override
{
declareWorkspaceInputProperties
<
MatrixWorkspace
>
(
"InputWorkspace"
,
""
);
declareProperty
(
Mantid
::
Kernel
::
make_unique
<
WorkspaceProperty
<
MatrixWorkspace
>>
(
std
::
make_unique
<
WorkspaceProperty
<
MatrixWorkspace
>>
(
"InputWorkspace2"
,
""
,
Mantid
::
Kernel
::
Direction
::
Input
));
declareWorkspaceInputProperties
<
MatrixWorkspace
,
IndexType
::
SpectrumNum
|
IndexType
::
WorkspaceIndex
>
(
...
...
@@ -1000,7 +1000,7 @@ public:
IndexingAlgorithm
indexAlg
;
indexAlg
.
init
();
TS_ASSERT_THROWS
(
indexAlg
.
declareProperty
(
make_unique
<
WorkspaceProperty
<
MatrixWorkspace
>>
(
std
::
make_unique
<
WorkspaceProperty
<
MatrixWorkspace
>>
(
"InputWorkspace"
,
""
,
Direction
::
Input
)),
const
std
::
runtime_error
&
);
}
...
...
Framework/API/test/AsynchronousTest.h
View file @
316f5ad7
...
...
@@ -11,7 +11,7 @@
#include
"MantidAPI/Algorithm.h"
#include
"MantidAPI/WorkspaceGroup.h"
#include
"MantidKernel/make_unique.h"
#include
"MantidTestHelpers/FakeObjects.h"
#include
<Poco/ActiveResult.h>
#include
<Poco/NObserver.h>