Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refs #6473. Merge remote-tracking branch 'origin/master' into 6473
Conflicts: Code/Mantid/MantidQt/MantidWidgets/CMakeLists.txt
- Loading branch information
Showing
353 changed files
with
24,796 additions
and
10,037 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// suppress memleak and exceptNew errors in the file src/file1.cpp | ||
//memleak:src/file1.cpp | ||
//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 | ||
class_X_Y |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
#ifndef MANTID_API_SCOPEDWORKSPACE_H_ | ||
#define MANTID_API_SCOPEDWORKSPACE_H_ | ||
|
||
#include <string> | ||
|
||
#include "MantidKernel/ClassMacros.h" | ||
#include "MantidKernel/System.h" | ||
#include "MantidAPI/Workspace.h" | ||
|
||
namespace Mantid | ||
{ | ||
namespace API | ||
{ | ||
/** ScopedWorkspace : scoped workspace ADS entry. | ||
This class is provided for situations when you need a workspace to be in the ADS to run an | ||
algorithm, but you don't really need to keep it there after the algorithm has finished. In | ||
these circumstances you can create ScopedWorkspace, set it's name as a workspace property | ||
for the algorithm and retrieve it when algorithm has finished. The workspace will be | ||
removed from the ADS when the object goes out of scope, or exception is thrown. | ||
Primarily, it was created to overcome some limitations of WorkspaceProperties, but it can be | ||
useful in other places, e.g. tests. | ||
Copyright © 2013 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory | ||
This file is part of Mantid. | ||
Mantid is free software; you can redistribute it and/or modify | ||
it under the terms of the GNU General Public License as published by | ||
the Free Software Foundation; either version 3 of the License, or | ||
(at your option) any later version. | ||
Mantid is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
GNU General Public License for more details. | ||
You should have received a copy of the GNU General Public License | ||
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 DLLExport ScopedWorkspace | ||
{ | ||
public: | ||
/// Empty constructor | ||
ScopedWorkspace(); | ||
|
||
/// Workspace constructor | ||
ScopedWorkspace(Workspace_sptr ws); | ||
|
||
/// Destructor | ||
virtual ~ScopedWorkspace(); | ||
|
||
/// Returns ADS name of the workspace | ||
std::string name() const { return m_name; } | ||
|
||
/// Retrieve workspace from the ADS | ||
Workspace_sptr retrieve() const; | ||
|
||
/// Removes the workspace entry from the ADS | ||
void remove(); | ||
|
||
/// Operator for conversion to boolean | ||
operator bool() const; | ||
|
||
/// Make ADS entry to point to the given workspace | ||
void set(Workspace_sptr newWS); | ||
|
||
private: | ||
DISABLE_COPY_AND_ASSIGN(ScopedWorkspace); | ||
|
||
/// ADS name of the workspace | ||
const std::string m_name; | ||
|
||
/// Generates a tricky name which is unique within ADS | ||
static std::string generateUniqueName(); | ||
|
||
/// Generates a random alpha-numeric string | ||
static std::string randomString(size_t len); | ||
|
||
/// Length of workspace names generated | ||
static const size_t NAME_LENGTH; | ||
}; | ||
|
||
|
||
} // namespace API | ||
} // namespace Mantid | ||
|
||
#endif /* MANTID_API_SCOPEDWORKSPACE_H_ */ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.