Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master' into feature/5300_moment…
Browse files Browse the repository at this point in the history
…s_sqw_tab

Refs #5300

Conflicts:
	Code/Mantid/MantidQt/CustomInterfaces/inc/MantidQtCustomInterfaces/ConvertToEnergy.ui
	Code/Mantid/MantidQt/CustomInterfaces/src/Indirect.cpp
  • Loading branch information
Samuel Jackson committed Feb 18, 2014
2 parents 48b0f60 + 5d3eded commit f08a867
Show file tree
Hide file tree
Showing 150 changed files with 1,621 additions and 1,373 deletions.
2 changes: 0 additions & 2 deletions Code/Mantid/Build/CMake/CppCheck_Suppressions.txt
Expand Up @@ -3,8 +3,6 @@
//exceptNew:src/file1.cpp

// suppress in all files - BE CAREFULL not to leave trailing spaces after the rule id. or empty lines
// This finds false positives where private member variable names reused by inheriting classes
duplInheritedMember
// For a library this is not a problem per se
unusedFunction
// cppcheck has problems handling the number of pre-processor definitions used in the DLL_EXPORTs
Expand Down
3 changes: 2 additions & 1 deletion Code/Mantid/Build/CMake/FindCppcheck.cmake
Expand Up @@ -61,7 +61,8 @@ if(CPPCHECK_EXECUTABLE)
endif()

mark_as_advanced(CPPCHECK_EXECUTABLE)
set ( CPPCHECK_ARGS --enable=all --inline-suppr CACHE STRING "Arguments for running cppcheck" --suppressions ${CMAKE_CURRENT_SOURCE_DIR}/Build/CMake/CppCheck_Suppressions.txt )
set ( CPPCHECK_ARGS --enable=all --inline-suppr
--suppressions ${CMAKE_CURRENT_SOURCE_DIR}/Build/CMake/CppCheck_Suppressions.txt )
set ( CPPCHECK_NUM_THREADS 0 CACHE STRING "Number of threads to use when running cppcheck" )
set ( CPPCHECK_GENERATE_XML OFF CACHE BOOL "Generate xml output files from cppcheck" )

Expand Down
58 changes: 35 additions & 23 deletions Code/Mantid/Framework/API/inc/MantidAPI/Algorithm.h
Expand Up @@ -9,25 +9,30 @@
#include "MantidKernel/PropertyManagerOwner.h"

// -- These headers will (most-likely) be used by every inheriting algorithm
#include "MantidAPI/AlgorithmFactory.h" //for the factory macro
#include "MantidAPI/Progress.h"
#include "MantidAPI/AlgorithmFactory.h"
#include "MantidAPI/WorkspaceProperty.h"
#include "MantidAPI/WorkspaceFactory.h"
#include "MantidAPI/WorkspaceOpOverloads.h"
#include "MantidKernel/MultiThreaded.h"
#include "MantidKernel/EmptyValues.h"

#include <boost/shared_ptr.hpp>
#include <Poco/ActiveMethod.h>
#include <Poco/NotificationCenter.h>
#include <Poco/Notification.h>
#include <Poco/NObserver.h>
#include <Poco/Void.h>
//----------------------------------------------------------------------
// Forward Declaration
//----------------------------------------------------------------------
namespace boost
{
template <class T> class weak_ptr;
}

#include <string>
#include <vector>
#include <map>
#include <cmath>
namespace Poco
{
template <class R, class A, class O, class S> class ActiveMethod;
template <class O> class ActiveStarter;
class NotificationCenter;
template <class C, class N> class NObserver;
class Void;
}

namespace Mantid
{
Expand Down Expand Up @@ -209,10 +214,10 @@ class MANTID_API_DLL Algorithm : public IAlgorithm, public Kernel::PropertyManag
Poco::ActiveResult<bool> executeAsync();

/// Add an observer for a notification
void addObserver(const Poco::AbstractObserver& observer)const;
void addObserver(const Poco::AbstractObserver& observer) const;

/// Remove an observer
void removeObserver(const Poco::AbstractObserver& observer)const;
void removeObserver(const Poco::AbstractObserver& observer) const;

/// Raises the cancel flag.
virtual void cancel();
Expand Down Expand Up @@ -289,19 +294,19 @@ class MANTID_API_DLL Algorithm : public IAlgorithm, public Kernel::PropertyManag
void setInitialized();
void setExecuted(bool state);

/// Sends notifications to observers. Observers can subscribe to notificationCenter
/// using Poco::NotificationCenter::addObserver(...);
mutable Poco::NotificationCenter m_notificationCenter;

/** @name Progress Reporting functions */
friend class Progress;
void progress(double p, const std::string& msg = "", double estimatedTime = 0.0, int progressPrecision = 0);
void interruption_point();

/// Return a reference to the algorithm's notification dispatcher
Poco::NotificationCenter & notificationCenter() const;

///Observation slot for child algorithm progress notification messages, these are scaled and then signalled for this algorithm.
void handleChildProgressNotification(const Poco::AutoPtr<ProgressNotification>& pNf);
///Child algorithm progress observer
Poco::NObserver<Algorithm, ProgressNotification> m_progressObserver;
/// Return a reference to the algorithm's object that is reporting progress
const Poco::AbstractObserver & progressObserver() const;

///checks that the value was not set by users, uses the value in empty double/int.
template <typename NumT>
static bool isEmpty(const NumT toCheck);
Expand Down Expand Up @@ -347,12 +352,19 @@ class MANTID_API_DLL Algorithm : public IAlgorithm, public Kernel::PropertyManag

void logAlgorithmInfo() const;


/// Poco::ActiveMethod used to implement asynchronous execution.
Poco::ActiveMethod<bool, Poco::Void, Algorithm> m_executeAsync;
bool executeAsyncImpl(const Poco::Void & i);

// --------------------- Private Members -----------------------------------

/// Poco::ActiveMethod used to implement asynchronous execution.
Poco::ActiveMethod<bool, Poco::Void, Algorithm, Poco::ActiveStarter<Algorithm>> *m_executeAsync;

/// Sends notifications to observers. Observers can subscribe to notificationCenter
/// using Poco::NotificationCenter::addObserver(...);
mutable Poco::NotificationCenter *m_notificationCenter;
///Child algorithm progress observer
mutable Poco::NObserver<Algorithm, ProgressNotification> *m_progressObserver;

bool m_isInitialized; ///< Algorithm has been initialized flag
bool m_isExecuted; ///< Algorithm is executed flag
bool m_isChildAlgorithm; ///< Algorithm is a child algorithm
Expand All @@ -367,7 +379,7 @@ class MANTID_API_DLL Algorithm : public IAlgorithm, public Kernel::PropertyManag
std::string m_OptionalMessage; ///< An optional message string to be displayed in the GUI.
std::string m_WikiSummary; ///< A summary line for the wiki page.
std::string m_WikiDescription; ///< Description in the wiki page.
std::vector<IAlgorithm_wptr> m_ChildAlgorithms; ///< A list of weak pointers to any child algorithms created
std::vector<boost::weak_ptr<IAlgorithm>> m_ChildAlgorithms; ///< A list of weak pointers to any child algorithms created


/// Vector of all the workspaces that have been read-locked
Expand Down
11 changes: 9 additions & 2 deletions Code/Mantid/Framework/API/inc/MantidAPI/AlgorithmProxy.h
Expand Up @@ -8,14 +8,20 @@
#include "MantidAPI/IAlgorithm.h"
#include "MantidKernel/PropertyManagerOwner.h"
#include <boost/shared_ptr.hpp>
#include <Poco/ActiveMethod.h>


#ifdef _MSC_VER
#pragma warning( disable: 4250 ) // Disable warning regarding inheritance via dominance, we have no way around it with the design
#endif


//----------------------------------------------------------------------
// Forward Declaration
//----------------------------------------------------------------------
namespace Poco
{
template <class R, class A, class O, class S> class ActiveMethod;
template <class O> class ActiveStarter;
class Void;
}

Expand Down Expand Up @@ -156,7 +162,8 @@ namespace Mantid
void dropWorkspaceReferences();

/// Poco::ActiveMethod used to implement asynchronous execution.
Poco::ActiveMethod<bool, Poco::Void, AlgorithmProxy> _executeAsync;
Poco::ActiveMethod<bool, Poco::Void, AlgorithmProxy,
Poco::ActiveStarter<AlgorithmProxy>> *m_executeAsync;
/// Execute asynchronous implementation
bool executeAsyncImpl(const Poco::Void & dummy);

Expand Down
16 changes: 1 addition & 15 deletions Code/Mantid/Framework/API/inc/MantidAPI/Column.h
Expand Up @@ -135,21 +135,7 @@ class MANTID_API_DLL Column
}

/// Set plot type where
/// None = 0 (means it has specifically been set to 'no plot type')
/// NotSet = -1000 (this is the default and means plot style has not been set)
/// X = 1, Y = 2, Z = 3, xErr = 4, yErr = 5, Label = 6
/// @param t plot type as defined above
void setPlotType(int t)
{
if ( t == -1000 || t == 0 || t == 1 || t == 2 || t == 3 || t == 4 ||
t == 5 || t == 6 )
m_plotType = t;
else
{
g_log.error() << "Cannot set plot of column to " << t
<< " . Ignore this attempt." << std::endl;
}
}
void setPlotType(int t);

/**
* Fills a std vector with values from the column if the types are compatible.
Expand Down
5 changes: 1 addition & 4 deletions Code/Mantid/Framework/API/inc/MantidAPI/IAlgorithm.h
Expand Up @@ -6,13 +6,11 @@
//----------------------------------------------------------------------
#include "MantidAPI/DllConfig.h"
#include "MantidKernel/IPropertyManager.h"
#include <Poco/ActiveResult.h>
#include <boost/weak_ptr.hpp>
#include <string>

namespace Poco
{
class AbstractObserver;
template<class T> class ActiveResult;
}

namespace Mantid
Expand Down Expand Up @@ -176,7 +174,6 @@ class MANTID_API_DLL IAlgorithm : virtual public Kernel::IPropertyManager

typedef boost::shared_ptr<IAlgorithm> IAlgorithm_sptr;
typedef boost::shared_ptr<const IAlgorithm> IAlgorithm_const_sptr;
typedef boost::weak_ptr<IAlgorithm> IAlgorithm_wptr;

} // namespace API
} // namespace Mantid
Expand Down

0 comments on commit f08a867

Please sign in to comment.