Newer
Older
Gigg, Martyn Anthony
committed
//--------------------------------------------------------------------------
// Includes
//--------------------------------------------------------------------------
#include "MantidAlgorithms/DeleteWorkspace.h"
Gigg, Martyn Anthony
committed
Gigg, Martyn Anthony
committed
Gigg, Martyn Anthony
committed
//--------------------------------------------------------------------------
// Private member functions
//--------------------------------------------------------------------------
Gigg, Martyn Anthony
committed
/// Initialize the algorithm properties
void DeleteWorkspace::init() {
declareProperty(Kernel::make_unique<API::WorkspaceProperty<API::Workspace>>(
"Workspace", "", Kernel::Direction::Input),
"Name of the workspace to delete.");
}
Gigg, Martyn Anthony
committed
/// Execute the algorithm
void DeleteWorkspace::exec() {
using API::AnalysisDataService;
using API::AnalysisDataServiceImpl;
AnalysisDataServiceImpl &dataStore = AnalysisDataService::Instance();
const std::string wsName = getProperty("Workspace");
dataStore.remove(wsName); // Logs if it doesn't exist
}
}