Commit bdce1bfe authored by Tom Perkins's avatar Tom Perkins
Browse files

Merge branch 'master' into 15289_declareProperty_uniqueptr

re #15289

# Conflicts:
#	Framework/DataHandling/src/GroupDetectors.cpp
#	Framework/DataHandling/src/GroupDetectors2.cpp
#	Framework/DataHandling/src/LoadMuonNexus.cpp
#	Framework/DataHandling/src/LoadRaw3.cpp
#	Framework/DataHandling/src/LoadRawBin0.cpp
#	Framework/DataHandling/src/LoadTOFRawNexus.cpp
#	Framework/DataHandling/src/MaskDetectors.cpp
#	Framework/LiveData/src/ISISHistoDataListener.cpp
#	Framework/LiveData/src/StartLiveData.cpp
#	Framework/LiveData/test/ISISHistoDataListenerTest.h
parents b3453be3 2d597642
......@@ -262,11 +262,11 @@ if ( ENABLE_CPACK )
if( "${UNIX_CODENAME}" MATCHES "Santiago" )
# On RHEL6 we have to use an updated qscintilla to fix an auto complete bug
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES} qscintilla >= 2.4.6, boost148" )
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES} qscintilla >= 2.4.6, boost157" )
# On RHEL6 we are using SCL packages for Qt
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES},scl-utils,mantidlibs34,mantidlibs34-runtime,mantidlibs34-qt,mantidlibs34-qt-x11,mantidlibs34-qt-webkit,mantidlibs34-qwt5-qt4" )
else()
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES} qscintilla,qwt5-qt4,python-matplotlib-qt4,boost >= 1.48.0" )
set ( CPACK_RPM_PACKAGE_REQUIRES "${CPACK_RPM_PACKAGE_REQUIRES} qscintilla,qwt5-qt4,python-matplotlib-qt4,boost >= 1.53.0" )
endif()
# Add software collections for RHEL
......
......@@ -5,7 +5,7 @@
// Includes
//----------------------------------------------------------------------
#include <vector>
#include <set>
#include <unordered_set>
#include <sstream>
#include "MantidAPI/DllConfig.h"
#include "MantidKernel/DynamicFactory.h"
......@@ -57,7 +57,7 @@ class Algorithm;
File change history is stored at: <https://github.com/mantidproject/mantid>
*/
class MANTID_API_DLL AlgorithmFactoryImpl
class MANTID_API_DLL AlgorithmFactoryImpl final
: public Kernel::DynamicFactory<Algorithm> {
public:
// Unhide the base class version (to satisfy the intel compiler)
......@@ -126,7 +126,8 @@ public:
int highestVersion(const std::string &algorithmName) const;
/// Get the algorithm categories
const std::set<std::string> getCategories(bool includeHidden = false) const;
const std::unordered_set<std::string>
getCategories(bool includeHidden = false) const;
/// Get the algorithm categories
const std::map<std::string, bool> getCategoriesWithState() const;
......@@ -162,7 +163,7 @@ private:
/// creates an algorithm name convolved from an name and version
std::string createName(const std::string &, const int &) const;
/// fills a set with the hidden categories
void fillHiddenCategories(std::set<std::string> *categorySet) const;
void fillHiddenCategories(std::unordered_set<std::string> *categorySet) const;
/// A typedef for the map of algorithm versions
typedef std::map<std::string, int> VersionMap;
......
......@@ -60,7 +60,7 @@ typedef std::set<AlgorithmHistory_sptr,
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class MANTID_API_DLL AlgorithmHistory {
class MANTID_API_DLL AlgorithmHistory final {
public:
/// History container
......
......@@ -4,13 +4,15 @@
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include <deque>
#include <string>
#include <Poco/NotificationCenter.h>
#include "MantidAPI/DllConfig.h"
#include "MantidKernel/SingletonHolder.h"
#include "MantidAPI/Algorithm.h"
#include <deque>
#include <mutex>
#include <string>
namespace Mantid {
namespace API {
......@@ -97,7 +99,7 @@ private:
std::deque<IAlgorithm_sptr>
m_managed_algs; ///< pointers to managed algorithms [policy???]
/// Mutex for modifying/accessing the m_managed_algs member.
mutable Kernel::Mutex m_managedMutex;
mutable std::mutex m_managedMutex;
};
/// Forward declaration of a specialisation of SingletonHolder for
......
......@@ -56,7 +56,7 @@ class WorkspaceGroup;
File change history is stored at: <https://github.com/mantidproject/mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class DLLExport AnalysisDataServiceImpl
class DLLExport AnalysisDataServiceImpl final
: public Kernel::DataService<API::Workspace> {
public:
/** @name Extra notifications only applicable to the ADS */
......@@ -196,26 +196,26 @@ typedef const Poco::AutoPtr<Mantid::Kernel::DataService<
typedef Mantid::Kernel::DataService<Mantid::API::Workspace>::
BeforeReplaceNotification WorkspaceBeforeReplaceNotification;
typedef const Poco::AutoPtr<Mantid::Kernel::DataService<
Mantid::API::Workspace>::BeforeReplaceNotification> &
WorkspaceBeforeReplaceNotification_ptr;
Mantid::API::Workspace>::BeforeReplaceNotification>
&WorkspaceBeforeReplaceNotification_ptr;
typedef Mantid::Kernel::DataService<Mantid::API::Workspace>::
AfterReplaceNotification WorkspaceAfterReplaceNotification;
typedef const Poco::AutoPtr<Mantid::Kernel::DataService<
Mantid::API::Workspace>::AfterReplaceNotification> &
WorkspaceAfterReplaceNotification_ptr;
Mantid::API::Workspace>::AfterReplaceNotification>
&WorkspaceAfterReplaceNotification_ptr;
typedef Mantid::Kernel::DataService<Mantid::API::Workspace>::
PreDeleteNotification WorkspacePreDeleteNotification;
typedef const Poco::AutoPtr<Mantid::Kernel::DataService<
Mantid::API::Workspace>::PreDeleteNotification> &
WorkspacePreDeleteNotification_ptr;
typedef const Poco::AutoPtr<
Mantid::Kernel::DataService<Mantid::API::Workspace>::PreDeleteNotification>
&WorkspacePreDeleteNotification_ptr;
typedef Mantid::Kernel::DataService<Mantid::API::Workspace>::
PostDeleteNotification WorkspacePostDeleteNotification;
typedef const Poco::AutoPtr<Mantid::Kernel::DataService<
Mantid::API::Workspace>::PostDeleteNotification> &
WorkspacePostDeleteNotification_ptr;
typedef const Poco::AutoPtr<
Mantid::Kernel::DataService<Mantid::API::Workspace>::PostDeleteNotification>
&WorkspacePostDeleteNotification_ptr;
typedef Mantid::Kernel::DataService<Mantid::API::Workspace>::ClearNotification
ClearADSNotification;
......@@ -225,25 +225,25 @@ typedef const Poco::AutoPtr<Mantid::Kernel::DataService<
typedef Mantid::Kernel::DataService<Mantid::API::Workspace>::RenameNotification
WorkspaceRenameNotification;
typedef const Poco::AutoPtr<
Mantid::Kernel::DataService<Mantid::API::Workspace>::RenameNotification> &
WorkspaceRenameNotification_ptr;
Mantid::Kernel::DataService<Mantid::API::Workspace>::RenameNotification>
&WorkspaceRenameNotification_ptr;
typedef AnalysisDataServiceImpl::GroupWorkspacesNotification
WorkspacesGroupedNotification;
typedef const Poco::AutoPtr<
AnalysisDataServiceImpl::GroupWorkspacesNotification> &
WorkspacesGroupedNotification_ptr;
AnalysisDataServiceImpl::GroupWorkspacesNotification>
&WorkspacesGroupedNotification_ptr;
typedef AnalysisDataServiceImpl::UnGroupingWorkspaceNotification
WorkspaceUnGroupingNotification;
typedef const Poco::AutoPtr<
AnalysisDataServiceImpl::UnGroupingWorkspaceNotification> &
WorkspaceUnGroupingNotification_ptr;
AnalysisDataServiceImpl::UnGroupingWorkspaceNotification>
&WorkspaceUnGroupingNotification_ptr;
typedef AnalysisDataServiceImpl::GroupUpdatedNotification
GroupUpdatedNotification;
typedef const Poco::AutoPtr<AnalysisDataServiceImpl::GroupUpdatedNotification> &
GroupUpdatedNotification_ptr;
typedef const Poco::AutoPtr<AnalysisDataServiceImpl::GroupUpdatedNotification>
&GroupUpdatedNotification_ptr;
} // Namespace API
} // Namespace Mantid
......
......@@ -87,8 +87,8 @@ public:
/// Find the index of the given double value
virtual size_t indexOfValue(const double value) const = 0;
/// Get the spectrum index
virtual specid_t spectraNo(const std::size_t &index) const;
/// Get the spectrum number
virtual specnum_t spectraNo(const std::size_t &index) const;
/// Get the length of the axis
virtual std::size_t length() const = 0;
......
......@@ -2,7 +2,6 @@
#define BOXCONTROLLER_H_
#include "MantidKernel/DiskBuffer.h"
#include "MantidKernel/MultiThreaded.h"
#include "MantidKernel/System.h"
#include "MantidKernel/ThreadPool.h"
#include "MantidKernel/Exception.h"
......@@ -84,7 +83,7 @@ public:
//-----------------------------------------------------------------------------------
/** @return the mutex for avoiding simultaneous assignments of box Ids. */
inline Kernel::Mutex &getIdMutex() { return m_idMutex; }
inline std::mutex &getIdMutex() { return m_idMutex; }
//-----------------------------------------------------------------------------------
/** Return true if the MDBox should split, given :
......@@ -286,7 +285,7 @@ public:
*boxes.
*/
void trackNumBoxes(size_t depth) {
m_mutexNumMDBoxes.lock();
std::lock_guard<std::mutex> lock(m_mutexNumMDBoxes);
if (m_numMDBoxes[depth] > 0) {
m_numMDBoxes[depth]--;
}
......@@ -303,7 +302,6 @@ public:
} else {
m_numMDBoxes[depth + 1] += m_numSplit;
}
m_mutexNumMDBoxes.unlock();
}
/** Return the vector giving the number of MD Boxes as a function of depth */
......@@ -357,13 +355,12 @@ public:
/** Reset the number of boxes tracked in m_numMDBoxes */
void resetNumBoxes() {
m_mutexNumMDBoxes.lock();
std::lock_guard<std::mutex> lock(m_mutexNumMDBoxes);
m_numMDBoxes.clear();
m_numMDBoxes.resize(m_maxDepth + 1, 0); // Reset to 0
m_numMDGridBoxes.resize(m_maxDepth + 1, 0); // Reset to 0
m_numMDBoxes[0] = 1; // Start at 1 at depth 0.
resetMaxNumBoxes(); // Also the maximums
m_mutexNumMDBoxes.unlock();
}
// { return m_useWriteBuffer; }
......@@ -495,14 +492,14 @@ private:
std::vector<size_t> m_numMDGridBoxes;
/// Mutex for changing the number of MD Boxes.
Mantid::Kernel::Mutex m_mutexNumMDBoxes;
std::mutex m_mutexNumMDBoxes;
/// This is the maximum number of MD boxes there could be at each recursion
/// level (e.g. (splitInto ^ ndims) ^ depth )
std::vector<double> m_maxNumMDBoxes;
/// Mutex for getting IDs
Mantid::Kernel::Mutex m_idMutex;
std::mutex m_idMutex;
// the class which does actual IO operations, including MRU support list
boost::shared_ptr<IBoxControllerIO> m_fileIO;
......
......@@ -51,7 +51,7 @@ class Expression;
File change history is stored at: <https://github.com/mantidproject/mantid>
*/
class MANTID_API_DLL ConstraintFactoryImpl
class MANTID_API_DLL ConstraintFactoryImpl final
: public Kernel::DynamicFactory<IConstraint> {
public:
/// Creates an instance of a Constraint
......
......@@ -12,6 +12,7 @@
#include "MantidKernel/DeltaEMode.h"
#include <list>
#include <mutex>
namespace Mantid {
//---------------------------------------------------------------------------
......@@ -114,9 +115,8 @@ public:
/// Easy access to the efixed value for this run & detector ID
virtual double getEFixed(const detid_t detID) const;
/// Easy access to the efixed value for this run & optional detector
virtual double
getEFixed(const Geometry::IDetector_const_sptr
detector = Geometry::IDetector_const_sptr()) const;
virtual double getEFixed(const Geometry::IDetector_const_sptr detector =
Geometry::IDetector_const_sptr()) const;
/// Set the efixed value for a given detector ID
virtual void setEFixed(const detid_t detID, const double value);
......@@ -198,7 +198,7 @@ private:
/// Detector grouping information
det2group_map m_detgroups;
/// Mutex to protect against cow_ptr copying
mutable Poco::Mutex m_mutex;
mutable std::recursive_mutex m_mutex;
};
/// Shared pointer to ExperimentInfo
......
......@@ -10,7 +10,7 @@
#include <string>
#include <vector>
#include <map>
#include <set>
#include <unordered_set>
namespace Mantid {
namespace API {
......@@ -56,7 +56,7 @@ public:
Expression(const std::vector<std::string> &ops);
/// contructor
Expression(const std::vector<std::string> &binary,
const std::set<std::string> &unary);
const std::unordered_set<std::string> &unary);
/// copy contructor
Expression(const Expression &expr);
/// Assignment operator
......@@ -104,7 +104,7 @@ public:
/// This method returns first sub-expression without brackets
const Expression &bracketsRemoved() const;
/// Return a list of all variable names in this expression
std::set<std::string> getVariables() const;
std::unordered_set<std::string> getVariables() const;
/**
* Rename all variables with a given name
* @param oldName :: The old name
......@@ -192,10 +192,10 @@ private:
struct Operators {
std::vector<std::string>
binary; ///< Binary operators in reverse precedence order
std::set<std::string> unary; ///< Unary operators
std::unordered_set<std::string> unary; ///< Unary operators
std::map<std::string, size_t>
precedence; ///< Map of the operator precedence order
std::set<char>
std::unordered_set<char>
symbols; ///< All the symbols that are used in the binary operators
std::map<std::string, char> op_number; ///< map of operators
};
......@@ -215,7 +215,7 @@ private:
* Adds new unary operators to the expression
* @param ops :: A vector with unary operators
*/
void add_unary(const std::set<std::string> &ops);
void add_unary(const std::unordered_set<std::string> &ops);
/**
* Check if a string is a unary operator
* @param op :: The string to check
......
......@@ -8,7 +8,8 @@
#include "MantidAPI/DllConfig.h"
#include "MantidKernel/DynamicFactory.h"
#include "MantidKernel/SingletonHolder.h"
#include "MantidKernel/MultiThreaded.h"
#include <mutex>
namespace Mantid {
......@@ -52,7 +53,7 @@ class Expression;
File change history is stored at: <https://github.com/mantidproject/mantid>
*/
class MANTID_API_DLL FunctionFactoryImpl
class MANTID_API_DLL FunctionFactoryImpl final
: public Kernel::DynamicFactory<IFunction> {
public:
/**Creates an instance of a function
......@@ -116,7 +117,7 @@ private:
void addTie(boost::shared_ptr<IFunction> fun, const Expression &expr) const;
mutable std::map<std::string, std::vector<std::string>> m_cachedFunctionNames;
mutable Kernel::Mutex m_mutex;
mutable std::mutex m_mutex;
};
/**
......@@ -126,7 +127,7 @@ private:
*/
template <typename FunctionType>
const std::vector<std::string> &FunctionFactoryImpl::getFunctionNames() const {
Kernel::Mutex::ScopedLock _lock(m_mutex);
std::lock_guard<std::mutex> _lock(m_mutex);
const std::string soughtType(typeid(FunctionType).name());
if (m_cachedFunctionNames.find(soughtType) != m_cachedFunctionNames.end()) {
......@@ -159,8 +160,8 @@ typedef MANTID_API_DLL Mantid::Kernel::SingletonHolder<FunctionFactoryImpl>
typedef FunctionFactoryImpl::UpdateNotification
FunctionFactoryUpdateNotification;
/// Convenient typedef for an UpdateNotification AutoPtr
typedef const Poco::AutoPtr<FunctionFactoryUpdateNotification> &
FunctionFactoryUpdateNotification_ptr;
typedef const Poco::AutoPtr<FunctionFactoryUpdateNotification>
&FunctionFactoryUpdateNotification_ptr;
} // namespace API
} // namespace Mantid
......
......@@ -24,7 +24,7 @@ public:
IEventList() {}
/// Constructor
IEventList(specid_t specNo) : ISpectrum(specNo) {}
IEventList(specnum_t specNo) : ISpectrum(specNo) {}
/// Return the current event type for the list
virtual Mantid::API::EventType getEventType() const = 0;
......
......@@ -135,7 +135,7 @@ public:
* spectra.
* @param specList :: A vector with spectra indices.
*/
virtual void setSpectra(const std::vector<specid_t> &specList) {
virtual void setSpectra(const std::vector<specnum_t> &specList) {
(void)specList;
}
......
......@@ -47,7 +47,7 @@ namespace API {
class DLLExport ISpectrum {
public:
ISpectrum();
ISpectrum(const specid_t specNo);
ISpectrum(const specnum_t specNo);
ISpectrum(const ISpectrum &other);
virtual ~ISpectrum();
......@@ -112,9 +112,9 @@ public:
void clearDetectorIDs();
// ---------------------------------------------------------
specid_t getSpectrumNo() const;
specnum_t getSpectrumNo() const;
void setSpectrumNo(specid_t num);
void setSpectrumNo(specnum_t num);
// ---------------------------------------------------------
virtual void lockData() const;
......@@ -126,7 +126,7 @@ public:
protected:
/// The spectrum number of this spectrum
specid_t m_specNo;
specnum_t m_specNo;
/// Set of the detector IDs associated with this spectrum
std::set<detid_t> detectorIDs;
......
......@@ -103,18 +103,18 @@ public:
/// Causes the nearest neighbours map to be rebuilt
void rebuildNearestNeighbours();
/// Query the NearestNeighbours object for a detector
std::map<specid_t, Mantid::Kernel::V3D>
std::map<specnum_t, Mantid::Kernel::V3D>
getNeighbours(const Geometry::IDetector *comp, const double radius = 0.0,
const bool ignoreMaskedDetectors = false) const;
/// Query the NearestNeighbours object for a given spectrum index using a
/// search radius
std::map<specid_t, Mantid::Kernel::V3D>
getNeighbours(specid_t spec, const double radius,
std::map<specnum_t, Mantid::Kernel::V3D>
getNeighbours(specnum_t spec, const double radius,
const bool ignoreMaskedDetectors = false) const;
/// Query the NearestNeighbours object for a given spectrum index using the
/// direct number of nearest neighbours
std::map<specid_t, Mantid::Kernel::V3D>
getNeighboursExact(specid_t spec, const int nNeighbours,
std::map<specnum_t, Mantid::Kernel::V3D>
getNeighboursExact(specnum_t spec, const int nNeighbours,
const bool ignoreMaskedDetectors = false) const;
//@}
......@@ -130,14 +130,15 @@ public:
virtual std::vector<size_t>
getDetectorIDToWorkspaceIndexVector(detid_t &offset,
bool throwIfMultipleDets = false) const;
virtual std::vector<size_t>
getSpectrumToWorkspaceIndexVector(specid_t &offset) const;
getSpectrumToWorkspaceIndexVector(specnum_t &offset) const;
std::vector<size_t>
getIndicesFromSpectra(const std::vector<specid_t> &spectraList) const;
size_t getIndexFromSpectrumNumber(const specid_t specNo) const;
getIndicesFromSpectra(const std::vector<specnum_t> &spectraList) const;
size_t getIndexFromSpectrumNumber(const specnum_t specNo) const;
std::vector<size_t>
getIndicesFromDetectorIDs(const std::vector<detid_t> &detIdList) const;
std::vector<specid_t>
std::vector<specnum_t>
getSpectraFromDetectorIDs(const std::vector<detid_t> &detIdList) const;
bool hasGroupedDetectors() const;
......
......@@ -5,8 +5,8 @@
// Includes
//----------------------------------------------------------------------
#include "MantidAPI/DllConfig.h"
#include "MantidKernel/MultiThreaded.h"
#include "MantidKernel/SingletonHolder.h"
#include <mutex>
namespace Mantid {
namespace API {
......@@ -76,7 +76,7 @@ private:
*/
size_t memoryCleared;
/// Mutex for adding to memoryCleared
Kernel::Mutex accumulatorMutex;
std::mutex accumulatorMutex;
};
/// Forward declaration of a specialisation of SingletonHolder for
......
......@@ -45,7 +45,7 @@ namespace API {
File change history is stored at: <https://github.com/mantidproject/mantid>
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class MANTID_API_DLL ParameterTie : public ParameterReference {
class MANTID_API_DLL ParameterTie final : public ParameterReference {
public:
/// Constructor
ParameterTie(IFunction *funct, const std::string &parName,
......
......@@ -38,7 +38,7 @@ class Algorithm;
File change history is stored at: <https://github.com/mantidproject/mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class MANTID_API_DLL Progress : public Mantid::Kernel::ProgressBase {
class MANTID_API_DLL Progress final : public Mantid::Kernel::ProgressBase {
public:
Progress();
Progress(Algorithm *alg, double start, double end, int numSteps);
......
......@@ -8,8 +8,6 @@
#include <boost/shared_ptr.hpp>
using namespace Mantid::Kernel;
namespace Mantid {
namespace API {
......@@ -51,9 +49,9 @@ public:
/// Default constructor builds identity projection
Projection();
/// Three dimensional value constructor, w is the cross product of u and v.
Projection(const V3D &u, const V3D &v);
Projection(const Kernel::V3D &u, const Kernel::V3D &v);
/// Three dimensional value constructor
Projection(const V3D &u, const V3D &v, const V3D &w);
Projection(const Kernel::V3D &u, const Kernel::V3D &v, const Kernel::V3D &w);
/// Construct from an ITableWorkspace
Projection(const ITableWorkspace &ws);
/// Copy constructor
......@@ -65,23 +63,23 @@ public:
/// Retrieves the offset for the given dimension
double getOffset(size_t nd);
/// Retrieves the axis vector for the given dimension
V3D getAxis(size_t nd);
Kernel::V3D getAxis(size_t nd);
/// Retrives the unit of the given dimension
ProjectionUnit getUnit(size_t nd);
/// Set the offset for a given dimension
void setOffset(size_t nd, double offset);
/// Set the axis vector for a given dimension
void setAxis(size_t nd, V3D axis);
void setAxis(size_t nd, Kernel::V3D axis);
/// Set the unit for a given dimension
void setUnit(size_t nd, ProjectionUnit unit);
V3D &U() { return m_dimensions[0]; }
V3D &V() { return m_dimensions[1]; }
V3D &W() { return m_dimensions[2]; }
Kernel::V3D &U() { return m_dimensions[0]; }
Kernel::V3D &V() { return m_dimensions[1]; }
Kernel::V3D &W() { return m_dimensions[2]; }
protected:
/// The dimensions
V3D m_dimensions[3];
Kernel::V3D m_dimensions[3];
/// The offsets for each dimension
double m_offsets[3];
/// The units for each dimension
......
......@@ -30,7 +30,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
File change history is stored at: <https://github.com/mantidproject/mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
class MANTID_API_DLL PropertyManagerDataServiceImpl
class MANTID_API_DLL PropertyManagerDataServiceImpl final
: public Mantid::Kernel::DataService<Mantid::Kernel::PropertyManager> {
private:
friend struct Mantid::Kernel::CreateUsingNew<PropertyManagerDataServiceImpl>;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment