diff --git a/Framework/API/inc/MantidAPI/Workspace.h b/Framework/API/inc/MantidAPI/Workspace.h index a29543e6757bc7b7a0f0f9997e5fb93f588f64c7..fd2d2e504a985de5dfe395cfefafd8ec5abda140 100644 --- a/Framework/API/inc/MantidAPI/Workspace.h +++ b/Framework/API/inc/MantidAPI/Workspace.h @@ -69,8 +69,6 @@ public: Workspace_uptr clone() const { return Workspace_uptr(doClone()); } Workspace &operator=(const Workspace &other) = delete; // DataItem interface - /// Name - const std::string name() const override { return this->getName(); } /** Marks the workspace as safe for multiple threads to edit data * simutaneously. * Workspace creation is always considered to be a single threaded operation. @@ -83,7 +81,7 @@ public: void setComment(const std::string &); virtual const std::string getTitle() const; const std::string &getComment() const; - const std::string &getName() const; + const std::string &getName() const override; bool isDirty(const int n = 1) const; /// Get the footprint in memory in bytes. virtual size_t getMemorySize() const = 0; diff --git a/Framework/API/inc/MantidAPI/WorkspaceGroup.h b/Framework/API/inc/MantidAPI/WorkspaceGroup.h index c4ef3930b6dd03f414250a3e27291eb8220abdc1..1525d7724549bf7a9a62f5b468bd5e8d0d11d001 100644 --- a/Framework/API/inc/MantidAPI/WorkspaceGroup.h +++ b/Framework/API/inc/MantidAPI/WorkspaceGroup.h @@ -93,16 +93,16 @@ public: /// Invokes the ADS to sort group members by orkspace name void sortByName() { - AnalysisDataService::Instance().sortGroupByName(this->name()); + AnalysisDataService::Instance().sortGroupByName(this->getName()); } /// Adds a workspace to the group. void add(const std::string &wsName) { - AnalysisDataService::Instance().addToGroup(this->name(), wsName); + AnalysisDataService::Instance().addToGroup(this->getName(), wsName); } /// Remove a name from the group void remove(const std::string &wsName) { - AnalysisDataService::Instance().removeFromGroup(this->name(), wsName); + AnalysisDataService::Instance().removeFromGroup(this->getName(), wsName); } /// Does a workspace exist within the group bool contains(const std::string &wsName) const; diff --git a/Framework/API/inc/MantidAPI/WorkspaceProperty.tcc b/Framework/API/inc/MantidAPI/WorkspaceProperty.tcc index 5e40d8330821cf38b2c0d22ffcbd7091235e575f..835b2c8899f64489e053bd67b33b5802f8e39217 100644 --- a/Framework/API/inc/MantidAPI/WorkspaceProperty.tcc +++ b/Framework/API/inc/MantidAPI/WorkspaceProperty.tcc @@ -108,7 +108,7 @@ operator=(const WorkspaceProperty &right) { template <typename TYPE> boost::shared_ptr<TYPE> &WorkspaceProperty<TYPE>:: operator=(const boost::shared_ptr<TYPE> &value) { - std::string wsName = value->name(); + std::string wsName = value->getName(); if (this->direction() == Kernel::Direction::Input && !wsName.empty()) { m_workspaceName = wsName; } @@ -180,7 +180,7 @@ std::string WorkspaceProperty<TYPE>::setDataItem( const boost::shared_ptr<Kernel::DataItem> value) { boost::shared_ptr<TYPE> typed = boost::dynamic_pointer_cast<TYPE>(value); if (typed) { - std::string wsName = typed->name(); + std::string wsName = typed->getName(); if (this->direction() == Kernel::Direction::Input && !wsName.empty()) { m_workspaceName = wsName; } diff --git a/Framework/API/src/Algorithm.cpp b/Framework/API/src/Algorithm.cpp index 72560dacef5b0f54005ec61a0cea7af493dbae30..3589c42c8e126913a484ff506578ec99e53a5a52 100644 --- a/Framework/API/src/Algorithm.cpp +++ b/Framework/API/src/Algorithm.cpp @@ -1124,7 +1124,7 @@ bool Algorithm::checkGroups() { AnalysisDataService::Instance().retrieve(name); if (!memberWS) throw std::invalid_argument("One of the members of " + - wsGroup->name() + ", " + name + + wsGroup->getName() + ", " + name + " was not found!."); thisGroup.push_back(memberWS); } @@ -1288,12 +1288,12 @@ bool Algorithm::processGroups() { // Append the names together if (!outputBaseName.empty()) outputBaseName += "_"; - outputBaseName += ws->name(); + outputBaseName += ws->getName(); // Set the property using the name of that workspace if (Property *prop = dynamic_cast<Property *>(m_inputWorkspaceProps[iwp])) { - alg->setPropertyValue(prop->name(), ws->name()); + alg->setPropertyValue(prop->name(), ws->getName()); } else { throw std::logic_error("Found a Workspace property which doesn't " "inherit from Property."); @@ -1326,7 +1326,7 @@ bool Algorithm::processGroups() { const auto &inputGroup = m_groups[inputProp - m_inputWorkspaceProps.begin()]; if (!inputGroup.empty()) - outName = inputGroup[entry]->name(); + outName = inputGroup[entry]->getName(); } // Except if all inputs had similar names, then the name is "out_1" diff --git a/Framework/API/src/AnalysisDataService.cpp b/Framework/API/src/AnalysisDataService.cpp index 61350e192a94f657a9fb15f9b0ffab6fed0e255d..f500c3692a9940ba4fc670e72ac3291a3d881548 100644 --- a/Framework/API/src/AnalysisDataService.cpp +++ b/Framework/API/src/AnalysisDataService.cpp @@ -79,7 +79,7 @@ void AnalysisDataServiceImpl::add( group->observeADSNotifications(true); for (size_t i = 0; i < group->size(); ++i) { auto ws = group->getItem(i); - std::string wsName = ws->name(); + std::string wsName = ws->getName(); // if anonymous make up a name and add if (wsName.empty()) { wsName = name + "_" + std::to_string(i + 1); @@ -118,7 +118,7 @@ void AnalysisDataServiceImpl::addOrReplace( group->observeADSNotifications(true); for (size_t i = 0; i < group->size(); ++i) { auto ws = group->getItem(i); - std::string wsName = ws->name(); + std::string wsName = ws->getName(); // make up a name for an anonymous workspace if (wsName.empty()) { wsName = name + "_" + std::to_string(i + 1); @@ -211,9 +211,9 @@ void AnalysisDataServiceImpl::deepRemoveGroup(const std::string &name) { WorkspaceGroup_sptr gws = boost::dynamic_pointer_cast<WorkspaceGroup>(ws); if (gws) { // if a member is a group remove its items as well - deepRemoveGroup(gws->name()); + deepRemoveGroup(gws->getName()); } else { - remove(ws->name()); + remove(ws->getName()); } } remove(name); diff --git a/Framework/API/src/MultiPeriodGroupWorker.cpp b/Framework/API/src/MultiPeriodGroupWorker.cpp index 3dd502cb142ffae697cf58403e5461ff1f986524..e6a052ab11e0299c5362e5b8208bf72354481a8d 100644 --- a/Framework/API/src/MultiPeriodGroupWorker.cpp +++ b/Framework/API/src/MultiPeriodGroupWorker.cpp @@ -136,7 +136,8 @@ std::string MultiPeriodGroupWorker::createFormattedInputWorkspaceNames( std::string prefix; std::string inputWorkspaces; for (const auto &vecWorkspaceGroup : vecWorkspaceGroups) { - inputWorkspaces += prefix + vecWorkspaceGroup->getItem(periodIndex)->name(); + inputWorkspaces += + prefix + vecWorkspaceGroup->getItem(periodIndex)->getName(); prefix = ","; } return inputWorkspaces; @@ -283,7 +284,7 @@ void MultiPeriodGroupWorker::validateMultiPeriodGroupInputs( if (nPeriods != benchMarkGroupSize) { throw std::runtime_error("Missmatch between nperiods log and the " "number of workspaces in the input group: " + - vecMultiPeriodGroups[i]->name()); + vecMultiPeriodGroups[i]->getName()); } Property *currentPeriodProperty = currentNestedWS->run().getLogData("current_period"); @@ -291,7 +292,7 @@ void MultiPeriodGroupWorker::validateMultiPeriodGroupInputs( if (currentPeriod != (j + 1)) { throw std::runtime_error("Multiperiod group workspaces must be " "ordered by current_period. Correct: " + - currentNestedWS->name()); + currentNestedWS->getName()); } } } diff --git a/Framework/API/src/ScopedWorkspace.cpp b/Framework/API/src/ScopedWorkspace.cpp index e3e05df9f1518d3ef7c2c505779b55de42ce81f6..e6b988678bfd6f62281190c2e2506ad8074c43c3 100644 --- a/Framework/API/src/ScopedWorkspace.cpp +++ b/Framework/API/src/ScopedWorkspace.cpp @@ -74,9 +74,9 @@ void ScopedWorkspace::remove() { void ScopedWorkspace::set(Workspace_sptr newWS) { AnalysisDataServiceImpl &ads = AnalysisDataService::Instance(); - if (!newWS->name().empty() && ads.doesExist(newWS->name())) + if (!newWS->getName().empty() && ads.doesExist(newWS->getName())) throw std::invalid_argument( - "Workspace is already in the ADS under the name " + newWS->name()); + "Workspace is already in the ADS under the name " + newWS->getName()); // Remove previous workspace entry remove(); diff --git a/Framework/API/src/WorkspaceGroup.cpp b/Framework/API/src/WorkspaceGroup.cpp index 237e621fa60455b67bd48a7afd76714eb5361ab0..8d333b9041116226271c6a4d2c40d1f1f78f2f53 100644 --- a/Framework/API/src/WorkspaceGroup.cpp +++ b/Framework/API/src/WorkspaceGroup.cpp @@ -36,7 +36,7 @@ const std::string WorkspaceGroup::toString() const { std::string descr = this->id() + "\n"; std::lock_guard<std::recursive_mutex> _lock(m_mutex); for (const auto &workspace : m_workspaces) { - descr += " -- " + workspace->name() + "\n"; + descr += " -- " + workspace->getName() + '\n'; } return descr; } @@ -94,7 +94,7 @@ void WorkspaceGroup::sortMembersByName() { } std::sort(m_workspaces.begin(), m_workspaces.end(), [](const Workspace_sptr &w1, const Workspace_sptr &w2) { - return (w1->name() < w2->name()); + return (w1->getName() < w2->getName()); }); } @@ -123,7 +123,7 @@ void WorkspaceGroup::addWorkspace(Workspace_sptr workspace) { bool WorkspaceGroup::contains(const std::string &wsName) const { std::lock_guard<std::recursive_mutex> _lock(m_mutex); for (const auto &workspace : m_workspaces) { - if ((*workspace).name() == wsName) + if (workspace->getName() == wsName) return true; } return false; @@ -158,7 +158,7 @@ std::vector<std::string> WorkspaceGroup::getNames() const { std::lock_guard<std::recursive_mutex> _lock(m_mutex); std::vector<std::string> out; for (const auto &workspace : m_workspaces) { - out.push_back((*workspace).name()); + out.push_back(workspace->getName()); } return out; } @@ -188,7 +188,7 @@ Workspace_sptr WorkspaceGroup::getItem(const size_t index) const { Workspace_sptr WorkspaceGroup::getItem(const std::string wsName) const { std::lock_guard<std::recursive_mutex> _lock(m_mutex); for (const auto &workspace : m_workspaces) { - if ((*workspace).name() == wsName) + if (workspace->getName() == wsName) return workspace; } throw std::out_of_range("Workspace " + wsName + @@ -207,7 +207,7 @@ void WorkspaceGroup::removeByADS(const std::string &wsName) { std::lock_guard<std::recursive_mutex> _lock(m_mutex); auto it = m_workspaces.begin(); for (; it != m_workspaces.end(); ++it) { - if ((**it).name() == wsName) { + if ((**it).getName() == wsName) { m_workspaces.erase(it); break; } @@ -219,8 +219,8 @@ void WorkspaceGroup::removeByADS(const std::string &wsName) { void WorkspaceGroup::print() const { std::lock_guard<std::recursive_mutex> _lock(m_mutex); for (const auto &workspace : m_workspaces) { - g_log.debug() << "Workspace name in group vector = " << (*workspace).name() - << '\n'; + g_log.debug() << "Workspace name in group vector = " + << workspace->getName() << '\n'; } } @@ -233,7 +233,7 @@ void WorkspaceGroup::print() const { void WorkspaceGroup::removeItem(const size_t index) { std::lock_guard<std::recursive_mutex> _lock(m_mutex); // do not allow this way of removing for groups in the ADS - if (!name().empty()) { + if (!this->getName().empty()) { throw std::runtime_error( "AnalysisDataService must be used to remove a workspace from group."); } @@ -339,7 +339,7 @@ bool WorkspaceGroup::areNamesSimilar() const { // Check all the members are of similar names for (const auto &workspace : m_workspaces) { - const std::string wsName = (*workspace).name(); + const std::string &wsName = workspace->getName(); // Find the last underscore _ std::size_t pos = wsName.find_last_of('_'); // No underscore = not similar @@ -348,7 +348,7 @@ bool WorkspaceGroup::areNamesSimilar() const { // The part before the underscore has to be the same // as the group name to be similar std::string commonpart(wsName.substr(0, pos)); - if (this->name() != commonpart) + if (this->getName() != commonpart) return false; } return true; diff --git a/Framework/API/test/AlgorithmTest.h b/Framework/API/test/AlgorithmTest.h index b9c9e4acdbf8eeddb107da264e45e65ca6d04dac..d6f807e008a2c06172aa0f0d36fcd5b2e2f49859 100644 --- a/Framework/API/test/AlgorithmTest.h +++ b/Framework/API/test/AlgorithmTest.h @@ -577,7 +577,7 @@ public: WorkspaceGroup_sptr group = boost::dynamic_pointer_cast<WorkspaceGroup>(out1); - TS_ASSERT_EQUALS(group->name(), "D") + TS_ASSERT_EQUALS(group->getName(), "D") TS_ASSERT_EQUALS(group->getNumberOfEntries(), expectedNumber) if (group->getNumberOfEntries() < 1) return group; @@ -603,12 +603,12 @@ public: WorkspaceGroup_sptr group = do_test_groups( "A", "A_1,A_2,A_3", "B", "B_1,B_2,B_3", "C", "C_1,C_2,C_3"); - TS_ASSERT_EQUALS(ws1->name(), "D_1"); + TS_ASSERT_EQUALS(ws1->getName(), "D_1"); TS_ASSERT_EQUALS(ws1->getTitle(), "A_1+B_1+C_1"); TS_ASSERT_EQUALS(ws1->readY(0)[0], 234); - TS_ASSERT_EQUALS(ws2->name(), "D_2"); + TS_ASSERT_EQUALS(ws2->getName(), "D_2"); TS_ASSERT_EQUALS(ws2->getTitle(), "A_2+B_2+C_2"); - TS_ASSERT_EQUALS(ws3->name(), "D_3"); + TS_ASSERT_EQUALS(ws3->getName(), "D_3"); TS_ASSERT_EQUALS(ws3->getTitle(), "A_3+B_3+C_3"); } @@ -617,12 +617,12 @@ public: WorkspaceGroup_sptr group = do_test_groups( "A", "A_1,A_2,A_3", "B", "B_1,B_2,B_3", "C", "alice,bob,charlie"); - TS_ASSERT_EQUALS(ws1->name(), "A_1_B_1_alice_D"); + TS_ASSERT_EQUALS(ws1->getName(), "A_1_B_1_alice_D"); TS_ASSERT_EQUALS(ws1->getTitle(), "A_1+B_1+alice"); TS_ASSERT_EQUALS(ws1->readY(0)[0], 234); - TS_ASSERT_EQUALS(ws2->name(), "A_2_B_2_bob_D"); + TS_ASSERT_EQUALS(ws2->getName(), "A_2_B_2_bob_D"); TS_ASSERT_EQUALS(ws2->getTitle(), "A_2+B_2+bob"); - TS_ASSERT_EQUALS(ws3->name(), "A_3_B_3_charlie_D"); + TS_ASSERT_EQUALS(ws3->getName(), "A_3_B_3_charlie_D"); TS_ASSERT_EQUALS(ws3->getTitle(), "A_3+B_3+charlie"); } @@ -631,12 +631,12 @@ public: WorkspaceGroup_sptr group = do_test_groups("A", "A_1,A_2,A_3", "B", "", "C", ""); - TS_ASSERT_EQUALS(ws1->name(), "D_1"); + TS_ASSERT_EQUALS(ws1->getName(), "D_1"); TS_ASSERT_EQUALS(ws1->getTitle(), "A_1+B+C"); TS_ASSERT_EQUALS(ws1->readY(0)[0], 234); - TS_ASSERT_EQUALS(ws2->name(), "D_2"); + TS_ASSERT_EQUALS(ws2->getName(), "D_2"); TS_ASSERT_EQUALS(ws2->getTitle(), "A_2+B+C"); - TS_ASSERT_EQUALS(ws3->name(), "D_3"); + TS_ASSERT_EQUALS(ws3->getName(), "D_3"); TS_ASSERT_EQUALS(ws3->getTitle(), "A_3+B+C"); } @@ -645,12 +645,12 @@ public: WorkspaceGroup_sptr group = do_test_groups("A", "A_1,A_2,A_3", "B", "", "", ""); - TS_ASSERT_EQUALS(ws1->name(), "D_1"); + TS_ASSERT_EQUALS(ws1->getName(), "D_1"); TS_ASSERT_EQUALS(ws1->getTitle(), "A_1+B+"); TS_ASSERT_EQUALS(ws1->readY(0)[0], 234); - TS_ASSERT_EQUALS(ws2->name(), "D_2"); + TS_ASSERT_EQUALS(ws2->getName(), "D_2"); TS_ASSERT_EQUALS(ws2->getTitle(), "A_2+B+"); - TS_ASSERT_EQUALS(ws3->name(), "D_3"); + TS_ASSERT_EQUALS(ws3->getName(), "D_3"); TS_ASSERT_EQUALS(ws3->getTitle(), "A_3+B+"); } @@ -659,12 +659,12 @@ public: WorkspaceGroup_sptr group = do_test_groups("A", "A_1,A_2,A_3", "", "", "C", "C_1,C_2,C_3"); - TS_ASSERT_EQUALS(ws1->name(), "D_1"); + TS_ASSERT_EQUALS(ws1->getName(), "D_1"); TS_ASSERT_EQUALS(ws1->getTitle(), "A_1++C_1"); TS_ASSERT_EQUALS(ws1->readY(0)[0], 234); - TS_ASSERT_EQUALS(ws2->name(), "D_2"); + TS_ASSERT_EQUALS(ws2->getName(), "D_2"); TS_ASSERT_EQUALS(ws2->getTitle(), "A_2++C_2"); - TS_ASSERT_EQUALS(ws3->name(), "D_3"); + TS_ASSERT_EQUALS(ws3->getName(), "D_3"); TS_ASSERT_EQUALS(ws3->getTitle(), "A_3++C_3"); } @@ -673,7 +673,7 @@ public: WorkspaceGroup_sptr group = do_test_groups("A", "A_1", "B", "", "C", "", false, 1); - TS_ASSERT_EQUALS(ws1->name(), "D_1"); + TS_ASSERT_EQUALS(ws1->getName(), "D_1"); TS_ASSERT_EQUALS(ws1->getTitle(), "A_1+B+C"); TS_ASSERT_EQUALS(ws1->readY(0)[0], 234); } @@ -683,7 +683,7 @@ public: WorkspaceGroup_sptr group = do_test_groups("A", "A_1", "B", "B_1", "C", "", false, 1); - TS_ASSERT_EQUALS(ws1->name(), "D_1"); + TS_ASSERT_EQUALS(ws1->getName(), "D_1"); TS_ASSERT_EQUALS(ws1->getTitle(), "A_1+B_1+C"); TS_ASSERT_EQUALS(ws1->readY(0)[0], 234); } @@ -715,12 +715,12 @@ public: WorkspaceGroup_sptr group = do_test_groups("D", "D1,D2,D3", "B", "B1,B2,B3", "C", "C1,C2,C3"); - TS_ASSERT_EQUALS(ws1->name(), "D1"); + TS_ASSERT_EQUALS(ws1->getName(), "D1"); TS_ASSERT_EQUALS(ws1->getTitle(), "D1+B1+C1"); TS_ASSERT_EQUALS(ws1->readY(0)[0], 234); - TS_ASSERT_EQUALS(ws2->name(), "D2"); + TS_ASSERT_EQUALS(ws2->getName(), "D2"); TS_ASSERT_EQUALS(ws2->getTitle(), "D2+B2+C2"); - TS_ASSERT_EQUALS(ws3->name(), "D3"); + TS_ASSERT_EQUALS(ws3->getName(), "D3"); TS_ASSERT_EQUALS(ws3->getTitle(), "D3+B3+C3"); } @@ -730,12 +730,12 @@ public: WorkspaceGroup_sptr group = do_test_groups("A", "A1,A2,A3", "D", "D1,D2,D3", "C", "C1,C2,C3"); - TS_ASSERT_EQUALS(ws1->name(), "D1"); + TS_ASSERT_EQUALS(ws1->getName(), "D1"); TS_ASSERT_EQUALS(ws1->getTitle(), "A1+D1+C1"); TS_ASSERT_EQUALS(ws1->readY(0)[0], 234); - TS_ASSERT_EQUALS(ws2->name(), "D2"); + TS_ASSERT_EQUALS(ws2->getName(), "D2"); TS_ASSERT_EQUALS(ws2->getTitle(), "A2+D2+C2"); - TS_ASSERT_EQUALS(ws3->name(), "D3"); + TS_ASSERT_EQUALS(ws3->getName(), "D3"); TS_ASSERT_EQUALS(ws3->getTitle(), "A3+D3+C3"); } @@ -745,12 +745,12 @@ public: WorkspaceGroup_sptr group = do_test_groups("A", "A1,A2,A3", "D", "D1,D2,D3", "D", "D1,D2,D3"); - TS_ASSERT_EQUALS(ws1->name(), "D1"); + TS_ASSERT_EQUALS(ws1->getName(), "D1"); TS_ASSERT_EQUALS(ws1->getTitle(), "A1+D1+D1"); TS_ASSERT_EQUALS(ws1->readY(0)[0], 234); - TS_ASSERT_EQUALS(ws2->name(), "D2"); + TS_ASSERT_EQUALS(ws2->getName(), "D2"); TS_ASSERT_EQUALS(ws2->getTitle(), "A2+D2+D2"); - TS_ASSERT_EQUALS(ws3->name(), "D3"); + TS_ASSERT_EQUALS(ws3->getName(), "D3"); TS_ASSERT_EQUALS(ws3->getTitle(), "A3+D3+D3"); } diff --git a/Framework/API/test/NotebookBuilderTest.h b/Framework/API/test/NotebookBuilderTest.h index 1e89e68b2f46bc81ee29aa74c7b4e3a1288d4ac0..4de0ec170fd49a35242bbae09e4f01626cd5b3c3 100644 --- a/Framework/API/test/NotebookBuilderTest.h +++ b/Framework/API/test/NotebookBuilderTest.h @@ -234,7 +234,7 @@ public: view->unrollAll(); NotebookBuilder builder(view); std::string notebookText = - builder.build(ws->name(), ws->getTitle(), ws->getComment()); + builder.build(ws->getName(), ws->getTitle(), ws->getComment()); std::vector<std::string> notebookLines; std::string line; @@ -286,7 +286,7 @@ public: NotebookBuilder builder(view); std::string notebookText = - builder.build(ws->name(), ws->getTitle(), ws->getComment()); + builder.build(ws->getName(), ws->getTitle(), ws->getComment()); std::vector<std::string> notebookLines; std::string line; @@ -329,7 +329,7 @@ public: NotebookBuilder builder(wsHist.createView()); std::string notebookText = - builder.build(ws->name(), ws->getTitle(), ws->getComment()); + builder.build(ws->getName(), ws->getTitle(), ws->getComment()); std::vector<std::string> notebookLines; std::string line; @@ -346,4 +346,4 @@ public: } }; -#endif // MANTID_NOTEBOOKBUILDERTEST_H_ \ No newline at end of file +#endif // MANTID_NOTEBOOKBUILDERTEST_H_ diff --git a/Framework/API/test/ScopedWorkspaceTest.h b/Framework/API/test/ScopedWorkspaceTest.h index cd5e60f0fbcb9de5447c3dc86270a485597cdb11..1d26978bdd0e5742e90c6310e3ff1f151f021e59 100644 --- a/Framework/API/test/ScopedWorkspaceTest.h +++ b/Framework/API/test/ScopedWorkspaceTest.h @@ -179,13 +179,13 @@ public: MockWorkspace_sptr ws1 = MockWorkspace_sptr(new MockWorkspace); test.set(ws1); - TS_ASSERT_EQUALS(ws1->name(), test.name()); + TS_ASSERT_EQUALS(ws1->getName(), test.name()); MockWorkspace_sptr ws2 = MockWorkspace_sptr(new MockWorkspace); test.set(ws2); - TS_ASSERT_EQUALS(ws2->name(), test.name()); - TS_ASSERT(ws1->name().empty()); + TS_ASSERT_EQUALS(ws2->getName(), test.name()); + TS_ASSERT(ws1->getName().empty()); TS_ASSERT_EQUALS( m_ads.getObjectNames(Mantid::Kernel::DataServiceSort::Unsorted, Mantid::Kernel::DataServiceHidden::Include).size(), diff --git a/Framework/API/test/WorkspaceGroupTest.h b/Framework/API/test/WorkspaceGroupTest.h index 3ee1ac41f8cf54bdb5d7cf5e8527d151eb3ff69c..4b6ca876360bf59d30f86900e001f60e9a0478d7 100644 --- a/Framework/API/test/WorkspaceGroupTest.h +++ b/Framework/API/test/WorkspaceGroupTest.h @@ -192,7 +192,7 @@ public: void test_getItem() { WorkspaceGroup_sptr group = makeGroup(); Workspace_sptr ws1 = group->getItem(1); - TS_ASSERT_EQUALS(ws1->name(), "ws1"); + TS_ASSERT_EQUALS(ws1->getName(), "ws1"); // Test the 'by name' overload Workspace_sptr ws11 = group->getItem("ws1"); TS_ASSERT_EQUALS(ws1, ws11); diff --git a/Framework/Algorithms/src/CalculateCountRate.cpp b/Framework/Algorithms/src/CalculateCountRate.cpp index 435b111672aafe77e2d639afd322fe3d18f08eac..4aee86d8bef1906027c04d7710db7efa4794c817 100644 --- a/Framework/Algorithms/src/CalculateCountRate.cpp +++ b/Framework/Algorithms/src/CalculateCountRate.cpp @@ -151,7 +151,7 @@ void CalculateCountRate::exec() { DataObjects::EventWorkspace_sptr sourceWS = getProperty("Workspace"); API::EventType et = sourceWS->getEventType(); if (et == API::EventType::WEIGHTED_NOTIME) { - throw std::runtime_error("Event workspace " + sourceWS->name() + + throw std::runtime_error("Event workspace " + sourceWS->getName() + " contains events without necessary frame " "information. Can not process counting rate"); } @@ -510,7 +510,7 @@ void CalculateCountRate::setSourceWSandXRanges( API::MatrixWorkspace_sptr wst; if (unit->unitID() != RangeUnits) { auto conv = createChildAlgorithm("ConvertUnits", 0, 1); - std::string wsName = InputWorkspace->name(); + std::string wsName = InputWorkspace->getName(); if (wsName.empty()) { wsName = "_CountRate_UnitsConverted"; } else { diff --git a/Framework/Algorithms/src/CompareWorkspaces.cpp b/Framework/Algorithms/src/CompareWorkspaces.cpp index 9b0f7c130f327420b765d22b939da53223cbf88c..2ed328d8bd35a1db717db4cf304fb50a4fdc82a5 100644 --- a/Framework/Algorithms/src/CompareWorkspaces.cpp +++ b/Framework/Algorithms/src/CompareWorkspaces.cpp @@ -130,8 +130,10 @@ void CompareWorkspaces::exec() { std::string message = m_Messages->cell<std::string>(0, 0); g_log.notice() << "The workspaces did not match: " << message << '\n'; } else { - std::string ws1 = Workspace_const_sptr(getProperty("Workspace1"))->name(); - std::string ws2 = Workspace_const_sptr(getProperty("Workspace2"))->name(); + std::string ws1 = + Workspace_const_sptr(getProperty("Workspace1"))->getName(); + std::string ws2 = + Workspace_const_sptr(getProperty("Workspace2"))->getName(); g_log.notice() << "The workspaces \"" << ws1 << "\" and \"" << ws2 << "\" matched!\n"; } @@ -174,8 +176,8 @@ bool CompareWorkspaces::processGroups() { } if (m_Result && ws1 && ws2) { - g_log.notice() << "All workspaces in workspace groups \"" << ws1->name() - << "\" and \"" << ws2->name() << "\" matched!\n"; + g_log.notice() << "All workspaces in workspace groups \"" << ws1->getName() + << "\" and \"" << ws2->getName() << "\" matched!\n"; } setProperty("Result", m_Result); @@ -1156,11 +1158,11 @@ void CompareWorkspaces::recordMismatch(std::string msg, std::string ws1, // Workspace names default to the workspaces currently being compared if (ws1.empty()) { Workspace_const_sptr w1 = getProperty("Workspace1"); - ws1 = w1->name(); + ws1 = w1->getName(); } if (ws2.empty()) { Workspace_const_sptr w2 = getProperty("Workspace2"); - ws2 = w2->name(); + ws2 = w2->getName(); } // Add new row and flag this comparison as a mismatch diff --git a/Framework/Algorithms/src/CreateLogTimeCorrection.cpp b/Framework/Algorithms/src/CreateLogTimeCorrection.cpp index 7398d113b689e7b72f0b354e3b6480d2dc476ac6..0f949c3e9ba18f133067403b91a17ca8cf8dfe4b 100644 --- a/Framework/Algorithms/src/CreateLogTimeCorrection.cpp +++ b/Framework/Algorithms/src/CreateLogTimeCorrection.cpp @@ -49,7 +49,7 @@ void CreateLogTimeCorrection::exec() { // Check whether the output workspace name is same as input string outwsname = getPropertyValue("OutputWorkspace"); - if (outwsname.compare(m_dataWS->name()) == 0) { + if (outwsname.compare(m_dataWS->getName()) == 0) { stringstream errmsg; errmsg << "It is not allowed to use the same name by both input matrix " "workspace and output table workspace."; diff --git a/Framework/Algorithms/src/ExtractMaskToTable.cpp b/Framework/Algorithms/src/ExtractMaskToTable.cpp index c1982376720f308b7aa1e28eb17ecb97b3f9eb68..878ed6bc63941bf414a21b2d43bc489146a2024d 100644 --- a/Framework/Algorithms/src/ExtractMaskToTable.cpp +++ b/Framework/Algorithms/src/ExtractMaskToTable.cpp @@ -56,7 +56,7 @@ void ExtractMaskToTable::exec() { bool m_inputIsMask = false; if (maskws) { - g_log.notice() << "InputWorkspace " << m_dataWS->name() + g_log.notice() << "InputWorkspace " << m_dataWS->getName() << " is a MaskWorkspace.\n"; m_inputIsMask = true; } else { @@ -135,8 +135,8 @@ std::vector<detid_t> ExtractMaskToTable::parseMaskTable( chkcolumans[2] = "DetectorIDsList"; for (int i = 0; i < 3; ++i) { if (colnames[i] != chkcolumans[i]) { - g_log.error() << "Mask table workspace " << masktablews->name() << "'s " - << i << "-th column name is " << colnames[i] + g_log.error() << "Mask table workspace " << masktablews->getName() + << "'s " << i << "-th column name is " << colnames[i] << ", while it should be " << chkcolumans[i] << ". MaskWorkspace is invalid" << " and thus not used.\n"; @@ -264,7 +264,7 @@ void ExtractMaskToTable::copyTableWorkspaceContent( vector<string> targetcolnames = targetWS->getColumnNames(); if (sourcecolnames.size() != targetcolnames.size()) { stringstream errmsg; - errmsg << "Soruce table workspace " << sourceWS->name() + errmsg << "Soruce table workspace " << sourceWS->getName() << " has different number of columns (" << sourcecolnames.size() << ") than target table workspace's (" << targetcolnames.size() << ")"; diff --git a/Framework/Algorithms/src/FilterByLogValue.cpp b/Framework/Algorithms/src/FilterByLogValue.cpp index ff8975d991758b7594d216c7b5ccc9e66d15b2b0..e1901303c6cb107487454d9166af5917a72aa752 100644 --- a/Framework/Algorithms/src/FilterByLogValue.cpp +++ b/Framework/Algorithms/src/FilterByLogValue.cpp @@ -90,7 +90,7 @@ std::map<std::string, std::string> FilterByLogValue::validateInputs() { } catch (Exception::NotFoundError &) { errors["LogName"] = "The log '" + logname + "' does not exist in the workspace '" + - inputWS->name() + "'."; + inputWS->getName() + "'."; return errors; } diff --git a/Framework/Algorithms/src/FilterEvents.cpp b/Framework/Algorithms/src/FilterEvents.cpp index 43b622fcac7ea738a3719d9137059a741ad9c2ed..5607b3e7eded4095d2d1858852aad7ca0f588a17 100644 --- a/Framework/Algorithms/src/FilterEvents.cpp +++ b/Framework/Algorithms/src/FilterEvents.cpp @@ -207,7 +207,7 @@ void FilterEvents::exec() { std::vector<std::string> outputwsnames; std::map<int, DataObjects::EventWorkspace_sptr>::iterator miter; for (miter = m_outputWS.begin(); miter != m_outputWS.end(); ++miter) { - outputwsnames.push_back(miter->second->name()); + outputwsnames.push_back(miter->second->getName()); } setProperty("OutputWorkspaceNames", outputwsnames); @@ -706,13 +706,13 @@ void FilterEvents::setupCustomizedTOFCorrection() { if (toffactormap.size() > numhist) { g_log.warning() << "Input correction table workspace has more detectors (" << toffactormap.size() << ") than input workspace " - << m_eventWS->name() << "'s spectra number (" << numhist + << m_eventWS->getName() << "'s spectra number (" << numhist << ".\n"; } else if (toffactormap.size() < numhist) { stringstream errss; errss << "Input correction table workspace has more detectors (" << toffactormap.size() << ") than input workspace " - << m_eventWS->name() << "'s spectra number (" << numhist << ".\n"; + << m_eventWS->getName() << "'s spectra number (" << numhist << ".\n"; throw runtime_error(errss.str()); } @@ -751,7 +751,7 @@ void FilterEvents::setupCustomizedTOFCorrection() { stringstream errss; errss << "Detector " << "w/ ID << " << detid << " of spectrum " << i - << " in Eventworkspace " << m_eventWS->name() + << " in Eventworkspace " << m_eventWS->getName() << " cannot be found in input TOF calibration workspace. "; throw runtime_error(errss.str()); } @@ -859,12 +859,12 @@ void FilterEvents::filterEventsBySplitters(double progressamount) { Kernel::TimeSplitterType splitters = generateSplitters(wsindex); g_log.debug() << "[FilterEvents D1215]: Output workspace Index " << wsindex - << ": Name = " << opws->name() + << ": Name = " << opws->getName() << "; Number of splitters = " << splitters.size() << ".\n"; // Skip output workspace has ZERO splitters if (splitters.empty()) { - g_log.warning() << "[FilterEvents] Workspace " << opws->name() + g_log.warning() << "[FilterEvents] Workspace " << opws->getName() << " Indexed @ " << wsindex << " won't have logs splitted due to zero splitter size. " << ".\n"; @@ -982,7 +982,7 @@ void FilterEvents::splitLog(EventWorkspace_sptr eventws, std::string logname, throw std::runtime_error(errmsg.str()); } else { for (const auto &split : splitters) { - g_log.debug() << "Workspace " << eventws->name() << ": " + g_log.debug() << "Workspace " << eventws->getName() << ": " << "log name = " << logname << ", duration = " << split.duration() << " from " << split.start() << " to " << split.stop() << ".\n"; diff --git a/Framework/Algorithms/src/FindPeakBackground.cpp b/Framework/Algorithms/src/FindPeakBackground.cpp index baa9eae793baf5370c59f41431744880678de6f9..14dd2427f6a7afd067867021c84bc0bf9546f902 100644 --- a/Framework/Algorithms/src/FindPeakBackground.cpp +++ b/Framework/Algorithms/src/FindPeakBackground.cpp @@ -85,7 +85,7 @@ void FindPeakBackground::exec() { } else if (inpwsindex < 0 || inpwsindex >= static_cast<int>(inpWS->getNumberHistograms())) { stringstream errss; - errss << "Input workspace " << inpWS->name() << " has " + errss << "Input workspace " << inpWS->getName() << " has " << inpWS->getNumberHistograms() << " spectra. Input workspace index " << inpwsindex << " is out of boundary. "; throw runtime_error(errss.str()); diff --git a/Framework/Algorithms/src/GroupWorkspaces.cpp b/Framework/Algorithms/src/GroupWorkspaces.cpp index 0c6e692ebe01705c324257c8c66049da88f26d33..d4e5b9eb9a01d3abe006cced6f94dc7ef0499cc5 100644 --- a/Framework/Algorithms/src/GroupWorkspaces.cpp +++ b/Framework/Algorithms/src/GroupWorkspaces.cpp @@ -64,7 +64,7 @@ void GroupWorkspaces::addToGroup(const API::Workspace_sptr &workspace) { if (localGroup) { addToGroup(localGroup->getNames()); // Remove the group from the ADS - AnalysisDataService::Instance().remove(workspace->name()); + AnalysisDataService::Instance().remove(workspace->getName()); } else { m_group->addWorkspace(workspace); } diff --git a/Framework/Algorithms/src/InvertMask.cpp b/Framework/Algorithms/src/InvertMask.cpp index d767d4c6d77033595cc6366e357444990f880d85..52710f4feea7046c470c8d3f35c0a2d4648b8f78 100644 --- a/Framework/Algorithms/src/InvertMask.cpp +++ b/Framework/Algorithms/src/InvertMask.cpp @@ -34,7 +34,7 @@ void InvertMask::exec() { // 2. Do Invert by calling Child Algorithm API::IAlgorithm_sptr invert = createChildAlgorithm("BinaryOperateMasks", 0.0, 1.0, true); - invert->setPropertyValue("InputWorkspace1", inWS->name()); + invert->setPropertyValue("InputWorkspace1", inWS->getName()); invert->setProperty("OperationType", "NOT"); invert->setProperty("OutputWorkspace", "tempws"); diff --git a/Framework/Algorithms/src/MaskBinsFromTable.cpp b/Framework/Algorithms/src/MaskBinsFromTable.cpp index 81b0850543db77fa84f0a805123c801970a47386..08d18b56d4f401f42e341211a5b8dd31ae177f4c 100644 --- a/Framework/Algorithms/src/MaskBinsFromTable.cpp +++ b/Framework/Algorithms/src/MaskBinsFromTable.cpp @@ -158,7 +158,7 @@ void MaskBinsFromTable::processMaskBinWorkspace( } else if (boost::algorithm::starts_with(colname, "detectorid")) { id_dets = i; } else { - g_log.warning() << "In TableWorkspace " << masktblws->name() + g_log.warning() << "In TableWorkspace " << masktblws->getName() << ", column " << i << " with name " << colname << " is not used by MaskBinsFromTable."; } diff --git a/Framework/Algorithms/src/MergeRuns.cpp b/Framework/Algorithms/src/MergeRuns.cpp index 3beab65d7afd6ec7895b67eef6358482613085ff..863df32806da78f8da44dc18e4ab8485e43d1d6a 100644 --- a/Framework/Algorithms/src/MergeRuns.cpp +++ b/Framework/Algorithms/src/MergeRuns.cpp @@ -159,7 +159,7 @@ void MergeRuns::exec() { sampleLogsBehaviour.setUpdatedSampleLogs(*outWS); } catch (std::invalid_argument &e) { g_log.error() - << "Could not merge run: " << it->get()->name() << ". Reason: \"" + << "Could not merge run: " << it->get()->getName() << ". Reason: \"" << e.what() << "\". MergeRuns will continue but this run will be skipped."; sampleLogsBehaviour.resetSampleLogs(*outWS); diff --git a/Framework/Algorithms/src/MergeRuns/SampleLogsBehaviour.cpp b/Framework/Algorithms/src/MergeRuns/SampleLogsBehaviour.cpp index 586a856801b0363baaca5fbeb0940763596898bd..a6d60412ff163d357791f65183865aafefb71cd8 100644 --- a/Framework/Algorithms/src/MergeRuns/SampleLogsBehaviour.cpp +++ b/Framework/Algorithms/src/MergeRuns/SampleLogsBehaviour.cpp @@ -444,7 +444,7 @@ void SampleLogsBehaviour::checkWarnProperty(const MatrixWorkspace &addeeWS, if (!isWithinTolerance(behaviour, addeeWSNumber, outWSNumber) && !stringPropertiesMatch(behaviour, addeeWSProperty)) { m_logger.warning() << generateDifferenceMessage( - name, addeeWS.name(), addeeWSProperty->value(), + name, addeeWS.getName(), addeeWSProperty->value(), behaviour.property->value()); } } @@ -470,7 +470,7 @@ void SampleLogsBehaviour::checkErrorProperty( if (!isWithinTolerance(behaviour, addeeWSNumber, outWSNumber) && !stringPropertiesMatch(behaviour, addeeWSProperty)) { throw std::invalid_argument(generateDifferenceMessage( - name, addeeWS.name(), addeeWSProperty->value(), + name, addeeWS.getName(), addeeWSProperty->value(), behaviour.property->value())); } } diff --git a/Framework/Algorithms/src/PDDetermineCharacterizations.cpp b/Framework/Algorithms/src/PDDetermineCharacterizations.cpp index 703842019ae7473f7a5cf57134d676622a75767c..82864cfa1812978a46e56679c97d1d89d055729e 100644 --- a/Framework/Algorithms/src/PDDetermineCharacterizations.cpp +++ b/Framework/Algorithms/src/PDDetermineCharacterizations.cpp @@ -227,7 +227,7 @@ void PDDetermineCharacterizations::getInformationFromTable( columnNames.end()) { g_log.warning() << "Failed to find container name \"" << canName << "\" in characterizations table \"" - << m_characterizations->name() << "\"\n"; + << m_characterizations->getName() << "\"\n"; } else { const auto canRuns = m_characterizations->getRef<std::string>(canName, i); diff --git a/Framework/Algorithms/src/ReflectometryReductionOneAuto.cpp b/Framework/Algorithms/src/ReflectometryReductionOneAuto.cpp index 812bfcfceda57568ff87887a4299bf5bfb2d4322..ca95d270a211bff87c2741a947bbe2d0697d463e 100644 --- a/Framework/Algorithms/src/ReflectometryReductionOneAuto.cpp +++ b/Framework/Algorithms/src/ReflectometryReductionOneAuto.cpp @@ -751,12 +751,13 @@ bool ReflectometryReductionOneAuto::processGroups() { // Otherwise, if polarization correction is off, we process them // using one transmission group member at a time. if (firstTransG && !isPolarizationCorrectionOn) // polarization off - alg->setProperty("FirstTransmissionRun", firstTransG->getItem(i)->name()); + alg->setProperty("FirstTransmissionRun", + firstTransG->getItem(i)->getName()); if (secondTransG && !isPolarizationCorrectionOn) // polarization off alg->setProperty("SecondTransmissionRun", - secondTransG->getItem(i)->name()); + secondTransG->getItem(i)->getName()); - alg->setProperty("InputWorkspace", group->getItem(i)->name()); + alg->setProperty("InputWorkspace", group->getItem(i)->getName()); alg->setProperty("OutputWorkspace", IvsQName); alg->setProperty("OutputWorkspaceWavelength", IvsLamName); alg->execute(); diff --git a/Framework/Algorithms/src/RenameWorkspace.cpp b/Framework/Algorithms/src/RenameWorkspace.cpp index 5659b7e1e4f2cdba9228966ea89f0a51c131f877..07c0df28de1da37a70cb53947c1b3b9efe9a80f3 100644 --- a/Framework/Algorithms/src/RenameWorkspace.cpp +++ b/Framework/Algorithms/src/RenameWorkspace.cpp @@ -132,7 +132,7 @@ void RenameWorkspace::exec() { bool RenameWorkspace::processGroups() { // Get the input & output workspace names Workspace_sptr inputWS = getProperty("InputWorkspace"); - const std::string inputwsName = inputWS->name(); + const std::string inputwsName = inputWS->getName(); std::string outputwsName = getPropertyValue("OutputWorkspace"); if (inputwsName == outputwsName) { diff --git a/Framework/Algorithms/src/Stitch1DMany.cpp b/Framework/Algorithms/src/Stitch1DMany.cpp index 482b4c769eb05fd71c71d9632cf54a9d7ec0c14e..2de76ca2fd2a5288506963f6f95b46e1907e9a66 100644 --- a/Framework/Algorithms/src/Stitch1DMany.cpp +++ b/Framework/Algorithms/src/Stitch1DMany.cpp @@ -209,7 +209,7 @@ void Stitch1DMany::exec() { std::string outName = groupName; for (auto &groupWorkspace : groupWorkspaces) { - const std::string wsName = groupWorkspace->getItem(i)->name(); + const std::string &wsName = groupWorkspace->getItem(i)->getName(); toProcess.push_back(wsName); outName += "_" + wsName; } diff --git a/Framework/Algorithms/src/SumEventsByLogValue.cpp b/Framework/Algorithms/src/SumEventsByLogValue.cpp index e344885039b609ef9e7d3c2f168ade6299099383..a44d36d3956a61b468bf7ff215cec14b7989a49c 100644 --- a/Framework/Algorithms/src/SumEventsByLogValue.cpp +++ b/Framework/Algorithms/src/SumEventsByLogValue.cpp @@ -82,7 +82,7 @@ std::map<std::string, std::string> SumEventsByLogValue::validateInputs() { } catch (Exception::NotFoundError &) { errors["LogName"] = "The log '" + m_logName + "' does not exist in the workspace '" + - m_inputWorkspace->name() + "'."; + m_inputWorkspace->getName() + "'."; return errors; } diff --git a/Framework/Algorithms/test/CalculateResolutionTest.h b/Framework/Algorithms/test/CalculateResolutionTest.h index 59983ec67fae22d4207dbf4c4055511b97afc77b..19ed6d382072a7be8504d38a8583a7a4e363f238 100644 --- a/Framework/Algorithms/test/CalculateResolutionTest.h +++ b/Framework/Algorithms/test/CalculateResolutionTest.h @@ -24,7 +24,7 @@ public: CalculateResolution alg; alg.initialize(); - alg.setPropertyValue("Workspace", ws->name()); + alg.setPropertyValue("Workspace", ws->getName()); alg.setProperty("TwoTheta", 1.0); TS_ASSERT_THROWS_NOTHING(alg.execute()); TS_ASSERT(alg.isExecuted()); @@ -39,7 +39,7 @@ public: CalculateResolution alg; alg.initialize(); - alg.setPropertyValue("Workspace", ws->name()); + alg.setPropertyValue("Workspace", ws->getName()); alg.setProperty("TwoTheta", 1.0); TS_ASSERT_THROWS_NOTHING(alg.execute()); TS_ASSERT(alg.isExecuted()); diff --git a/Framework/Algorithms/test/ClearInstrumentParametersTest.h b/Framework/Algorithms/test/ClearInstrumentParametersTest.h index a07280e353ade6587cf07c9a9ce73b2e455cbdd4..ab4803c926981034acab8d84498a5fe6dac9b708 100644 --- a/Framework/Algorithms/test/ClearInstrumentParametersTest.h +++ b/Framework/Algorithms/test/ClearInstrumentParametersTest.h @@ -61,7 +61,7 @@ public: void clearParameters() { ClearInstrumentParameters clearer; TS_ASSERT_THROWS_NOTHING(clearer.initialize()); - clearer.setPropertyValue("Workspace", m_ws->name()); + clearer.setPropertyValue("Workspace", m_ws->getName()); TS_ASSERT_THROWS_NOTHING(clearer.execute()); TS_ASSERT(clearer.isExecuted()); } diff --git a/Framework/Algorithms/test/CloneWorkspaceTest.h b/Framework/Algorithms/test/CloneWorkspaceTest.h index 75d07e833f972aad8aae269bb92af5b24c886fd8..fba9e16d1537a2598ad885b50052894a6ac929d6 100644 --- a/Framework/Algorithms/test/CloneWorkspaceTest.h +++ b/Framework/Algorithms/test/CloneWorkspaceTest.h @@ -166,19 +166,19 @@ public: // Try to get the first member TS_ASSERT_THROWS_NOTHING(out1 = outgroup->getItem(0)) // Check its name - TS_ASSERT_EQUALS(out1->name(), "clonedgroup_1") + TS_ASSERT_EQUALS(out1->getName(), "clonedgroup_1") // Check it is indeed a different workspace TS_ASSERT_DIFFERS(out1, ingroup->getItem(0)) // Try to get the second member TS_ASSERT_THROWS_NOTHING(out2 = outgroup->getItem(1)) // Check its name - TS_ASSERT_EQUALS(out2->name(), "clonedgroup_2") + TS_ASSERT_EQUALS(out2->getName(), "clonedgroup_2") // Check it is indeed a different workspace TS_ASSERT_DIFFERS(out2, ingroup->getItem(1)) // Try to get the third member TS_ASSERT_THROWS_NOTHING(out3 = outgroup->getItem(2)) // Check its name - TS_ASSERT_EQUALS(out3->name(), "clonedgroup_3") + TS_ASSERT_EQUALS(out3->getName(), "clonedgroup_3") // Check it is indeed a different workspace TS_ASSERT_DIFFERS(out3, ingroup->getItem(2)) diff --git a/Framework/Algorithms/test/CopyLogsTest.h b/Framework/Algorithms/test/CopyLogsTest.h index 09b8212b47e9fabb8875e71ca563f7c97a76518d..a182ab0a032de87d0c722c7546d9b9e05c4227ca 100644 --- a/Framework/Algorithms/test/CopyLogsTest.h +++ b/Framework/Algorithms/test/CopyLogsTest.h @@ -37,7 +37,7 @@ public: runAlg(inputWs, outputWs, mode); - WorkspaceCreationHelper::removeWS(outputWs->name()); + WorkspaceCreationHelper::removeWS(outputWs->getName()); } void test_mergeReplaceExisting() { @@ -67,7 +67,7 @@ public: TS_ASSERT_EQUALS(run.getLogData("B")->value(), "World"); TS_ASSERT_EQUALS(run.getLogData("C")->value(), "1"); - WorkspaceCreationHelper::removeWS(outputWs->name()); + WorkspaceCreationHelper::removeWS(outputWs->getName()); } void test_mergeKeepExisting() { @@ -97,7 +97,7 @@ public: TS_ASSERT_EQUALS(run.getLogData("B")->value(), "Universe"); TS_ASSERT_EQUALS(run.getLogData("C")->value(), "1"); - WorkspaceCreationHelper::removeWS(outputWs->name()); + WorkspaceCreationHelper::removeWS(outputWs->getName()); } void test_wipeExisting() { @@ -127,7 +127,7 @@ public: TS_ASSERT_EQUALS(run.getLogData("B")->value(), "World"); TS_ASSERT_THROWS_ANYTHING(run.getLogData("C")); - WorkspaceCreationHelper::removeWS(outputWs->name()); + WorkspaceCreationHelper::removeWS(outputWs->getName()); } // Run the Copy Logs algorithm diff --git a/Framework/Algorithms/test/EstimateResolutionDiffractionTest.h b/Framework/Algorithms/test/EstimateResolutionDiffractionTest.h index b409f3710e8c3120d2b1c8f526dcf01ec25d10d3..90ae83b702172df851add8ad68bcabc0133cf85b 100644 --- a/Framework/Algorithms/test/EstimateResolutionDiffractionTest.h +++ b/Framework/Algorithms/test/EstimateResolutionDiffractionTest.h @@ -49,7 +49,7 @@ public: alg.initialize(); TS_ASSERT_THROWS_NOTHING( - alg.setPropertyValue("InputWorkspace", ws->name())); + alg.setPropertyValue("InputWorkspace", ws->getName())); TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("OutputWorkspace", "PG3_Resolution")); TS_ASSERT_THROWS_NOTHING(alg.setProperty("DeltaTOF", 40.0)); diff --git a/Framework/Algorithms/test/FilterEventsTest.h b/Framework/Algorithms/test/FilterEventsTest.h index 9d0185849632649cd6daf5892db30848e5b69804..a27169c7a7b92f76332d973b1da5f002cebd2c64 100644 --- a/Framework/Algorithms/test/FilterEventsTest.h +++ b/Framework/Algorithms/test/FilterEventsTest.h @@ -429,7 +429,7 @@ public: FilterEvents filter; filter.initialize(); - filter.setProperty("InputWorkspace", ws->name()); + filter.setProperty("InputWorkspace", ws->getName()); filter.setProperty("OutputWorkspaceBaseName", "SplittedDataDG"); filter.setProperty("CorrectionToSample", "Direct"); filter.setProperty("SplitterWorkspace", "SplitterTableX"); diff --git a/Framework/Algorithms/test/MergeRunsTest.h b/Framework/Algorithms/test/MergeRunsTest.h index b513908002c6dd86bed0655a54b98e3d97e9ce2d..3666a269bb4b7ba96ba6509a42449e9e6b5f4227 100644 --- a/Framework/Algorithms/test/MergeRunsTest.h +++ b/Framework/Algorithms/test/MergeRunsTest.h @@ -231,7 +231,7 @@ private: MergeRuns alg; alg.initialize(); TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue( - "InputWorkspaces", input->name() + "," + input->name())); + "InputWorkspaces", input->getName() + "," + input->getName())); TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("OutputWorkspace", "out")); TS_ASSERT_THROWS_NOTHING(alg.execute()); MatrixWorkspace_sptr wsOut = Mantid::API::AnalysisDataService::Instance() @@ -831,7 +831,7 @@ public: MergeRuns alg; alg.setRethrows(true); alg.initialize(); - alg.setPropertyValue("InputWorkspaces", a->name() + "," + b->name()); + alg.setPropertyValue("InputWorkspaces", a->getName() + "," + b->getName()); alg.setPropertyValue("OutputWorkspace", "out"); TS_ASSERT_THROWS_ANYTHING(alg.execute()); } @@ -879,7 +879,7 @@ public: MergeRuns alg; alg.initialize(); TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue( - "InputWorkspaces", input->name() + "," + input->name())); + "InputWorkspaces", input->getName() + "," + input->getName())); TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("OutputWorkspace", "outer")); TS_ASSERT_THROWS_NOTHING(alg.execute()); WorkspaceGroup_sptr wsgroup = @@ -957,7 +957,7 @@ public: const bool noOutput = false) { TS_ASSERT_THROWS_NOTHING( - alg.setPropertyValue("InputWorkspaces", input->name())); + alg.setPropertyValue("InputWorkspaces", input->getName())); TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("OutputWorkspace", "outWS")); TS_ASSERT_THROWS_NOTHING(alg.execute()); @@ -1264,7 +1264,7 @@ public: MergeRuns alg; alg.initialize(); - alg.setPropertyValue("InputWorkspaces", ws->name()); + alg.setPropertyValue("InputWorkspaces", ws->getName()); alg.setPropertyValue("OutputWorkspace", "outWS"); TS_ASSERT_THROWS_NOTHING(alg.execute()); @@ -1299,7 +1299,7 @@ public: MergeRuns alg; alg.initialize(); - alg.setPropertyValue("InputWorkspaces", ws->name()); + alg.setPropertyValue("InputWorkspaces", ws->getName()); alg.setPropertyValue("OutputWorkspace", "outWS1"); TS_ASSERT_THROWS_NOTHING(alg.execute()); @@ -1308,7 +1308,7 @@ public: MergeRuns alg2; alg2.initialize(); - alg2.setPropertyValue("InputWorkspaces", ws2->name()); + alg2.setPropertyValue("InputWorkspaces", ws2->getName()); alg2.setPropertyValue("OutputWorkspace", "outWS2"); TS_ASSERT_THROWS_NOTHING(alg2.execute()); @@ -1347,7 +1347,7 @@ public: MergeRuns alg; alg.initialize(); - alg.setPropertyValue("InputWorkspaces", ws->name()); + alg.setPropertyValue("InputWorkspaces", ws->getName()); alg.setPropertyValue("OutputWorkspace", "outWS1"); TS_ASSERT_THROWS_NOTHING(alg.execute()); diff --git a/Framework/Algorithms/test/RenameWorkspaceTest.h b/Framework/Algorithms/test/RenameWorkspaceTest.h index 13ec396a214bbd36c52fc57efe4a5e86e2b07235..936fc0c4182f2b866f43741ab1f386e911c48e34 100644 --- a/Framework/Algorithms/test/RenameWorkspaceTest.h +++ b/Framework/Algorithms/test/RenameWorkspaceTest.h @@ -146,9 +146,9 @@ public: // course TS_ASSERT_EQUALS(resultGroup->size(), 2) TS_ASSERT_EQUALS(resultGroup->getItem(0), member1) - TS_ASSERT_EQUALS(resultGroup->getItem(0)->name(), "newName_1") + TS_ASSERT_EQUALS(resultGroup->getItem(0)->getName(), "newName_1") TS_ASSERT_EQUALS(resultGroup->getItem(1), member2) - TS_ASSERT_EQUALS(resultGroup->getItem(1)->name(), "newName_2") + TS_ASSERT_EQUALS(resultGroup->getItem(1)->getName(), "newName_2") // The old ones should not be in the ADS TS_ASSERT_THROWS(ads.retrieve("oldName"), Mantid::Kernel::Exception::NotFoundError) diff --git a/Framework/Algorithms/test/SetUncertaintiesTest.h b/Framework/Algorithms/test/SetUncertaintiesTest.h index cb727e71e085afc5ecd15b6c20f15da944440540..1fb51ce41ce14233ecb82d72c6dafd8c80a8984d 100644 --- a/Framework/Algorithms/test/SetUncertaintiesTest.h +++ b/Framework/Algorithms/test/SetUncertaintiesTest.h @@ -58,7 +58,7 @@ public: TS_ASSERT_EQUALS(item, 0.); } - API::AnalysisDataService::Instance().remove(outWS->name()); + API::AnalysisDataService::Instance().remove(outWS->getName()); } void test_sqrt() { @@ -70,7 +70,7 @@ public: TS_ASSERT_DELTA(Y[i], E[i] * E[i], .001); } - API::AnalysisDataService::Instance().remove(outWS->name()); + API::AnalysisDataService::Instance().remove(outWS->getName()); } void test_oneIfZero() { @@ -80,7 +80,7 @@ public: for (const auto item : E) { TS_ASSERT(item > 0.); } - API::AnalysisDataService::Instance().remove(outWS->name()); + API::AnalysisDataService::Instance().remove(outWS->getName()); } void test_sqrtOrOne() { @@ -96,7 +96,7 @@ public: } } - API::AnalysisDataService::Instance().remove(outWS->name()); + API::AnalysisDataService::Instance().remove(outWS->getName()); } }; diff --git a/Framework/Crystal/src/GoniometerAnglesFromPhiRotation.cpp b/Framework/Crystal/src/GoniometerAnglesFromPhiRotation.cpp index 182a1499f49970e396ffecc378427994717d1fb3..797cfa9f3ef42c9bcc92cec397b5f5783f15edc5 100644 --- a/Framework/Crystal/src/GoniometerAnglesFromPhiRotation.cpp +++ b/Framework/Crystal/src/GoniometerAnglesFromPhiRotation.cpp @@ -162,9 +162,9 @@ void GoniometerAnglesFromPhiRotation::exec() { if (!PeaksRun1->sample().hasOrientedLattice()) { g_log.notice(std::string("Could not find UB for ") + - std::string(PeaksRun1->name())); + std::string(PeaksRun1->getName())); throw std::invalid_argument(std::string("Could not find UB for ") + - std::string(PeaksRun1->name())); + std::string(PeaksRun1->getName())); } } //-------------get UB raw :No goniometer---------------- @@ -179,9 +179,9 @@ void GoniometerAnglesFromPhiRotation::exec() { if (N1 < .6 * PeaksRun1->getNumberPeaks()) { g_log.notice(std::string("UB did not index well for ") + - std::string(PeaksRun1->name())); + std::string(PeaksRun1->getName())); throw std::invalid_argument(std::string("UB did not index well for ") + - std::string(PeaksRun1->name())); + std::string(PeaksRun1->getName())); } //---------------------------------------------- @@ -271,7 +271,7 @@ void GoniometerAnglesFromPhiRotation::exec() { MinData[4] = omchiphi[0]; std::string FunctionArgs = - "name=PeakHKLErrors, PeakWorkspaceName=" + PeaksRun2->name() + + "name=PeakHKLErrors, PeakWorkspaceName=" + PeaksRun2->getName() + ",OptRuns=" + RunNumStr + ",phi" + RunNumStr + "=" + boost::lexical_cast<std::string>(MinData[2]) + ",chi" + RunNumStr + "=" + boost::lexical_cast<std::string>(MinData[3]) + ",omega" + RunNumStr + diff --git a/Framework/Crystal/src/SCDPanelErrors.cpp b/Framework/Crystal/src/SCDPanelErrors.cpp index 2a778427fe0572ffed02b6b6063bc7e9e850e4ea..adbfa3643f814aa37b0fd9b650e7e9932b515fe9 100644 --- a/Framework/Crystal/src/SCDPanelErrors.cpp +++ b/Framework/Crystal/src/SCDPanelErrors.cpp @@ -324,7 +324,7 @@ void SCDPanelErrors::setupData() const { m_bank = getAttribute("Bank").asString(); - g_log.debug() << "Setting up " << m_workspace->name() << " bank " << m_bank + g_log.debug() << "Setting up " << m_workspace->getName() << " bank " << m_bank << '\n'; m_setupFinished = true; diff --git a/Framework/Crystal/test/FilterPeaksTest.h b/Framework/Crystal/test/FilterPeaksTest.h index 2b45a5dad0a188c027ad0e27907b9e3211f4bae6..6947ea9fb102f93d4da702b1a22c71e53e0c2206 100644 --- a/Framework/Crystal/test/FilterPeaksTest.h +++ b/Framework/Crystal/test/FilterPeaksTest.h @@ -127,8 +127,8 @@ public: outWS = runAlgorithm(inWS, "h+k+l", h + k + l, "<="); TS_ASSERT_EQUALS(1, outWS->getNumberPeaks()); - AnalysisDataService::Instance().remove(outWS->name()); - AnalysisDataService::Instance().remove(inWS->name()); + AnalysisDataService::Instance().remove(outWS->getName()); + AnalysisDataService::Instance().remove(inWS->getName()); } void test_filter_by_hkl_sq_sum() { @@ -153,8 +153,8 @@ public: outWS = runAlgorithm(inWS, "h^2+k^2+l^2", h * h + k * k + l * l, "<="); TS_ASSERT_EQUALS(1, outWS->getNumberPeaks()); - AnalysisDataService::Instance().remove(outWS->name()); - AnalysisDataService::Instance().remove(inWS->name()); + AnalysisDataService::Instance().remove(outWS->getName()); + AnalysisDataService::Instance().remove(inWS->getName()); } void test_filter_by_intensity() { @@ -180,8 +180,8 @@ public: outWS = runAlgorithm(inWS, "Intensity", intensity, "<="); TS_ASSERT_EQUALS(1, outWS->getNumberPeaks()); - AnalysisDataService::Instance().remove(outWS->name()); - AnalysisDataService::Instance().remove(inWS->name()); + AnalysisDataService::Instance().remove(outWS->getName()); + AnalysisDataService::Instance().remove(inWS->getName()); } void test_filter_by_signal_to_noise() { @@ -209,8 +209,8 @@ public: outWS = runAlgorithm(inWS, "Signal/Noise", ratio, "<="); TS_ASSERT_EQUALS(1, outWS->getNumberPeaks()); - AnalysisDataService::Instance().remove(outWS->name()); - AnalysisDataService::Instance().remove(inWS->name()); + AnalysisDataService::Instance().remove(outWS->getName()); + AnalysisDataService::Instance().remove(inWS->getName()); } }; diff --git a/Framework/Crystal/test/FindUBUsingLatticeParametersTest.h b/Framework/Crystal/test/FindUBUsingLatticeParametersTest.h index 55e6d2253b8cd84e4bf74afc891f6197efa4a687..540618630a36758e1c57cb74b30933ce734f9c0a 100644 --- a/Framework/Crystal/test/FindUBUsingLatticeParametersTest.h +++ b/Framework/Crystal/test/FindUBUsingLatticeParametersTest.h @@ -35,7 +35,7 @@ public: TS_ASSERT_THROWS_NOTHING(alg.initialize()) TS_ASSERT(alg.isInitialized()) TS_ASSERT_THROWS_NOTHING( - alg.setPropertyValue("PeaksWorkspace", ws->name())); + alg.setPropertyValue("PeaksWorkspace", ws->getName())); TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("a", "14.131")); TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("b", "19.247")); TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("c", "8.606")); @@ -80,7 +80,7 @@ public: TS_ASSERT_DELTA(latt.errorgamma(), 0.0906, 5e-4); // Remove workspace from the data service. - AnalysisDataService::Instance().remove(ws->name()); + AnalysisDataService::Instance().remove(ws->getName()); } void test_fixAll() { @@ -90,7 +90,7 @@ public: TS_ASSERT_THROWS_NOTHING(alg.initialize()) TS_ASSERT(alg.isInitialized()) TS_ASSERT_THROWS_NOTHING( - alg.setPropertyValue("PeaksWorkspace", ws->name())); + alg.setPropertyValue("PeaksWorkspace", ws->getName())); TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("a", "14.131")); TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("b", "19.247")); TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("c", "8.606")); @@ -127,7 +127,7 @@ public: TS_ASSERT_DELTA(latt.gamma(), 90.0, 5e-10); // Remove workspace from the data service. - AnalysisDataService::Instance().remove(ws->name()); + AnalysisDataService::Instance().remove(ws->getName()); } void test_smallNumberOfPeaks() { @@ -142,7 +142,7 @@ public: DataHandling::DeleteTableRows removeRowAlg; removeRowAlg.initialize(); - removeRowAlg.setPropertyValue("TableWorkspace", ws->name()); + removeRowAlg.setPropertyValue("TableWorkspace", ws->getName()); removeRowAlg.setProperty("Rows", rows); removeRowAlg.execute(); @@ -150,7 +150,7 @@ public: TS_ASSERT_THROWS_NOTHING(alg.initialize()) TS_ASSERT(alg.isInitialized()) TS_ASSERT_THROWS_NOTHING( - alg.setPropertyValue("PeaksWorkspace", ws->name())); + alg.setPropertyValue("PeaksWorkspace", ws->getName())); TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("a", "14.131")); TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("b", "19.247")); TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("c", "8.606")); @@ -184,7 +184,7 @@ public: TS_ASSERT_DELTA(latt.gamma(), 90.0272, 5e-4); // Remove workspace from the data service. - AnalysisDataService::Instance().remove(ws->name()); + AnalysisDataService::Instance().remove(ws->getName()); } private: diff --git a/Framework/CurveFitting/src/Algorithms/Fit.cpp b/Framework/CurveFitting/src/Algorithms/Fit.cpp index 9fedae9cd1637ca5abe1c96ed6dceb6109a02feb..f9341b161e864f711dbd3e75f82c1d7083e7452e 100644 --- a/Framework/CurveFitting/src/Algorithms/Fit.cpp +++ b/Framework/CurveFitting/src/Algorithms/Fit.cpp @@ -220,7 +220,7 @@ void Fit::execConcrete() { copyMinimizerOutput(*minimizer); if (baseName.empty()) { - baseName = ws->name(); + baseName = ws->getName(); if (baseName.empty()) { baseName = "Output"; } diff --git a/Framework/CurveFitting/src/Algorithms/FitPowderDiffPeaks.cpp b/Framework/CurveFitting/src/Algorithms/FitPowderDiffPeaks.cpp index 8caf73ba4861a83639ea45ebc0ccde45d778a4d8..fb258685fe6f96256f09798522c67271bbc9e4b5 100644 --- a/Framework/CurveFitting/src/Algorithms/FitPowderDiffPeaks.cpp +++ b/Framework/CurveFitting/src/Algorithms/FitPowderDiffPeaks.cpp @@ -2264,7 +2264,7 @@ void FitPowderDiffPeaks::importInstrumentParameterFromTable( size_t numrows = parameterWS->rowCount(); - g_log.notice() << "[DBx409] Import TableWorkspace " << parameterWS->name() + g_log.notice() << "[DBx409] Import TableWorkspace " << parameterWS->getName() << " containing " << numrows << " instrument profile parameters\n"; @@ -2328,7 +2328,7 @@ void FitPowderDiffPeaks::parseBraggPeakTable( g_log.information() << "Import " << hklmaps.size() << " entries from Bragg peak TableWorkspace " - << peakws->name() << '\n'; + << peakws->getName() << '\n'; } //---------------------------------------------------------------------------- diff --git a/Framework/CurveFitting/src/Algorithms/LeBailFit.cpp b/Framework/CurveFitting/src/Algorithms/LeBailFit.cpp index bf9914cf6e1940bcc70df53dff1ce766d4cc3afe..77ab97191de1218fc4bde3525eb5f65a5339d4c6 100644 --- a/Framework/CurveFitting/src/Algorithms/LeBailFit.cpp +++ b/Framework/CurveFitting/src/Algorithms/LeBailFit.cpp @@ -913,7 +913,7 @@ void LeBailFit::parseInstrumentParametersTable() { } else { g_log.information() << "[DB] Starting to parse instrument parameter table workspace " - << parameterWS->name() << ".\n"; + << parameterWS->getName() << ".\n"; } // 2. Import data to maps @@ -970,7 +970,7 @@ void LeBailFit::parseInstrumentParametersTable() { newparameter.name = striter->second; } else { std::stringstream errmsg; - errmsg << "Parameter (table) workspace " << parameterWS->name() + errmsg << "Parameter (table) workspace " << parameterWS->getName() << " does not contain column 'Name'. It is not a valid input. " "Quit "; g_log.error() << errmsg.str() << "\n"; @@ -991,7 +991,7 @@ void LeBailFit::parseInstrumentParametersTable() { newparameter.fit = tofit; } else { std::stringstream errmsg; - errmsg << "Parameter (table) workspace " << parameterWS->name() + errmsg << "Parameter (table) workspace " << parameterWS->getName() << " does not contain column 'FitOrTie'. It is not a valid " "input. Quit "; g_log.error() << errmsg.str() << "\n"; @@ -1004,7 +1004,7 @@ void LeBailFit::parseInstrumentParametersTable() { newparameter.curvalue = dbliter->second; } else { std::stringstream errmsg; - errmsg << "Parameter (table) workspace " << parameterWS->name() + errmsg << "Parameter (table) workspace " << parameterWS->getName() << " does not contain column 'Value'. It is not a valid input. " "Quit "; g_log.error() << errmsg.str() << "\n"; @@ -1060,7 +1060,7 @@ void LeBailFit::parseInstrumentParametersTable() { g_log.information() << "[DB]: Successfully Imported Peak Parameters TableWorkspace " - << parameterWS->name() << ". Imported " << m_funcParameters.size() + << parameterWS->getName() << ". Imported " << m_funcParameters.size() << " parameters. " << "\n"; } @@ -1151,7 +1151,7 @@ void LeBailFit::parseBackgroundTableWorkspace(TableWorkspace_sptr bkgdparamws, if (colnames.size() < 2) { stringstream errss; errss << "Input background parameter table workspace " - << bkgdparamws->name() << " has only " << colnames.size() + << bkgdparamws->getName() << " has only " << colnames.size() << " columns, which is fewer than 2 columns as required. "; g_log.error(errss.str()); throw runtime_error(errss.str()); diff --git a/Framework/CurveFitting/src/Algorithms/PlotPeakByLogValue.cpp b/Framework/CurveFitting/src/Algorithms/PlotPeakByLogValue.cpp index 498e0ccbceecd5286b85d8cf611ab8f3e0165e82..88173dae6e3d976af24b062b3b3b12a7d54abd93 100644 --- a/Framework/CurveFitting/src/Algorithms/PlotPeakByLogValue.cpp +++ b/Framework/CurveFitting/src/Algorithms/PlotPeakByLogValue.cpp @@ -272,7 +272,7 @@ void PlotPeakByLogValue::exec() { setWorkspaceIndexAttribute(ifun, j); } - g_log.debug() << "Fitting " << data.ws->name() << " index " << j + g_log.debug() << "Fitting " << data.ws->getName() << " index " << j << " with \n"; g_log.debug() << ifun->asString() << '\n'; @@ -312,7 +312,7 @@ void PlotPeakByLogValue::exec() { if (!fit->isExecuted()) { throw std::runtime_error("Fit child algorithm failed: " + - data.ws->name()); + data.ws->getName()); } ifun = fit->getProperty("Function"); diff --git a/Framework/CurveFitting/src/Algorithms/RefinePowderInstrumentParameters.cpp b/Framework/CurveFitting/src/Algorithms/RefinePowderInstrumentParameters.cpp index f415e21f1114b2e7654d70ac6c80db606816ea05..b4280596a932ff311d720a0a2b09717975a7c39c 100644 --- a/Framework/CurveFitting/src/Algorithms/RefinePowderInstrumentParameters.cpp +++ b/Framework/CurveFitting/src/Algorithms/RefinePowderInstrumentParameters.cpp @@ -965,7 +965,7 @@ void RefinePowderInstrumentParameters::importParametersFromTable( trow >> parname >> value; parameters.emplace(parname, value); } catch (runtime_error &) { - g_log.error() << "Import table workspace " << parameterWS->name() + g_log.error() << "Import table workspace " << parameterWS->getName() << " error in line " << ir << ". " << " Requires [string, double] in the first 2 columns.\n"; throw; @@ -1027,7 +1027,7 @@ void RefinePowderInstrumentParameters::importMonteCarloParametersFromTable( } catch (runtime_error &) { g_log.error() << "Import MC parameter " << colnames[ic] << " error in row " << ir << " of workspace " - << tablews->name() << '\n'; + << tablews->getName() << '\n'; row >> tmpstr; g_log.error() << "Should be " << tmpstr << '\n'; } diff --git a/Framework/CurveFitting/src/Functions/TabulatedFunction.cpp b/Framework/CurveFitting/src/Functions/TabulatedFunction.cpp index 97f44caeebb6be70ba1b9a501552044fe15e279b..f22656250454621a79ed6d0579f693db267428b1 100644 --- a/Framework/CurveFitting/src/Functions/TabulatedFunction.cpp +++ b/Framework/CurveFitting/src/Functions/TabulatedFunction.cpp @@ -258,7 +258,7 @@ void TabulatedFunction::setupData() const { size_t index = static_cast<size_t>(getAttribute("WorkspaceIndex").asInt()); - g_log.debug() << "Setting up " << m_workspace->name() << " index " << index + g_log.debug() << "Setting up " << m_workspace->getName() << " index " << index << '\n'; const auto &xData = m_workspace->points(index); diff --git a/Framework/CurveFitting/test/MultiDomainCreatorTest.h b/Framework/CurveFitting/test/MultiDomainCreatorTest.h index cb866cd96783b78a21f02f007c34bb0112a0e469..a64bfa9f5b7b86206b4be24d4f2c6d76e8dcadcf 100644 --- a/Framework/CurveFitting/test/MultiDomainCreatorTest.h +++ b/Framework/CurveFitting/test/MultiDomainCreatorTest.h @@ -233,11 +233,11 @@ public: WorkspaceGroup_sptr outWS = manager.getProperty("OUT_WS"); TS_ASSERT(outWS); - TS_ASSERT_EQUALS(outWS->getItem(0)->name(), "out_Workspace_0"); - TS_ASSERT_EQUALS(outWS->getItem(1)->name(), "out_Workspace_1"); - TS_ASSERT_EQUALS(outWS->getItem(2)->name(), "out_Workspace_2"); + TS_ASSERT_EQUALS(outWS->getItem(0)->getName(), "out_Workspace_0"); + TS_ASSERT_EQUALS(outWS->getItem(1)->getName(), "out_Workspace_1"); + TS_ASSERT_EQUALS(outWS->getItem(2)->getName(), "out_Workspace_2"); manager.store("OUT_WS"); - TS_ASSERT_EQUALS(outWS->name(), "out_Workspaces"); + TS_ASSERT_EQUALS(outWS->getName(), "out_Workspaces"); AnalysisDataService::Instance().clear(); } diff --git a/Framework/DataHandling/src/GroupDetectors2.cpp b/Framework/DataHandling/src/GroupDetectors2.cpp index e25a1f80153320eaac9fb3efaf9ef1d05083928b..a69e01b834b894cef35a6829fdb5f4b31054c8e4 100644 --- a/Framework/DataHandling/src/GroupDetectors2.cpp +++ b/Framework/DataHandling/src/GroupDetectors2.cpp @@ -271,11 +271,11 @@ void GroupDetectors2::getGroups(API::MatrixWorkspace_const_sptr workspace, groupingWS_sptr); if (groupWS) { g_log.debug() << "Extracting grouping from GroupingWorkspace (" - << groupWS->name() << ")\n"; + << groupWS->getName() << ")\n"; processGroupingWorkspace(groupWS, workspace, unUsedSpec); } else { g_log.debug() << "Extracting grouping from MatrixWorkspace (" - << groupingWS_sptr->name() << ")\n"; + << groupingWS_sptr->getName() << ")\n"; processMatrixWorkspace(groupingWS_sptr, workspace, unUsedSpec); } return; diff --git a/Framework/DataHandling/src/LoadSassena.cpp b/Framework/DataHandling/src/LoadSassena.cpp index b00d3dff3e19c93df0c161c24f2f178b1f30a4c8..c2a4f2c2315452fa606fd068621a789816b37db8 100644 --- a/Framework/DataHandling/src/LoadSassena.cpp +++ b/Framework/DataHandling/src/LoadSassena.cpp @@ -373,9 +373,9 @@ void LoadSassena::exec() { API::WorkspaceGroup_sptr gws = boost::dynamic_pointer_cast<API::WorkspaceGroup>(ows); - if (gws && API::AnalysisDataService::Instance().doesExist(gws->name())) { + if (gws && API::AnalysisDataService::Instance().doesExist(gws->getName())) { // gws->deepRemoveAll(); // remove workspace members - API::AnalysisDataService::Instance().deepRemoveGroup(gws->name()); + API::AnalysisDataService::Instance().deepRemoveGroup(gws->getName()); } else { gws = boost::make_shared<API::WorkspaceGroup>(); setProperty("OutputWorkspace", diff --git a/Framework/DataHandling/src/MaskDetectors.cpp b/Framework/DataHandling/src/MaskDetectors.cpp index 2bfc5875cb1ac700ddc732a92c23c35c28312888..7c13fa176a95d0766d519c6d5d7da903e724ab4e 100644 --- a/Framework/DataHandling/src/MaskDetectors.cpp +++ b/Framework/DataHandling/src/MaskDetectors.cpp @@ -157,8 +157,8 @@ void MaskDetectors::exec() { "between input Workspace and MaskWorkspace"); } - g_log.debug() << "Extracting mask from MaskWorkspace (" << maskWS->name() - << ")\n"; + g_log.debug() << "Extracting mask from MaskWorkspace (" + << maskWS->getName() << ")\n"; bool forceDetIDs = getProperty("ForceInstrumentMasking"); if (prevMasking->getNumberHistograms() != WS->getNumberHistograms() || forceDetIDs) { @@ -358,8 +358,8 @@ void MaskDetectors::execPeaks(PeaksWorkspace_sptr WS) { "Size mismatch between input Workspace and MaskWorkspace"); } - g_log.debug() << "Extracting mask from MaskWorkspace (" << maskWS->name() - << ")\n"; + g_log.debug() << "Extracting mask from MaskWorkspace (" + << maskWS->getName() << ")\n"; for (size_t i = 0; i < maskDetInfo.size(); ++i) if (maskDetInfo.isMasked(i)) diff --git a/Framework/DataHandling/src/SaveCalFile.cpp b/Framework/DataHandling/src/SaveCalFile.cpp index 117dd7e38cf6cb9008295600c76ffe74bd904a4f..7baa585f620ebeac83d80495ea880fbbe16e4552 100644 --- a/Framework/DataHandling/src/SaveCalFile.cpp +++ b/Framework/DataHandling/src/SaveCalFile.cpp @@ -95,7 +95,7 @@ void SaveCalFile::saveCalFile(const std::string &calFileName, doMask = true; inst = maskWS->getInstrument(); if (!inst) - g_log.warning() << "Mask workspace " << maskWS->name() + g_log.warning() << "Mask workspace " << maskWS->getName() << " has no instrument associated with." << "\n"; } diff --git a/Framework/DataHandling/src/SaveCanSAS1D.cpp b/Framework/DataHandling/src/SaveCanSAS1D.cpp index c5dc7a65e31e70b042e2ebe274232f276b4c6a9c..cea286002464d01d7d86c274ee186e0292434fc1 100644 --- a/Framework/DataHandling/src/SaveCanSAS1D.cpp +++ b/Framework/DataHandling/src/SaveCanSAS1D.cpp @@ -576,7 +576,7 @@ void SaveCanSAS1D::createSASDetectorElement(std::string &sasDet) { } else { g_log.notice() << "Detector with name " << detectorName << " does not exist in the instrument of the workspace: " - << m_workspace->name() << '\n'; + << m_workspace->getName() << '\n'; } } } diff --git a/Framework/DataHandling/src/SaveGSS.cpp b/Framework/DataHandling/src/SaveGSS.cpp index 6935f94c8752268208314dc612dabe33e73b81cb..c338cb5e684b01bb1c590e2ae57979d409890e03 100644 --- a/Framework/DataHandling/src/SaveGSS.cpp +++ b/Framework/DataHandling/src/SaveGSS.cpp @@ -114,7 +114,7 @@ void getFocusedPos(MatrixWorkspace_const_sptr wksp, const int spectrum, Geometry::IDetector_const_sptr det = wksp->getDetector(spectrum); if (!det) { std::stringstream errss; - errss << "Workspace " << wksp->name() + errss << "Workspace " << wksp->getName() << " does not have detector with spectrum " << spectrum; throw std::runtime_error(errss.str()); } diff --git a/Framework/DataHandling/test/LoadNexusProcessedTest.h b/Framework/DataHandling/test/LoadNexusProcessedTest.h index beac902bee1349f0badc5de8ad901752a6be68f4..e5dfe7fda6acd34c98d588c03e2516dc3a0e0529 100644 --- a/Framework/DataHandling/test/LoadNexusProcessedTest.h +++ b/Framework/DataHandling/test/LoadNexusProcessedTest.h @@ -466,7 +466,7 @@ public: TS_ASSERT(ws); TS_ASSERT_EQUALS(ws->getNumberHistograms(), 1); TS_ASSERT_EQUALS(ws->blocksize(), 10); - TS_ASSERT_EQUALS(ws->name(), "group_" + std::to_string(i + 1)); + TS_ASSERT_EQUALS(ws->getName(), "group_" + std::to_string(i + 1)); } } @@ -496,8 +496,8 @@ public: TS_ASSERT(ws); TS_ASSERT_EQUALS(ws->getNumberHistograms(), 1); TS_ASSERT_EQUALS(ws->blocksize(), 2); - TS_ASSERT_EQUALS(ws->name(), "irs55125_graphite002_to_55131_" + - std::string(suffix[i])); + TS_ASSERT_EQUALS(ws->getName(), "irs55125_graphite002_to_55131_" + + std::string(suffix[i])); } } @@ -527,8 +527,8 @@ public: TS_ASSERT(ws); TS_ASSERT_EQUALS(ws->getNumberHistograms(), 1); TS_ASSERT_EQUALS(ws->blocksize(), 2); - TS_ASSERT_EQUALS(ws->name(), "irs55125_graphite002_to_55131_" + - std::string(suffix[i])); + TS_ASSERT_EQUALS(ws->getName(), "irs55125_graphite002_to_55131_" + + std::string(suffix[i])); } // load same file again, but to a different group @@ -556,8 +556,8 @@ public: TS_ASSERT(ws); TS_ASSERT_EQUALS(ws->getNumberHistograms(), 1); TS_ASSERT_EQUALS(ws->blocksize(), 2); - TS_ASSERT_EQUALS(ws->name(), "irs55125_graphite002_to_55131_" + - std::string(suffix[i]) + "_1"); + TS_ASSERT_EQUALS(ws->getName(), "irs55125_graphite002_to_55131_" + + std::string(suffix[i]) + "_1"); } } diff --git a/Framework/DataHandling/test/SaveNXTomoTest.h b/Framework/DataHandling/test/SaveNXTomoTest.h index 0dc750e2dcf7b25849288e3d0c44ee0dccb043f9..d96d7e9fb574bac44415438707918c6eb3b59837 100644 --- a/Framework/DataHandling/test/SaveNXTomoTest.h +++ b/Framework/DataHandling/test/SaveNXTomoTest.h @@ -83,7 +83,7 @@ public: AnalysisDataService::Instance().add(m_inputWS + "0", input); TS_ASSERT_THROWS_NOTHING( - m_saver->setPropertyValue("InputWorkspaces", input->name())); + m_saver->setPropertyValue("InputWorkspaces", input->getName())); TS_ASSERT_THROWS_NOTHING( m_saver->setPropertyValue("Filename", m_outputFile)); m_outputFile = m_saver->getPropertyValue("Filename"); // get absolute path @@ -102,7 +102,7 @@ public: checksOnNXTomoFormat(3); // Tidy up - AnalysisDataService::Instance().remove(input->name()); + AnalysisDataService::Instance().remove(input->getName()); if (file.exists()) file.remove(); } @@ -117,7 +117,7 @@ public: AnalysisDataService::Instance().add(wsgName + "0", input); TS_ASSERT_THROWS_NOTHING( - m_saver->setPropertyValue("InputWorkspaces", input->name())); + m_saver->setPropertyValue("InputWorkspaces", input->getName())); TS_ASSERT_THROWS_NOTHING( m_saver->setPropertyValue("Filename", m_outputFile)); m_outputFile = m_saver->getPropertyValue("Filename"); // get absolute path @@ -136,7 +136,7 @@ public: checksOnNXTomoFormat(2); // Tidy up - AnalysisDataService::Instance().remove(input->name()); + AnalysisDataService::Instance().remove(input->getName()); if (file.exists()) file.remove(); } @@ -160,7 +160,7 @@ public: m_inputWS + boost::lexical_cast<std::string>(numberOfPriorWS), input); TS_ASSERT_THROWS_NOTHING( - m_saver->setPropertyValue("InputWorkspaces", input->name())); + m_saver->setPropertyValue("InputWorkspaces", input->getName())); TS_ASSERT_THROWS_NOTHING( m_saver->setPropertyValue("Filename", m_outputFile)); m_outputFile = m_saver->getPropertyValue("Filename"); // get absolute path @@ -179,7 +179,7 @@ public: checksOnNXTomoFormat(static_cast<int>(wspaces.size()) + numberOfPriorWS); // Tidy up - AnalysisDataService::Instance().remove(input->name()); + AnalysisDataService::Instance().remove(input->getName()); file.remove(); } } diff --git a/Framework/DataHandling/test/SaveParameterFileTest.h b/Framework/DataHandling/test/SaveParameterFileTest.h index 8f201b814036b5cc29862adbf70d9bacef29d4ea..99788e79d8f343f22d24778a29ec640a8bc1f48d 100644 --- a/Framework/DataHandling/test/SaveParameterFileTest.h +++ b/Framework/DataHandling/test/SaveParameterFileTest.h @@ -150,7 +150,7 @@ public: LoadParameterFile loaderPF; TS_ASSERT_THROWS_NOTHING(loaderPF.initialize()); loaderPF.setPropertyValue("Filename", filename); - loaderPF.setPropertyValue("Workspace", m_ws->name()); + loaderPF.setPropertyValue("Workspace", m_ws->getName()); TS_ASSERT_THROWS_NOTHING(loaderPF.execute()); TS_ASSERT(loaderPF.isExecuted()); } @@ -159,7 +159,7 @@ public: SaveParameterFile saverPF; TS_ASSERT_THROWS_NOTHING(saverPF.initialize()); saverPF.setPropertyValue("Filename", filename); - saverPF.setPropertyValue("Workspace", m_ws->name()); + saverPF.setPropertyValue("Workspace", m_ws->getName()); TS_ASSERT_THROWS_NOTHING(saverPF.execute()); TS_ASSERT(saverPF.isExecuted()); } diff --git a/Framework/DataObjects/src/MaskWorkspace.cpp b/Framework/DataObjects/src/MaskWorkspace.cpp index 068ced80296a7d5b9d7cf4e802305308d6060cf8..3cf1d52e8899b880e06396da409e44fccdf94200 100644 --- a/Framework/DataObjects/src/MaskWorkspace.cpp +++ b/Framework/DataObjects/src/MaskWorkspace.cpp @@ -95,7 +95,7 @@ size_t MaskWorkspace::getNumberMasked() const { } else { std::stringstream errss; errss << "No instrument is associated with mask workspace " - << this->name(); + << this->getName(); throw std::runtime_error(errss.str()); } } diff --git a/Framework/ICat/src/CatalogPublish.cpp b/Framework/ICat/src/CatalogPublish.cpp index abd34318cc546189b367e8b5ad638ecb6cab013e..5a25d57c881b3ff031a1c6a311e2236499ae5df8 100644 --- a/Framework/ICat/src/CatalogPublish.cpp +++ b/Framework/ICat/src/CatalogPublish.cpp @@ -96,10 +96,10 @@ void CatalogPublish::exec() { } else // The user wants to upload a workspace. { if (nameInCatalog.empty()) { - setProperty("NameInCatalog", workspace->name()); + setProperty("NameInCatalog", workspace->getName()); g_log.notice( "NameInCatalog has not been set. Using workspace name instead: " + - workspace->name() + "."); + workspace->getName() + "."); } // Save workspace to a .nxs file in the user's default directory. @@ -108,7 +108,7 @@ void CatalogPublish::exec() { // workspace was saved to). filePath = Mantid::Kernel::ConfigService::Instance().getString( "defaultsave.directory") + - workspace->name() + ".nxs"; + workspace->getName() + ".nxs"; } // Obtain the mode to used base on file extension. @@ -223,11 +223,11 @@ void CatalogPublish::saveWorkspaceToNexus( Mantid::API::AlgorithmManager::Instance().create("SaveNexus"); saveNexus->initialize(); // Set the required properties & execute. - saveNexus->setProperty("InputWorkspace", workspace->name()); + saveNexus->setProperty("InputWorkspace", workspace->getName()); saveNexus->setProperty("FileName", Mantid::Kernel::ConfigService::Instance().getString( "defaultsave.directory") + - workspace->name() + ".nxs"); + workspace->getName() + ".nxs"); saveNexus->execute(); } @@ -263,7 +263,7 @@ const std::string CatalogPublish::generateWorkspaceHistory( auto wsHistory = Mantid::API::AlgorithmManager::Instance().createUnmanaged( "GeneratePythonScript"); wsHistory->initialize(); - wsHistory->setProperty("InputWorkspace", workspace->name()); + wsHistory->setProperty("InputWorkspace", workspace->getName()); wsHistory->execute(); return wsHistory->getPropertyValue("ScriptText"); } diff --git a/Framework/Kernel/inc/MantidKernel/DataItem.h b/Framework/Kernel/inc/MantidKernel/DataItem.h index 0aa0b9c8349e3620f82a22b545d671ea64cdda80..fd02ec7edaab21fee142de507f7bac540e019a6a 100644 --- a/Framework/Kernel/inc/MantidKernel/DataItem.h +++ b/Framework/Kernel/inc/MantidKernel/DataItem.h @@ -63,7 +63,7 @@ public: /// A string ID for the class virtual const std::string id() const = 0; /// The name of the object - virtual const std::string name() const = 0; + virtual const std::string &getName() const = 0; /// Can this object be accessed from multiple threads safely virtual bool threadSafe() const = 0; /// Serializes the object to a string diff --git a/Framework/Kernel/inc/MantidKernel/TypedValidator.h b/Framework/Kernel/inc/MantidKernel/TypedValidator.h index 078eef53f94f15166fd966d54401b18413d031a7..eb83c0be3a35a178671b9125d00622f4f1915a62 100644 --- a/Framework/Kernel/inc/MantidKernel/TypedValidator.h +++ b/Framework/Kernel/inc/MantidKernel/TypedValidator.h @@ -132,7 +132,7 @@ private: ElementType_sptr typedValue = boost::dynamic_pointer_cast<ElementType>(data); if (!typedValue) { - throw std::invalid_argument("DataItem \"" + data->name() + + throw std::invalid_argument("DataItem \"" + data->getName() + "\" is not of the expected type."); } return typedValue; diff --git a/Framework/Kernel/test/PropertyWithValueTest.h b/Framework/Kernel/test/PropertyWithValueTest.h index dcc38f6c99c25ecc6a9bbf5d4cccb8169784436c..ad414b6601916b6ad457e779d6bc4c95a8b5b0bf 100644 --- a/Framework/Kernel/test/PropertyWithValueTest.h +++ b/Framework/Kernel/test/PropertyWithValueTest.h @@ -164,17 +164,23 @@ public: private: class DataObjectOne : public DataItem { - const std::string name() const override { return "MyName1"; }; + const std::string &getName() const override { return m_name; }; const std::string id() const override { return "DataObjectOne"; } bool threadSafe() const override { return true; } - const std::string toString() const override { return name(); } + const std::string toString() const override { return m_name; } + + private: + std::string m_name{"MyName1"}; }; class DataObjectTwo : public DataItem { - const std::string name() const override { return "MyName2"; }; + const std::string &getName() const override { return m_name; }; const std::string id() const override { return "DataObjectTwo"; } bool threadSafe() const override { return true; } - const std::string toString() const override { return name(); } + const std::string toString() const override { return m_name; } + + private: + std::string m_name{"MyName2"}; }; public: diff --git a/Framework/Kernel/test/ReadLockTest.h b/Framework/Kernel/test/ReadLockTest.h index 5ba6b4ba0788fbfdaf6cd80655454033e08da676..348aaed4661654baf9abcfefdafd65cd1bd3f65d 100644 --- a/Framework/Kernel/test/ReadLockTest.h +++ b/Framework/Kernel/test/ReadLockTest.h @@ -13,12 +13,15 @@ class MockDataItem : public DataItem { public: const std::string id() const override { return "MockDataItem"; } /// The name of the object - const std::string name() const override { return "Noone"; } + const std::string &getName() const override { return m_name; } /// Can this object be accessed from multiple threads safely bool threadSafe() const override { return true; } /// Serializes the object to a string const std::string toString() const override { return "Nothing"; } friend class ReadLockTest; + +private: + std::string m_name{"Noone"}; }; class ReadLockTest : public CxxTest::TestSuite { diff --git a/Framework/Kernel/test/TypedValidatorTest.h b/Framework/Kernel/test/TypedValidatorTest.h index 9e19b13d2a7a9bf72f19f78f99bbaf707e18d1c8..1f30741db24eb6ec59a98131c1977ab74200e4da 100644 --- a/Framework/Kernel/test/TypedValidatorTest.h +++ b/Framework/Kernel/test/TypedValidatorTest.h @@ -24,9 +24,12 @@ DECLARE_TEST_VALIDATOR(PODTypedValidator, double) class FakeDataItem : public Mantid::Kernel::DataItem { public: const std::string id() const override { return "FakeDataItem"; } - const std::string name() const override { return "Empty"; } + const std::string &getName() const override { return m_name; } bool threadSafe() const override { return true; } const std::string toString() const override { return "FakeDataItem{}"; } + +private: + std::string m_name{"Empty"}; }; DECLARE_TEST_VALIDATOR(DataItemSptrTypedValidator, boost::shared_ptr<FakeDataItem>) diff --git a/Framework/Kernel/test/WriteLockTest.h b/Framework/Kernel/test/WriteLockTest.h index 1748b14ddd7614fe5cd5485b4905498fdd9029af..3cdb766a186160698d1d77d3dd96638844bcb976 100644 --- a/Framework/Kernel/test/WriteLockTest.h +++ b/Framework/Kernel/test/WriteLockTest.h @@ -13,12 +13,15 @@ class MockDataItem : public DataItem { public: const std::string id() const override { return "MockDataItem"; } /// The name of the object - const std::string name() const override { return "Noone"; } + const std::string &getName() const override { return m_name; } /// Can this object be accessed from multiple threads safely bool threadSafe() const override { return true; } /// Serializes the object to a string const std::string toString() const override { return "Nothing"; } friend class WriteLockTest; + +private: + std::string m_name{"Noone"}; }; class WriteLockTest : public CxxTest::TestSuite { diff --git a/Framework/LiveData/src/LoadLiveData.cpp b/Framework/LiveData/src/LoadLiveData.cpp index 7d47082628a32fca93206d5dbc5218d5dac64989..a556f6c2f5f976ce43cb0c1906f0f27a8371b952 100644 --- a/Framework/LiveData/src/LoadLiveData.cpp +++ b/Framework/LiveData/src/LoadLiveData.cpp @@ -374,7 +374,7 @@ void LoadLiveData::doSortEvents(Mantid::API::Workspace_sptr ws) { alg->setProperty("InputWorkspace", eventWS); alg->setPropertyValue("SortBy", "X Value"); alg->executeAsChildAlg(); - g_log.debug() << tim << " to perform SortEvents on " << ws->name() << '\n'; + g_log.debug() << tim << " to perform SortEvents on " << ws->getName() << '\n'; } //---------------------------------------------------------------------------------------------- @@ -509,7 +509,7 @@ void LoadLiveData::exec() { size_t n = static_cast<size_t>(out_gws->getNumberOfEntries()); for (size_t i = 0; i < n; ++i) { auto ws = out_gws->getItem(i); - std::string itemName = ws->name(); + const std::string &itemName = ws->getName(); std::string wsName = getPropertyValue("OutputWorkspace") + "_" + std::to_string(i + 1); if (wsName != itemName) { diff --git a/Framework/LiveData/test/LoadLiveDataTest.h b/Framework/LiveData/test/LoadLiveDataTest.h index ad1bb0c04451a1d7724f39b1ff271b7a5a45fa16..f898f70305edca933bc8ea9757598e62a1d00d0d 100644 --- a/Framework/LiveData/test/LoadLiveDataTest.h +++ b/Framework/LiveData/test/LoadLiveDataTest.h @@ -322,7 +322,7 @@ public: ILiveListener_sptr(new TestGroupDataListener)); TS_ASSERT(ws); TS_ASSERT_EQUALS(ws->getNumberOfEntries(), 3); - TS_ASSERT_EQUALS(ws->name(), "fake"); + TS_ASSERT_EQUALS(ws->getName(), "fake"); MatrixWorkspace_sptr mws = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>("fake_2"); TS_ASSERT(mws); @@ -342,7 +342,7 @@ public: ILiveListener_sptr(new TestGroupDataListener)); TS_ASSERT(ws); TS_ASSERT_EQUALS(ws->getNumberOfEntries(), 3); - TS_ASSERT_EQUALS(ws->name(), "fake"); + TS_ASSERT_EQUALS(ws->getName(), "fake"); MatrixWorkspace_sptr mws = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>("fake_2"); TS_ASSERT(mws); @@ -362,7 +362,7 @@ public: ILiveListener_sptr(new TestGroupDataListener)); TS_ASSERT(ws); TS_ASSERT_EQUALS(ws->getNumberOfEntries(), 3); - TS_ASSERT_EQUALS(ws->name(), "fake"); + TS_ASSERT_EQUALS(ws->getName(), "fake"); MatrixWorkspace_sptr mws = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>("fake_2"); TS_ASSERT(mws); @@ -385,7 +385,7 @@ public: ILiveListener_sptr(new TestGroupDataListener)); TS_ASSERT(ws); TS_ASSERT_EQUALS(ws->getNumberOfEntries(), 3); - TS_ASSERT_EQUALS(ws->name(), "fake"); + TS_ASSERT_EQUALS(ws->getName(), "fake"); MatrixWorkspace_sptr mws = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>("fake_2"); TS_ASSERT(mws); @@ -407,7 +407,7 @@ public: ILiveListener_sptr(new TestGroupDataListener)); TS_ASSERT(ws); TS_ASSERT_EQUALS(ws->getNumberOfEntries(), 3); - TS_ASSERT_EQUALS(ws->name(), "fake"); + TS_ASSERT_EQUALS(ws->getName(), "fake"); MatrixWorkspace_sptr mws = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>("fake_2"); TS_ASSERT(mws); @@ -429,7 +429,7 @@ public: ILiveListener_sptr(new TestGroupDataListener)); TS_ASSERT(ws); TS_ASSERT_EQUALS(ws->getNumberOfEntries(), 3); - TS_ASSERT_EQUALS(ws->name(), "fake"); + TS_ASSERT_EQUALS(ws->getName(), "fake"); MatrixWorkspace_sptr mws = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>("fake_2"); TS_ASSERT(mws); @@ -452,7 +452,7 @@ public: ILiveListener_sptr(new TestGroupDataListener)); TS_ASSERT(ws); TS_ASSERT_EQUALS(ws->getNumberOfEntries(), 3); - TS_ASSERT_EQUALS(ws->name(), "fake"); + TS_ASSERT_EQUALS(ws->getName(), "fake"); MatrixWorkspace_sptr mws = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>("fake_2"); TS_ASSERT(mws); @@ -474,7 +474,7 @@ public: ILiveListener_sptr(new TestGroupDataListener)); TS_ASSERT(ws); TS_ASSERT_EQUALS(ws->getNumberOfEntries(), 3); - TS_ASSERT_EQUALS(ws->name(), "fake"); + TS_ASSERT_EQUALS(ws->getName(), "fake"); MatrixWorkspace_sptr mws = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>("fake_2"); TS_ASSERT(mws); @@ -496,7 +496,7 @@ public: ILiveListener_sptr(new TestGroupDataListener)); TS_ASSERT(ws); TS_ASSERT_EQUALS(ws->getNumberOfEntries(), 3); - TS_ASSERT_EQUALS(ws->name(), "fake"); + TS_ASSERT_EQUALS(ws->getName(), "fake"); MatrixWorkspace_sptr mws = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>("fake_2"); TS_ASSERT(mws); diff --git a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDWSDescription.h b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDWSDescription.h index 2b17821ecadc3bf03afe0bf9c06f5848cbfb8c41..53d03df7f08e4bbeec6e7d7c9240b8b3cdacc362 100644 --- a/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDWSDescription.h +++ b/Framework/MDAlgorithms/inc/MantidMDAlgorithms/MDWSDescription.h @@ -101,7 +101,7 @@ public: // for the time being // functions API::MatrixWorkspace_const_sptr getInWS() const { return m_InWS; } void setWS(API::MatrixWorkspace_sptr otherMatrixWS); - std::string getWSName() const { return m_InWS->name(); } + const std::string &getWSName() const { return m_InWS->getName(); } bool isPowder() const; bool isQ3DMode() const; bool hasLattice() const; diff --git a/Framework/MDAlgorithms/src/ConvertCWPDMDToSpectra.cpp b/Framework/MDAlgorithms/src/ConvertCWPDMDToSpectra.cpp index f416050888412bd97f73d1a862ab07a3c56fedba..c278b1b0bf195e380ab8289493439fa5b8c69bd7 100644 --- a/Framework/MDAlgorithms/src/ConvertCWPDMDToSpectra.cpp +++ b/Framework/MDAlgorithms/src/ConvertCWPDMDToSpectra.cpp @@ -463,8 +463,8 @@ void ConvertCWPDMDToSpectra::binMD(API::IMDEventWorkspace_const_sptr mdws, while (scancell) { // get the number of events of this cell size_t numev2 = mditer->getNumEvents(); - g_log.debug() << "MDWorkspace " << mdws->name() << " Cell " << nextindex - 1 - << ": Number of events = " << numev2 + g_log.debug() << "MDWorkspace " << mdws->getName() << " Cell " + << nextindex - 1 << ": Number of events = " << numev2 << " Does NEXT cell exist = " << mditer->next() << "\n"; // loop over all the events in current cell @@ -499,7 +499,7 @@ void ConvertCWPDMDToSpectra::binMD(API::IMDEventWorkspace_const_sptr mdws, std::stringstream errss; errss << "Event " << iev << " has run ID as " << temprun << ". " << "It has no corresponding ExperimentInfo in MDWorkspace " - << mdws->name() << "."; + << mdws->getName() << "."; throw std::runtime_error(errss.str()); } currWavelength = miter->second; diff --git a/Framework/MDAlgorithms/src/GetSpiceDataRawCountsFromMD.cpp b/Framework/MDAlgorithms/src/GetSpiceDataRawCountsFromMD.cpp index bcfb380c3351029af75f08f3c3fc0e85765dedc9..9d9c818f1445891d063762d82761bae58525cca3 100644 --- a/Framework/MDAlgorithms/src/GetSpiceDataRawCountsFromMD.cpp +++ b/Framework/MDAlgorithms/src/GetSpiceDataRawCountsFromMD.cpp @@ -382,8 +382,8 @@ void GetSpiceDataRawCountsFromMD::getDetCounts( while (scancell) { // get the number of events of this cell size_t numev2 = mditer->getNumEvents(); - g_log.debug() << "MDWorkspace " << mdws->name() << " Cell " << nextindex - 1 - << ": Number of events = " << numev2 + g_log.debug() << "MDWorkspace " << mdws->getName() << " Cell " + << nextindex - 1 << ": Number of events = " << numev2 << " Does NEXT cell exist = " << mditer->next() << "\n"; // loop over all the events in current cell @@ -460,10 +460,11 @@ void GetSpiceDataRawCountsFromMD::getSampleLogValues( // Check property exists if (!expinfo->run().hasProperty(samplelogname)) { std::stringstream ess; - ess << "Workspace " << mdws->name() << "'s " << iexp + ess << "Workspace " << mdws->getName() << "'s " << iexp << "-th ExperimentInfo with " - "run number " << thisrunnumber - << " does not have specified property " << samplelogname; + "run number " + << thisrunnumber << " does not have specified property " + << samplelogname; throw std::runtime_error(ess.str()); } // Get experiment value diff --git a/Framework/MDAlgorithms/src/MergeMD.cpp b/Framework/MDAlgorithms/src/MergeMD.cpp index 9359273e58f90fb53f2381f46a335ad3c6b21117..47725d5b9dffb64db5c1f2a5f700973d2096b041 100644 --- a/Framework/MDAlgorithms/src/MergeMD.cpp +++ b/Framework/MDAlgorithms/src/MergeMD.cpp @@ -80,14 +80,14 @@ void MergeMD::createOutputWorkspace(std::vector<std::string> &inputs) { for (auto &ws : m_workspaces) { if (ws->getNumDims() != numDims) throw std::invalid_argument( - "Workspace " + ws->name() + + "Workspace " + ws->getName() + " does not match the number of dimensions of the others (" + Strings::toString(ws->getNumDims()) + ", expected " + Strings::toString(numDims) + ")"); if (ws->getEventTypeName() != ws0->getEventTypeName()) throw std::invalid_argument( - "Workspace " + ws->name() + + "Workspace " + ws->getName() + " does not match the MDEvent type of the others (" + ws->getEventTypeName() + ", expected " + ws0->getEventTypeName() + ")"); @@ -96,10 +96,11 @@ void MergeMD::createOutputWorkspace(std::vector<std::string> &inputs) { IMDDimension_const_sptr dim = ws->getDimension(d); IMDDimension_const_sptr dim0 = ws0->getDimension(d); if (dim->getName() != dim0->getName()) - throw std::invalid_argument( - "Workspace " + ws->name() + " does not have the same dimension " + - Strings::toString(d) + " as the others (" + dim->getName() + - ", expected " + dim0->getName() + ")"); + throw std::invalid_argument("Workspace " + ws->getName() + + " does not have the same dimension " + + Strings::toString(d) + " as the others (" + + dim->getName() + ", expected " + + dim0->getName() + ")"); // Find the extents if (dim->getMaximum() > dimMax[d]) @@ -252,9 +253,9 @@ void MergeMD::exec() { // Run PlusMD on each of the input workspaces, in order. double progStep = 1.0 / double(m_workspaces.size()); for (size_t i = 0; i < m_workspaces.size(); i++) { - g_log.information() << "Adding workspace " << m_workspaces[i]->name() + g_log.information() << "Adding workspace " << m_workspaces[i]->getName() << '\n'; - progress(double(i) * progStep, m_workspaces[i]->name()); + progress(double(i) * progStep, m_workspaces[i]->getName()); CALL_MDEVENT_FUNCTION(doPlus, m_workspaces[i]); } diff --git a/Framework/MDAlgorithms/src/UnitsConversionHelper.cpp b/Framework/MDAlgorithms/src/UnitsConversionHelper.cpp index bb0f135209a092850fab48332fcd31a7196b295d..192378101e7f5565c21f34219213cf16afc50692 100644 --- a/Framework/MDAlgorithms/src/UnitsConversionHelper.cpp +++ b/Framework/MDAlgorithms/src/UnitsConversionHelper.cpp @@ -91,7 +91,7 @@ void UnitsConversionHelper::initialize(const MDWSDescription &targetWSDescr, if (!pAxis) throw(std::invalid_argument( "Cannot retrieve numeric X axis from the input workspace: " + - inWS2D->name())); + inWS2D->getName())); std::string unitsFrom = inWS2D->getAxis(0)->unit()->unitID(); diff --git a/Framework/MDAlgorithms/test/BinMDTest.h b/Framework/MDAlgorithms/test/BinMDTest.h index a21293914cd5d14bc6c905cace094b2b361abac2..9f819982c4e7acd3e358acbe8f0fd2f8df2961d2 100644 --- a/Framework/MDAlgorithms/test/BinMDTest.h +++ b/Framework/MDAlgorithms/test/BinMDTest.h @@ -643,7 +643,7 @@ public: // Intermediate workspace (the MDHisto) TS_ASSERT_EQUALS(binned1->numOriginalWorkspaces(), 2); - TS_ASSERT_EQUALS(binned1->getOriginalWorkspace(1)->name(), "binned0"); + TS_ASSERT_EQUALS(binned1->getOriginalWorkspace(1)->getName(), "binned0"); // Transforms to/from the INTERMEDIATE workspace exist CoordTransform const *toIntermediate = binned1->getTransformToOriginal(1); CoordTransform const *fromIntermediate = @@ -684,7 +684,7 @@ public: // Intermediate workspace (the MDHisto) is binned0 TS_ASSERT_EQUALS(binned1->numOriginalWorkspaces(), 2); - TS_ASSERT_EQUALS(binned1->getOriginalWorkspace(1)->name(), "binned0"); + TS_ASSERT_EQUALS(binned1->getOriginalWorkspace(1)->getName(), "binned0"); // Transforms to/from the INTERMEDIATE workspace exist CoordTransform const *toIntermediate = binned1->getTransformToOriginal(1); CoordTransform const *fromIntermediate = @@ -750,7 +750,7 @@ public: // Intermediate workspace (the MDHisto) is binned0 TS_ASSERT_EQUALS(binned1->numOriginalWorkspaces(), 2); - TS_ASSERT_EQUALS(binned1->getOriginalWorkspace(1)->name(), "binned0"); + TS_ASSERT_EQUALS(binned1->getOriginalWorkspace(1)->getName(), "binned0"); // Transforms to/from the INTERMEDIATE workspace exist CoordTransform const *toIntermediate = binned1->getTransformToOriginal(1); CoordTransform const *fromIntermediate = @@ -821,7 +821,7 @@ public: // Intermediate workspace (the MDHisto) TS_ASSERT_EQUALS(binned2->numOriginalWorkspaces(), 2); - TS_ASSERT_EQUALS(binned2->getOriginalWorkspace(1)->name(), "binned1"); + TS_ASSERT_EQUALS(binned2->getOriginalWorkspace(1)->getName(), "binned1"); // Transforms to/from the INTERMEDIATE workspace exist TS_ASSERT(binned2->getTransformToOriginal(1)); TS_ASSERT(binned2->getTransformFromOriginal(1)); diff --git a/Framework/MDAlgorithms/test/ConvertCWPDMDToSpectraTest.h b/Framework/MDAlgorithms/test/ConvertCWPDMDToSpectraTest.h index 20cc3c1e71d4af2a93c79713f6767ca8980bbc78..4800659bf74b3aad88841519ecb5214e535631f5 100644 --- a/Framework/MDAlgorithms/test/ConvertCWPDMDToSpectraTest.h +++ b/Framework/MDAlgorithms/test/ConvertCWPDMDToSpectraTest.h @@ -51,9 +51,9 @@ public: // Set properties TS_ASSERT_THROWS_NOTHING( - alg.setPropertyValue("InputWorkspace", m_dataMD->name())); + alg.setPropertyValue("InputWorkspace", m_dataMD->getName())); TS_ASSERT_THROWS_NOTHING( - alg.setPropertyValue("InputMonitorWorkspace", m_monitorMD->name())); + alg.setPropertyValue("InputMonitorWorkspace", m_monitorMD->getName())); TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("BinningParams", "0, 0.1, 120.")); TS_ASSERT_THROWS_NOTHING( @@ -113,9 +113,9 @@ public: // Set properties TS_ASSERT_THROWS_NOTHING( - alg.setPropertyValue("InputWorkspace", m_dataMD->name())); + alg.setPropertyValue("InputWorkspace", m_dataMD->getName())); TS_ASSERT_THROWS_NOTHING( - alg.setPropertyValue("InputMonitorWorkspace", m_monitorMD->name())); + alg.setPropertyValue("InputMonitorWorkspace", m_monitorMD->getName())); TS_ASSERT_THROWS_NOTHING(alg.setProperty("UnitOutput", "dSpacing")); TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("BinningParams", "0.5, 0.01, 5.0")); @@ -159,9 +159,9 @@ public: // Set properties TS_ASSERT_THROWS_NOTHING( - alg.setPropertyValue("InputWorkspace", m_dataMD->name())); + alg.setPropertyValue("InputWorkspace", m_dataMD->getName())); TS_ASSERT_THROWS_NOTHING( - alg.setPropertyValue("InputMonitorWorkspace", m_monitorMD->name())); + alg.setPropertyValue("InputMonitorWorkspace", m_monitorMD->getName())); TS_ASSERT_THROWS_NOTHING(alg.setProperty("UnitOutput", "dSpacing")); TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("BinningParams", "0.01")); TS_ASSERT_THROWS_NOTHING( @@ -247,8 +247,8 @@ public: TS_ASSERT(m_monitorMD); // Clean - AnalysisDataService::Instance().remove(datatablews->name()); - AnalysisDataService::Instance().remove(parentlogws->name()); + AnalysisDataService::Instance().remove(datatablews->getName()); + AnalysisDataService::Instance().remove(parentlogws->getName()); } //---------------------------------------------------------------------------------------------- @@ -266,9 +266,9 @@ public: // Set properties TS_ASSERT_THROWS_NOTHING( - alg.setPropertyValue("InputWorkspace", m_dataMD->name())); + alg.setPropertyValue("InputWorkspace", m_dataMD->getName())); TS_ASSERT_THROWS_NOTHING( - alg.setPropertyValue("InputMonitorWorkspace", m_monitorMD->name())); + alg.setPropertyValue("InputMonitorWorkspace", m_monitorMD->getName())); TS_ASSERT_THROWS_NOTHING( alg.setPropertyValue("BinningParams", "0, 0.1, 120.")); TS_ASSERT_THROWS_NOTHING( @@ -327,8 +327,8 @@ public: /** Clean the testing workspaces */ void test_Clean() { - AnalysisDataService::Instance().remove(m_dataMD->name()); - AnalysisDataService::Instance().remove(m_monitorMD->name()); + AnalysisDataService::Instance().remove(m_dataMD->getName()); + AnalysisDataService::Instance().remove(m_monitorMD->getName()); } private: diff --git a/Framework/MDAlgorithms/test/ConvertCWSDMDtoHKLTest.h b/Framework/MDAlgorithms/test/ConvertCWSDMDtoHKLTest.h index f9dc99cd849e4db52ff349c735ddd68ae68ef18b..412817bec71017855efe5170c23f22aca5447dd1 100644 --- a/Framework/MDAlgorithms/test/ConvertCWSDMDtoHKLTest.h +++ b/Framework/MDAlgorithms/test/ConvertCWSDMDtoHKLTest.h @@ -43,7 +43,7 @@ public: alg.initialize(); TS_ASSERT_THROWS_NOTHING( - alg.setPropertyValue("InputWorkspace", m_qsampleWS->name())); + alg.setPropertyValue("InputWorkspace", m_qsampleWS->getName())); TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue( "UBMatrix", "1.0, 0.5, 0., -0.2, 2.0, 0.4, 0., 1.11, 3.9")); TS_ASSERT_THROWS_NOTHING(alg.setPropertyValue("OutputWorkspace", "HKLMD")); diff --git a/Framework/MDAlgorithms/test/GetSpiceDataRawCountsFromMDTest.h b/Framework/MDAlgorithms/test/GetSpiceDataRawCountsFromMDTest.h index 73107d5007c54d88596c90b3c5107e78f142a825..990676c8c91c91f7c857ab54a0220b7c32f78175 100644 --- a/Framework/MDAlgorithms/test/GetSpiceDataRawCountsFromMDTest.h +++ b/Framework/MDAlgorithms/test/GetSpiceDataRawCountsFromMDTest.h @@ -197,8 +197,8 @@ public: /** Clean the testing workspaces */ void test_Clean() { - AnalysisDataService::Instance().remove(m_dataMD->name()); - AnalysisDataService::Instance().remove(m_monitorMD->name()); + AnalysisDataService::Instance().remove(m_dataMD->getName()); + AnalysisDataService::Instance().remove(m_monitorMD->getName()); } private: @@ -259,8 +259,8 @@ private: TS_ASSERT(m_monitorMD); // Clean - AnalysisDataService::Instance().remove(datatablews->name()); - AnalysisDataService::Instance().remove(parentlogws->name()); + AnalysisDataService::Instance().remove(datatablews->getName()); + AnalysisDataService::Instance().remove(parentlogws->getName()); return; } diff --git a/Framework/PythonInterface/mantid/kernel/src/Exports/DataItem.cpp b/Framework/PythonInterface/mantid/kernel/src/Exports/DataItem.cpp index f5d1d6b85361a75aae0ee127a2bfeae4f00ff17e..58cba608d7710d222b9f26de5b27813081aaca61 100644 --- a/Framework/PythonInterface/mantid/kernel/src/Exports/DataItem.cpp +++ b/Framework/PythonInterface/mantid/kernel/src/Exports/DataItem.cpp @@ -2,7 +2,9 @@ #include "MantidKernel/DataItem.h" #include <boost/python/class.hpp> +#include <boost/python/copy_const_reference.hpp> #include <boost/python/register_ptr_to_python.hpp> +#include <boost/python/return_value_policy.hpp> using Mantid::Kernel::DataItem; using namespace boost::python; @@ -14,13 +16,15 @@ void export_DataItem() { class_<DataItem, boost::noncopyable>("DataItem", no_init) .def("id", &DataItem::id, arg("self"), "The string ID of the class") - .def("name", &DataItem::name, arg("self"), "The name of the object") + .def("name", &DataItem::getName, arg("self"), "The name of the object", + return_value_policy<copy_const_reference>()) .def("threadSafe", &DataItem::threadSafe, arg("self"), "Returns true if the object " "can be accessed safely from " "multiple threads") - .def("__str__", &DataItem::name, arg("self"), - "Returns the string name of the object if it has been stored") + .def("__str__", &DataItem::getName, arg("self"), + "Returns the string name of the object if it has been stored", + return_value_policy<copy_const_reference>()) .def("__repr__", &DataItem::toString, arg("self"), "Returns a description of the object"); } diff --git a/Framework/WorkflowAlgorithms/src/HFIRLoad.cpp b/Framework/WorkflowAlgorithms/src/HFIRLoad.cpp index bdcb05a755ae3a9d8711ea64ad2ae1711207dcd5..94a950b4293b199fd571d35547e989ee78bda1f1 100644 --- a/Framework/WorkflowAlgorithms/src/HFIRLoad.cpp +++ b/Framework/WorkflowAlgorithms/src/HFIRLoad.cpp @@ -177,7 +177,7 @@ void HFIRLoad::exec() { AnalysisDataService::Instance().addOrReplace( getPropertyValue("OutputWorkspace"), dataWS_tmp); g_log.debug() << "Calling LoadSpice2D Done. OutputWorkspace name = " - << dataWS_tmp->name() << "\n"; + << dataWS_tmp->getName() << '\n'; API::MatrixWorkspace_sptr dataWS = boost::dynamic_pointer_cast<MatrixWorkspace>(dataWS_tmp); diff --git a/Framework/WorkflowAlgorithms/src/SANSBeamFinder.cpp b/Framework/WorkflowAlgorithms/src/SANSBeamFinder.cpp index bab3d659f82f87dc3aeaee33a133991b24079200..2d76a5e28fc03927271c2bbca62e5ea13a17cb9c 100644 --- a/Framework/WorkflowAlgorithms/src/SANSBeamFinder.cpp +++ b/Framework/WorkflowAlgorithms/src/SANSBeamFinder.cpp @@ -63,7 +63,7 @@ SANSBeamFinder::loadBeamFinderFile(const std::string &beamCenterFile) { if (m_reductionManager->existsProperty(entryName)) { finderWS = m_reductionManager->getProperty(entryName); m_output_message += - " |Using existing workspace: " + finderWS->name() + '\n'; + " |Using existing workspace: " + finderWS->getName() + '\n'; } else { // Load the dark current if we don't have it already std::string finderWSName = "__beam_finder_" + path.getBaseName(); diff --git a/MantidPlot/src/Mantid/MantidGroupPlotGenerator.cpp b/MantidPlot/src/Mantid/MantidGroupPlotGenerator.cpp index b2755fbde0233658dbbe4f398d29f4a9a2e1af5e..be6502706e3f8c997350a5fb5dd8952e6b1dbb24 100644 --- a/MantidPlot/src/Mantid/MantidGroupPlotGenerator.cpp +++ b/MantidPlot/src/Mantid/MantidGroupPlotGenerator.cpp @@ -72,9 +72,9 @@ void MantidGroupPlotGenerator::plot( m_mantidUI->importMatrixWorkspace(matrixWS, -1, -1, false); // Change the default plot title - QString title = - QString("plot for %1, spectrum %2") - .arg(wsGroup->name().c_str(), QString::number(options.plotIndex)); + QString title = QString("plot for %1, spectrum %2") + .arg(wsGroup->getName().c_str(), + QString::number(options.plotIndex)); // Plot the correct type of graph if (graphType == Type::Surface) { diff --git a/MantidPlot/src/Mantid/MantidMatrixFunction.cpp b/MantidPlot/src/Mantid/MantidMatrixFunction.cpp index ba4ec08ecfab9c7775b615528184f31327c54b3a..8e89ef09d3cfe77650fe4f510ee59bd48c40243a 100644 --- a/MantidPlot/src/Mantid/MantidMatrixFunction.cpp +++ b/MantidPlot/src/Mantid/MantidMatrixFunction.cpp @@ -234,7 +234,7 @@ MantidMatrixFunctionWorkspaceObserver::MantidMatrixFunctionWorkspaceObserver( void MantidMatrixFunctionWorkspaceObserver::afterReplaceHandle( const std::string &wsName, const boost::shared_ptr<Mantid::API::Workspace> ws) { - if (m_function->m_workspace && wsName == m_function->m_workspace->name()) { + if (m_function->m_workspace && wsName == m_function->m_workspace->getName()) { auto mws = boost::dynamic_pointer_cast<const Mantid::API::MatrixWorkspace>(ws); if (mws) { @@ -249,7 +249,7 @@ void MantidMatrixFunctionWorkspaceObserver::afterReplaceHandle( void MantidMatrixFunctionWorkspaceObserver::preDeleteHandle( const std::string &wsName, const boost::shared_ptr<Mantid::API::Workspace>) { - if (m_function->m_workspace && wsName == m_function->m_workspace->name()) { + if (m_function->m_workspace && wsName == m_function->m_workspace->getName()) { emit requestClose(); } } diff --git a/MantidPlot/src/Mantid/MantidUI.cpp b/MantidPlot/src/Mantid/MantidUI.cpp index e78bf71d98c4977b7b4c49deaf09e4eb06af4e5d..723296ec405b02727406a81ca2361717f3614491 100644 --- a/MantidPlot/src/Mantid/MantidUI.cpp +++ b/MantidPlot/src/Mantid/MantidUI.cpp @@ -580,7 +580,7 @@ MantidUI::importMatrixWorkspace(const MatrixWorkspace_sptr workspace, int lower, int upper, bool showDlg) { MantidMatrix *matrix = 0; if (workspace) { - const QString wsName(workspace->name().c_str()); + const QString wsName(workspace->getName().c_str()); if (showDlg) { ImportWorkspaceDlg dlg(appWindow(), workspace->getNumberHistograms()); if (dlg.exec() == QDialog::Accepted) { @@ -2824,7 +2824,7 @@ Table *MantidUI::createTableFromSelectedRows(MantidMatrix *m, bool errs, return NULL; return createTableFromSpectraList( - m->name(), QString::fromStdString(m->workspace()->name()), indexList, + m->name(), QString::fromStdString(m->workspace()->getName()), indexList, errs, binCentres); } diff --git a/MantidPlot/src/MultiLayer.cpp b/MantidPlot/src/MultiLayer.cpp index b0e5c5163dc15f20b1b9618e83ea14e43b1a98c9..da05ff233333956879e0ecd92a9075edc86b6ed2 100644 --- a/MantidPlot/src/MultiLayer.cpp +++ b/MantidPlot/src/MultiLayer.cpp @@ -1325,7 +1325,7 @@ void MultiLayer::dropOntoMDCurve(Graph *g, MantidMDCurve *originalCurve, IMDWorkspace_sptr imdWS = boost::dynamic_pointer_cast<IMDWorkspace>(ws); // Only process IMDWorkspaces if (imdWS) { - QString currentName(imdWS->name().c_str()); + QString currentName(imdWS->getName().c_str()); try { MantidMDCurve *curve = new MantidMDCurve(currentName, g, showErrors); MantidQwtIMDWorkspaceData *data = curve->mantidData(); diff --git a/MantidQt/CustomInterfaces/src/DataComparison.cpp b/MantidQt/CustomInterfaces/src/DataComparison.cpp index 465dfa3d430d368f739ef16539aaf90f65d78e9b..131319399c4c09e15288498486571d4b885cc3fa 100644 --- a/MantidQt/CustomInterfaces/src/DataComparison.cpp +++ b/MantidQt/CustomInterfaces/src/DataComparison.cpp @@ -138,18 +138,18 @@ void DataComparison::addDataItem(Workspace_const_sptr ws) { MatrixWorkspace_const_sptr matrixWs = boost::dynamic_pointer_cast<const MatrixWorkspace>(ws); if (!matrixWs) { - g_log.error() << "Workspace " << ws->name() << "is of incorrect type!\n"; + g_log.error() << "Workspace " << ws->getName() << "is of incorrect type!\n"; return; } // Check that the workspace does not already exist in the comparison if (containsWorkspace(matrixWs)) { - g_log.information() << "Workspace " << matrixWs->name() + g_log.information() << "Workspace " << matrixWs->getName() << " already shown in comparison.\n"; return; } - std::string wsName = matrixWs->name(); + std::string wsName = matrixWs->getName(); // Append a new row to the data table int currentRows = m_uiForm.twCurrentData->rowCount(); @@ -207,7 +207,7 @@ void DataComparison::addDataItem(Workspace_const_sptr ws) { * @param ws Pointer to the workspace */ bool DataComparison::containsWorkspace(MatrixWorkspace_const_sptr ws) { - QString testWsName = QString::fromStdString(ws->name()); + QString testWsName = QString::fromStdString(ws->getName()); int numRows = m_uiForm.twCurrentData->rowCount(); for (int row = 0; row < numRows; row++) { diff --git a/MantidQt/CustomInterfaces/src/DynamicPDF/DPDFInputDataControl.cpp b/MantidQt/CustomInterfaces/src/DynamicPDF/DPDFInputDataControl.cpp index 933f1a66889fb66c38b8e28826e8801926137132..314bb3df4ef43ecfbf875d6d2931b34c2cd65958 100644 --- a/MantidQt/CustomInterfaces/src/DynamicPDF/DPDFInputDataControl.cpp +++ b/MantidQt/CustomInterfaces/src/DynamicPDF/DPDFInputDataControl.cpp @@ -109,7 +109,7 @@ std::string InputDataControl::getWorkspaceName() { if (!m_workspace) { throw std::runtime_error("InpuDataControl has not set m_workspace!"); } - return m_workspace->name(); + return m_workspace->getName(); } /** diff --git a/MantidQt/CustomInterfaces/src/EnggDiffraction/EnggDiffFittingPresenter.cpp b/MantidQt/CustomInterfaces/src/EnggDiffraction/EnggDiffFittingPresenter.cpp index b3c2a6acd6472dbb438f479e9e53ebbe8bc4686e..a16355ea9dd07a4dffba95fddbfed36760cd3dea 100644 --- a/MantidQt/CustomInterfaces/src/EnggDiffraction/EnggDiffFittingPresenter.cpp +++ b/MantidQt/CustomInterfaces/src/EnggDiffraction/EnggDiffFittingPresenter.cpp @@ -1447,9 +1447,10 @@ void EnggDiffFittingPresenter::getDifcTzero(MatrixWorkspace_const_sptr wks, difc = 18400; g_log.warning() << "Could not retrieve the DIFC, DIFA, TZERO values from the workspace " - << wks->name() << ". Using default, which is not adjusted for this " - "workspace/run: DIFA: " << difa << ", DIFC: " << difc - << ", TZERO: " << tzero << ". Error details: " << rexc.what() << '\n'; + << wks->getName() << ". Using default, which is not adjusted for this " + "workspace/run: DIFA: " + << difa << ", DIFC: " << difc << ", TZERO: " << tzero + << ". Error details: " << rexc.what() << '\n'; } } diff --git a/MantidQt/CustomInterfaces/src/EnggDiffraction/EnggDiffractionPresenter.cpp b/MantidQt/CustomInterfaces/src/EnggDiffraction/EnggDiffractionPresenter.cpp index 5c8e7b74c17ace268e1248ed2e496b5ad50bf767..e158937a256ca7ed214f3dc221c8303a8344285b 100644 --- a/MantidQt/CustomInterfaces/src/EnggDiffraction/EnggDiffractionPresenter.cpp +++ b/MantidQt/CustomInterfaces/src/EnggDiffraction/EnggDiffractionPresenter.cpp @@ -2234,7 +2234,7 @@ void EnggDiffractionPresenter::doRebinningTime(const std::string &runNo, auto alg = Mantid::API::AlgorithmManager::Instance().createUnmanaged(rebinName); alg->initialize(); - alg->setPropertyValue("InputWorkspace", inWS->name()); + alg->setPropertyValue("InputWorkspace", inWS->getName()); alg->setPropertyValue("OutputWorkspace", outWSName); alg->setProperty("Params", boost::lexical_cast<std::string>(bin)); @@ -2337,7 +2337,7 @@ void EnggDiffractionPresenter::doRebinningPulses(const std::string &runNo, auto alg = Mantid::API::AlgorithmManager::Instance().createUnmanaged(rebinName); alg->initialize(); - alg->setPropertyValue("InputWorkspace", inWS->name()); + alg->setPropertyValue("InputWorkspace", inWS->getName()); alg->setPropertyValue("OutputWorkspace", outWSName); alg->setProperty("Params", boost::lexical_cast<std::string>(timeStep)); diff --git a/MantidQt/CustomInterfaces/src/Indirect/ApplyPaalmanPings.cpp b/MantidQt/CustomInterfaces/src/Indirect/ApplyPaalmanPings.cpp index d74bd9d0a46be05a88ad4c51b3ae9a4591c45d13..bfe5dd58b9eaf8ed892f0ea0d113683a252bd415 100644 --- a/MantidQt/CustomInterfaces/src/Indirect/ApplyPaalmanPings.cpp +++ b/MantidQt/CustomInterfaces/src/Indirect/ApplyPaalmanPings.cpp @@ -227,7 +227,8 @@ void ApplyPaalmanPings::run() { result = QMessageBox::Yes; } else { std::string text = "Number of bins on sample and " + - factorWs->name() + " workspace does not match.\n" + + factorWs->getName() + + " workspace does not match.\n" + "Would you like to interpolate this workspace to " "match the sample?"; @@ -357,8 +358,8 @@ void ApplyPaalmanPings::addInterpolationStep(MatrixWorkspace_sptr toInterpolate, interpolationAlg->initialize(); interpolationAlg->setProperty("WorkspaceToInterpolate", - toInterpolate->name()); - interpolationAlg->setProperty("OutputWorkspace", toInterpolate->name()); + toInterpolate->getName()); + interpolationAlg->setProperty("OutputWorkspace", toInterpolate->getName()); m_batchAlgoRunner->addAlgorithm(interpolationAlg, interpolationProps); } @@ -492,7 +493,7 @@ bool ApplyPaalmanPings::validate() { Mantid::Kernel::Unit_sptr xUnit = factorWs->getAxis(0)->unit(); if (xUnit->caption() != "Wavelength") { QString msg = "Correction factor workspace " + - QString::fromStdString(factorWs->name()) + + QString::fromStdString(factorWs->getName()) + " is not in wavelength"; uiv.addErrorMessage(msg); } diff --git a/MantidQt/CustomInterfaces/src/Indirect/CalculatePaalmanPings.cpp b/MantidQt/CustomInterfaces/src/Indirect/CalculatePaalmanPings.cpp index 8415d58a36cbdbb1eade1ec1151e01ccc636ae72..976843cc3e712b64be35412b98a1018c5180015a 100644 --- a/MantidQt/CustomInterfaces/src/Indirect/CalculatePaalmanPings.cpp +++ b/MantidQt/CustomInterfaces/src/Indirect/CalculatePaalmanPings.cpp @@ -272,7 +272,7 @@ void CalculatePaalmanPings::absCorComplete(bool error) { AlgorithmManager::Instance().create("ConvertSpectrumAxis"); convertSpecAlgo->initialize(); convertSpecAlgo->setProperty("InputWorkspace", factorWs); - convertSpecAlgo->setProperty("OutputWorkspace", factorWs->name()); + convertSpecAlgo->setProperty("OutputWorkspace", factorWs->getName()); convertSpecAlgo->setProperty("Target", "ElasticQ"); convertSpecAlgo->setProperty("EMode", "Indirect"); diff --git a/MantidQt/CustomInterfaces/src/Indirect/CorrectionsTab.cpp b/MantidQt/CustomInterfaces/src/Indirect/CorrectionsTab.cpp index eb27f5b09dbfd68d8e65de0c00240756b80b566d..3411cdad54bbc2a23682da519e61b5089292e448 100644 --- a/MantidQt/CustomInterfaces/src/Indirect/CorrectionsTab.cpp +++ b/MantidQt/CustomInterfaces/src/Indirect/CorrectionsTab.cpp @@ -77,7 +77,7 @@ std::string CorrectionsTab::addConvertUnitsStep(MatrixWorkspace_sptr ws, const std::string &unitID, const std::string &suffix, std::string eMode) { - std::string outputName = ws->name(); + std::string outputName = ws->getName(); if (suffix != "UNIT") outputName += suffix; @@ -88,7 +88,7 @@ std::string CorrectionsTab::addConvertUnitsStep(MatrixWorkspace_sptr ws, AlgorithmManager::Instance().create("ConvertUnits"); convertAlg->initialize(); - convertAlg->setProperty("InputWorkspace", ws->name()); + convertAlg->setProperty("InputWorkspace", ws->getName()); convertAlg->setProperty("OutputWorkspace", outputName); convertAlg->setProperty("Target", unitID); diff --git a/MantidQt/CustomInterfaces/src/Indirect/ISISDiagnostics.cpp b/MantidQt/CustomInterfaces/src/Indirect/ISISDiagnostics.cpp index b1be2a407b582a5e11a7e0205eff227cbb1a5e1e..0cc5864488749ccce0fa3821024586700c2839fe 100644 --- a/MantidQt/CustomInterfaces/src/Indirect/ISISDiagnostics.cpp +++ b/MantidQt/CustomInterfaces/src/Indirect/ISISDiagnostics.cpp @@ -239,7 +239,7 @@ void ISISDiagnostics::algorithmComplete(bool error) { for (size_t i = 0; i < sliceOutputGroup->size(); i++) { QString wsName = - QString::fromStdString(sliceOutputGroup->getItem(i)->name()); + QString::fromStdString(sliceOutputGroup->getItem(i)->getName()); } // Enable plot and save buttons m_uiForm.pbSave->setEnabled(true); diff --git a/MantidQt/CustomInterfaces/src/Indirect/ResNorm.cpp b/MantidQt/CustomInterfaces/src/Indirect/ResNorm.cpp index a579f7dc2ac4abe95620d155bb06a69a1b38e152..a73ec35c9a5e2def5b34ef1151b5365004505ccc 100644 --- a/MantidQt/CustomInterfaces/src/Indirect/ResNorm.cpp +++ b/MantidQt/CustomInterfaces/src/Indirect/ResNorm.cpp @@ -283,7 +283,7 @@ void ResNorm::previewSpecChanged(int value) { fitParamsName); if (fitWorkspaces && fitParams) { Column_const_sptr scaleFactors = fitParams->getColumn("Scaling"); - std::string fitWsName(fitWorkspaces->getItem(m_previewSpec)->name()); + std::string fitWsName(fitWorkspaces->getItem(m_previewSpec)->getName()); MatrixWorkspace_const_sptr fitWs = AnalysisDataService::Instance().retrieveWS<MatrixWorkspace>( fitWsName); @@ -331,8 +331,8 @@ void ResNorm::plotClicked() { QString fitWsName(""); if (fitWorkspaces) - fitWsName = - QString::fromStdString(fitWorkspaces->getItem(m_previewSpec)->name()); + fitWsName = QString::fromStdString( + fitWorkspaces->getItem(m_previewSpec)->getName()); QString plotOptions(m_uiForm.cbPlot->currentText()); if (plotOptions == "Intensity" || plotOptions == "All") diff --git a/MantidQt/CustomInterfaces/src/MultiDatasetFit/MDFDataController.cpp b/MantidQt/CustomInterfaces/src/MultiDatasetFit/MDFDataController.cpp index cf10f1d69836744e4988238f3f31ffd8d1805f90..0627e4fd577e690301f7813a21b572b29d82af04 100644 --- a/MantidQt/CustomInterfaces/src/MultiDatasetFit/MDFDataController.cpp +++ b/MantidQt/CustomInterfaces/src/MultiDatasetFit/MDFDataController.cpp @@ -70,7 +70,7 @@ void DataController::addWorkspace() { if (!matrixWorkspaces.empty()) { for (auto iws = matrixWorkspaces.begin(); iws != matrixWorkspaces.end(); ++iws) { - auto name = QString::fromStdString((**iws).name()); + auto name = QString::fromStdString((**iws).getName()); for (auto i = indices.begin(); i != indices.end(); ++i) { addWorkspaceSpectrum(name, *i, **iws); } diff --git a/MantidQt/CustomInterfaces/src/MultiDatasetFit/MultiDatasetFit.cpp b/MantidQt/CustomInterfaces/src/MultiDatasetFit/MultiDatasetFit.cpp index 695909ab1cd3180f9286d46ef58c6ba5acd8c110..d39dd074747c214fe576e699ef3205487d7f8e2f 100644 --- a/MantidQt/CustomInterfaces/src/MultiDatasetFit/MultiDatasetFit.cpp +++ b/MantidQt/CustomInterfaces/src/MultiDatasetFit/MultiDatasetFit.cpp @@ -374,7 +374,7 @@ QString MultiDatasetFit::getOutputWorkspaceName(int i) const { auto ws = Mantid::API::AnalysisDataService::Instance().retrieve(wsName); if (auto group = boost::dynamic_pointer_cast<Mantid::API::WorkspaceGroup>(ws)) { - wsName = group->getItem(i)->name(); + wsName = group->getItem(i)->getName(); } } return QString::fromStdString(wsName); diff --git a/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisFitDataPresenter.cpp b/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisFitDataPresenter.cpp index c70b373b061110988492a3f632e75c69f0589e6c..a4ea16d99a8cd636eea72f107479fda723d7b135 100644 --- a/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisFitDataPresenter.cpp +++ b/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisFitDataPresenter.cpp @@ -496,7 +496,7 @@ void MuonAnalysisFitDataPresenter::handleFittedWorkspaces( if (resultsGroup && paramsTable) { const size_t offset = paramsTable->rowCount() - resultsGroup->size(); for (size_t i = 0; i < resultsGroup->size(); i++) { - const std::string oldName = resultsGroup->getItem(i)->name(); + const std::string oldName = resultsGroup->getItem(i)->getName(); auto wsName = paramsTable->cell<std::string>(offset + i, 0); wsName = wsName.substr(wsName.find_first_of('=') + 1); // strip the "f0=" const auto wsDetails = MuonAnalysisHelper::parseWorkspaceName(wsName); diff --git a/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisHelper.cpp b/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisHelper.cpp index a4ce67ab68ab56df39790e37e381aaa39df0b7fa..d0dd659d2d6a9f27cb2bcb0675d6757340b0b814 100644 --- a/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisHelper.cpp +++ b/MantidQt/CustomInterfaces/src/Muon/MuonAnalysisHelper.cpp @@ -1090,10 +1090,10 @@ getWorkspaceColors(const std::vector<Workspace_sptr> &workspaces) { if (const auto group = boost::dynamic_pointer_cast<WorkspaceGroup>(ws)) { for (size_t i = 0; i < group->size(); ++i) { const auto &ws = group->getItem(i); - if (ws->name().find("_Parameters") != std::string::npos) { + if (ws->getName().find("_Parameters") != std::string::npos) { params = getKeysFromTable( boost::dynamic_pointer_cast<ITableWorkspace>(ws)); - } else if (ws->name().find("_Workspace") != std::string::npos) { + } else if (ws->getName().find("_Workspace") != std::string::npos) { ++nRuns; } } @@ -1103,7 +1103,7 @@ getWorkspaceColors(const std::vector<Workspace_sptr> &workspaces) { params = getKeysFromTable(table); } else { throw std::invalid_argument( - "Unexpected workspace type for " + ws->name() + + "Unexpected workspace type for " + ws->getName() + " (expected WorkspaceGroup or ITableWorkspace)"); } fitProperties.emplace_back(nRuns, params); diff --git a/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp b/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp index df1fffbc1391524690ecbcec3636e40ffae2aacb..76c923d8a2bcd1bc4e7d0ff51d37c60ee878d2be 100644 --- a/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp +++ b/MantidQt/CustomInterfaces/src/SANSRunWindow.cpp @@ -1671,12 +1671,12 @@ void SANSRunWindow::setGeometryDetails() { if (boost::dynamic_pointer_cast<const IEventWorkspace>(ws)) { // EventWorkspaces have their monitors loaded into a separate workspace. - const std::string monitorWsName = ws->name() + "_monitors"; + const std::string monitorWsName = ws->getName() + "_monitors"; if (!ADS.doesExist(monitorWsName)) { g_log.error() << "Expected a sister monitor workspace called \"" << monitorWsName << "\" " - << "for the EventWorkspace \"" << ws->name() + << "for the EventWorkspace \"" << ws->getName() << "\", but could not find one " << "so unable to set geometry details.\n"; return; @@ -1703,7 +1703,7 @@ void SANSRunWindow::setGeometryDetails() { g_log.error() << "The reported incident monitor spectrum number \"" << monitorSpectrum << "\" does not have a corresponding workspace index in \"" - << monitorWs->name() + << monitorWs->getName() << "\", so unable to set geometry details.\n"; return; } @@ -1847,7 +1847,7 @@ void SANSRunWindow::setSANS2DGeometry( QString code_to_run = QString("print ','.join([str(a) for a in " "i.ReductionSingleton().instrument.getDetValues('%1')])") - .arg(QString::fromStdString(workspace->name())); + .arg(QString::fromStdString(workspace->getName())); QStringList logvalues = runReduceScriptFunction(code_to_run).split(","); diff --git a/MantidQt/CustomInterfaces/src/StepScan.cpp b/MantidQt/CustomInterfaces/src/StepScan.cpp index fda17e6c5e3dacf5b56f2a3647c6459f2b4ff174..0b2e381fea2290e61e834e648b3250ec8c9d2ed5 100644 --- a/MantidQt/CustomInterfaces/src/StepScan.cpp +++ b/MantidQt/CustomInterfaces/src/StepScan.cpp @@ -293,7 +293,7 @@ bool StepScan::mergeRuns() { // within a group?) IAlgorithm_sptr addScanIndex = AlgorithmManager::Instance().create("AddSampleLog"); - addScanIndex->setPropertyValue("Workspace", ws->name()); + addScanIndex->setPropertyValue("Workspace", ws->getName()); addScanIndex->setProperty("LogName", "scan_index"); addScanIndex->setProperty("LogType", "Number Series"); addScanIndex->setProperty("LogText", Strings::toString(i + 1)); diff --git a/MantidQt/CustomInterfaces/src/Tomography/TomoToolConfigDialogSavu.cpp b/MantidQt/CustomInterfaces/src/Tomography/TomoToolConfigDialogSavu.cpp index 7bc14215c90e98a4c0c9a41afcf09dae2ea5954e..2d3aa5a774949080e47416c69eda0107444e5966 100644 --- a/MantidQt/CustomInterfaces/src/Tomography/TomoToolConfigDialogSavu.cpp +++ b/MantidQt/CustomInterfaces/src/Tomography/TomoToolConfigDialogSavu.cpp @@ -387,7 +387,7 @@ void TomoToolConfigDialogSavu::menuSaveClicked() { } else { AnalysisDataService::Instance().add(createUniqueNameHidden(), m_currPlugins); - std::string csvWorkspaceNames = m_currPlugins->name(); + std::string csvWorkspaceNames = m_currPlugins->getName(); auto alg = Mantid::API::AlgorithmManager::Instance().createUnmanaged( "SaveTomoConfig"); diff --git a/MantidQt/CustomInterfaces/src/Tomography/TomographyIfaceModel.cpp b/MantidQt/CustomInterfaces/src/Tomography/TomographyIfaceModel.cpp index 51cdc53e074010637e9b577a3ff24ab609a41fff..c6e7c57aafa63d0735d72980f1b578d653482e5f 100644 --- a/MantidQt/CustomInterfaces/src/Tomography/TomographyIfaceModel.cpp +++ b/MantidQt/CustomInterfaces/src/Tomography/TomographyIfaceModel.cpp @@ -760,7 +760,7 @@ TomographyIfaceModel::loadFITSImage(const std::string &path) { // draw image from workspace if (wsg && ws && - Mantid::API::AnalysisDataService::Instance().doesExist(ws->name())) { + Mantid::API::AnalysisDataService::Instance().doesExist(ws->getName())) { return wsg; } else { return WorkspaceGroup_sptr(); diff --git a/MantidQt/MantidWidgets/src/DataProcessorUI/GenericDataProcessorPresenter.cpp b/MantidQt/MantidWidgets/src/DataProcessorUI/GenericDataProcessorPresenter.cpp index b46972caa7a88748ffbfc40b72ce5e47b0d62ef0..c8098f33ffa28d8281aecd75e8cfcc23ae6acaec 100644 --- a/MantidQt/MantidWidgets/src/DataProcessorUI/GenericDataProcessorPresenter.cpp +++ b/MantidQt/MantidWidgets/src/DataProcessorUI/GenericDataProcessorPresenter.cpp @@ -397,8 +397,9 @@ Workspace_sptr GenericDataProcessorPresenter::prepareRunWorkspace( IAlgorithm_sptr alg = AlgorithmManager::Instance().create(preprocessor.name()); alg->initialize(); - alg->setProperty(preprocessor.lhsProperty(), - loadRun(runs[0], instrument, preprocessor.prefix())->name()); + alg->setProperty( + preprocessor.lhsProperty(), + loadRun(runs[0], instrument, preprocessor.prefix())->getName()); alg->setProperty(preprocessor.outputProperty(), outputName); // Drop the first run from the runs list @@ -419,7 +420,7 @@ Workspace_sptr GenericDataProcessorPresenter::prepareRunWorkspace( alg->setProperty( preprocessor.rhsProperty(), - loadRun(*runIt, instrument, preprocessor.prefix())->name()); + loadRun(*runIt, instrument, preprocessor.prefix())->getName()); alg->execute(); if (runIt != --runs.end()) { @@ -608,7 +609,7 @@ GenericDataProcessorPresenter::reduceRow(const std::vector<std::string> &data) { auto optionsMap = parseKeyValueString(options); auto runWS = prepareRunWorkspace(runStr, preprocessor, optionsMap); - alg->setProperty(propertyName, runWS->name()); + alg->setProperty(propertyName, runWS->getName()); } } else { // No pre-processing needed diff --git a/MantidQt/MantidWidgets/src/DisplayCurveFit.cpp b/MantidQt/MantidWidgets/src/DisplayCurveFit.cpp index c57a493a679a350f3ee0e3898c7331b7b0b1e72c..0bd9ce452547871120807290cb8b01160d2ad5a7 100644 --- a/MantidQt/MantidWidgets/src/DisplayCurveFit.cpp +++ b/MantidQt/MantidWidgets/src/DisplayCurveFit.cpp @@ -101,7 +101,7 @@ QPair<double, double> DisplayCurveFit::getCurveRange( curveTypes typesFound = this->getCurvesForWorkspace(workspace); if (typesFound.size() == 0) { throw std::runtime_error("No fitting curves associated to workspace" + - workspace->name()); + workspace->getName()); } return getCurveRange(typesFound[0]); } diff --git a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentActor.cpp b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentActor.cpp index f8c0b1457ec127795a7719b6502928bce0c61aff..5f325aa7118f15aee09f388e3543459f4fb38ef0 100644 --- a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentActor.cpp +++ b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentActor.cpp @@ -282,7 +282,7 @@ IMaskWorkspace_sptr InstrumentActor::getMaskWorkspaceIfExists() const { * Apply mask stored in the helper mask workspace to the data workspace. */ void InstrumentActor::applyMaskWorkspace() { - auto wsName = getWorkspace()->name(); + auto wsName = getWorkspace()->getName(); if (m_maskWorkspace) { // Mask detectors try { @@ -868,7 +868,7 @@ Mantid::API::MatrixWorkspace_sptr InstrumentActor::extractCurrentMask() const { Mantid::API::IAlgorithm *alg = Mantid::API::FrameworkManager::Instance().createAlgorithm("ExtractMask", -1); - alg->setPropertyValue("InputWorkspace", getWorkspace()->name()); + alg->setPropertyValue("InputWorkspace", getWorkspace()->getName()); alg->setPropertyValue("OutputWorkspace", maskName); alg->execute(); diff --git a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetMaskTab.cpp b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetMaskTab.cpp index 1e87d7507804688a27db3503c6be5c8ba15484ba..bc0ad4bb5263d191adf8737cfce1997746634210 100644 --- a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetMaskTab.cpp +++ b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetMaskTab.cpp @@ -875,7 +875,7 @@ void InstrumentWidgetMaskTab::saveMaskingToFile(bool invertMask) { alg->setPropertyValue("OutputFile", fileName.toStdString()); alg->execute(); } - Mantid::API::AnalysisDataService::Instance().remove(outputWS->name()); + Mantid::API::AnalysisDataService::Instance().remove(outputWS->getName()); } enableApplyButtons(); QApplication::restoreOverrideCursor(); @@ -903,12 +903,12 @@ void InstrumentWidgetMaskTab::saveMaskingToCalFile(bool invertMask) { Mantid::API::IAlgorithm_sptr alg = Mantid::API::AlgorithmManager::Instance().create( "MaskWorkspaceToCalFile", -1); - alg->setPropertyValue("InputWorkspace", outputWS->name()); + alg->setPropertyValue("InputWorkspace", outputWS->getName()); alg->setPropertyValue("OutputFile", fileName.toStdString()); alg->setProperty("Invert", false); alg->execute(); } - Mantid::API::AnalysisDataService::Instance().remove(outputWS->name()); + Mantid::API::AnalysisDataService::Instance().remove(outputWS->getName()); } enableApplyButtons(); QApplication::restoreOverrideCursor(); @@ -1286,7 +1286,7 @@ InstrumentWidgetMaskTab::loadMask(const std::string &fileName) { auto workspace = actor->getWorkspace(); auto instrument = workspace->getInstrument(); auto instrumentName = instrument->getName(); - auto tempName = "__" + workspace->name() + "MaskView"; + auto tempName = "__" + workspace->getName() + "MaskView"; // load the mask from the project folder try { diff --git a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetPickTab.cpp b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetPickTab.cpp index 01b289330a7df10789d1b209996366c336f55d3e..e9b140c36faacf4d95a4e5ff2009cb2c3ae60966 100644 --- a/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetPickTab.cpp +++ b/MantidQt/MantidWidgets/src/InstrumentView/InstrumentWidgetPickTab.cpp @@ -1584,7 +1584,7 @@ void DetectorPlotController::savePlotToWorkspace() { alg->setProperty("DataE", E); alg->setProperty("NSpec", static_cast<int>(X.size() / nbins)); alg->setProperty("UnitX", unitX); - alg->setPropertyValue("ParentWorkspace", parentWorkspace->name()); + alg->setPropertyValue("ParentWorkspace", parentWorkspace->getName()); alg->execute(); if (!detids.empty()) { @@ -1697,7 +1697,7 @@ void DetectorPlotController::addPeak(double x, double y) { std::string peakTableName; bool newPeaksWorkspace = false; if (tw) { - peakTableName = tw->name(); + peakTableName = tw->getName(); } else { peakTableName = "SingleCrystalPeakTable"; // This does need to get the instrument from the workspace as it's doing @@ -1735,7 +1735,7 @@ void DetectorPlotController::addPeak(double x, double y) { // Run the AddPeak algorithm auto alg = Mantid::API::FrameworkManager::Instance().createAlgorithm("AddPeak"); - alg->setPropertyValue("RunWorkspace", ws->name()); + alg->setPropertyValue("RunWorkspace", ws->getName()); alg->setPropertyValue("PeaksWorkspace", peakTableName); alg->setProperty("DetectorID", m_currentDetID); alg->setProperty("TOF", x); diff --git a/MantidQt/MantidWidgets/src/InstrumentView/PeakOverlay.cpp b/MantidQt/MantidWidgets/src/InstrumentView/PeakOverlay.cpp index 87ecc5fe7790aaac35ef64888c8c71d4558867e7..c4d55cc971e6fc120533af1968dc5e6da7f5ba64 100644 --- a/MantidQt/MantidWidgets/src/InstrumentView/PeakOverlay.cpp +++ b/MantidQt/MantidWidgets/src/InstrumentView/PeakOverlay.cpp @@ -205,7 +205,7 @@ void PeakOverlay::removeShapes(const QList<Shape2D *> &shapeList) { // Run the DeleteTableRows algorithm to delete the peak. auto alg = Mantid::API::AlgorithmManager::Instance().create("DeleteTableRows", -1); - alg->setPropertyValue("TableWorkspace", m_peaksWorkspace->name()); + alg->setPropertyValue("TableWorkspace", m_peaksWorkspace->getName()); alg->setProperty("Rows", rows); emit executeAlgorithm(alg); } diff --git a/MantidQt/MantidWidgets/src/InstrumentView/ProjectionSurface.cpp b/MantidQt/MantidWidgets/src/InstrumentView/ProjectionSurface.cpp index b3b27eacd102e1821021bf5aa057be5f8c508de9..11e767d967925650d85031614dc043d267817686 100644 --- a/MantidQt/MantidWidgets/src/InstrumentView/ProjectionSurface.cpp +++ b/MantidQt/MantidWidgets/src/InstrumentView/ProjectionSurface.cpp @@ -815,7 +815,7 @@ void ProjectionSurface::enableLighting(bool on) { m_isLightingOn = on; } QStringList ProjectionSurface::getPeaksWorkspaceNames() const { QStringList names; foreach (PeakOverlay *po, m_peakShapes) { - names << QString::fromStdString(po->getPeaksWorkspace()->name()); + names << QString::fromStdString(po->getPeaksWorkspace()->getName()); } return names; } diff --git a/MantidQt/MantidWidgets/src/InstrumentView/UnwrappedSurface.cpp b/MantidQt/MantidWidgets/src/InstrumentView/UnwrappedSurface.cpp index 930732bec1e34e61f486de23a3e0a4747133c534..342c685e426ad04d452cde037c896cd33ba137e0 100644 --- a/MantidQt/MantidWidgets/src/InstrumentView/UnwrappedSurface.cpp +++ b/MantidQt/MantidWidgets/src/InstrumentView/UnwrappedSurface.cpp @@ -781,7 +781,7 @@ std::string UnwrappedSurface::saveToProject() const { tsv.writeLine("PeaksWorkspaces"); for (auto overlay : m_peakShapes) { - tsv << overlay->getPeaksWorkspace()->name(); + tsv << overlay->getPeaksWorkspace()->getName(); } return tsv.outputLines(); diff --git a/MantidQt/MantidWidgets/src/MantidTreeWidget.cpp b/MantidQt/MantidWidgets/src/MantidTreeWidget.cpp index 9235dcb6a134ef47a3d326c88020076fb71f4643..3cf6cd9acaf41f703e59465d40174db4cc830a13 100644 --- a/MantidQt/MantidWidgets/src/MantidTreeWidget.cpp +++ b/MantidQt/MantidWidgets/src/MantidTreeWidget.cpp @@ -234,7 +234,8 @@ MantidWSIndexWidget::UserInput MantidTreeWidget::chooseSpectrumFromSelected( auto selectedMatrixWsList = getSelectedMatrixWorkspaces(); QList<QString> selectedMatrixWsNameList; foreach (const auto matrixWs, selectedMatrixWsList) { - selectedMatrixWsNameList.append(QString::fromStdString(matrixWs->name())); + selectedMatrixWsNameList.append( + QString::fromStdString(matrixWs->getName())); } // Check to see if all workspaces have only a single spectrum ... @@ -251,7 +252,7 @@ MantidWSIndexWidget::UserInput MantidTreeWidget::chooseSpectrumFromSelected( const std::set<int> SINGLE_SPECTRUM = {0}; QMultiMap<QString, std::set<int>> spectrumToPlot; foreach (const auto selectedMatrixWs, selectedMatrixWsList) { - spectrumToPlot.insert(QString::fromStdString(selectedMatrixWs->name()), + spectrumToPlot.insert(QString::fromStdString(selectedMatrixWs->getName()), SINGLE_SPECTRUM); } MantidWSIndexWidget::UserInput selections; @@ -282,7 +283,8 @@ MantidTreeWidget::choosePlotOptions(const QString &type, auto selectedMatrixWsList = getSelectedMatrixWorkspaces(); QList<QString> selectedMatrixWsNameList; foreach (const auto matrixWs, selectedMatrixWsList) { - selectedMatrixWsNameList.append(QString::fromStdString(matrixWs->name())); + selectedMatrixWsNameList.append( + QString::fromStdString(matrixWs->getName())); } auto *dlg = m_mantidUI->createSurfacePlotDialog(0, selectedMatrixWsNameList, type); diff --git a/MantidQt/MantidWidgets/src/MuonFitPropertyBrowser.cpp b/MantidQt/MantidWidgets/src/MuonFitPropertyBrowser.cpp index 49d9ca84a7b9eb82302be339daf53963a40b3a06..b84ca5fb4e21a80321ea0da2d00496bae05eac05 100644 --- a/MantidQt/MantidWidgets/src/MuonFitPropertyBrowser.cpp +++ b/MantidQt/MantidWidgets/src/MuonFitPropertyBrowser.cpp @@ -405,7 +405,7 @@ void MuonFitPropertyBrowser::showEvent(QShowEvent *e) { * @param ws :: The workspace */ bool MuonFitPropertyBrowser::isWorkspaceValid(Workspace_sptr ws) const { - QString workspaceName(QString::fromStdString(ws->name())); + QString workspaceName(QString::fromStdString(ws->getName())); if ((workspaceName.contains("_Raw")) || (workspaceName.contains("MuonAnalysis"))) diff --git a/MantidQt/MantidWidgets/src/SelectWorkspacesDialog.cpp b/MantidQt/MantidWidgets/src/SelectWorkspacesDialog.cpp index 0674c3f23ed93886feb5f0e5332847b36efad709..b29e8617dcd76c75a2de35bbacb7b289cf6fe7b2 100644 --- a/MantidQt/MantidWidgets/src/SelectWorkspacesDialog.cpp +++ b/MantidQt/MantidWidgets/src/SelectWorkspacesDialog.cpp @@ -65,7 +65,7 @@ SelectWorkspacesDialog::SelectWorkspacesDialog( for (VecWorkspaces::const_iterator it = workspaces.begin(); it != workspaces.end(); ++it) { // if(useFilter && ADS:: - tmp << QString::fromStdString((*it)->name()); + tmp << QString::fromStdString((*it)->getName()); } m_wsList->addItems(tmp); diff --git a/MantidQt/MantidWidgets/src/WorkspacePresenter/QWorkspaceDockView.cpp b/MantidQt/MantidWidgets/src/WorkspacePresenter/QWorkspaceDockView.cpp index a3ffcf9f7478e12d704464e658cc5d80c7a266b4..1a7ed1fa4e9b064d706635f877bcb958662d377d 100644 --- a/MantidQt/MantidWidgets/src/WorkspacePresenter/QWorkspaceDockView.cpp +++ b/MantidQt/MantidWidgets/src/WorkspacePresenter/QWorkspaceDockView.cpp @@ -766,7 +766,7 @@ void QWorkspaceDockView::populateChildData(QTreeWidgetItem *item) { const size_t nmembers = group->getNumberOfEntries(); for (size_t i = 0; i < nmembers; ++i) { auto ws = group->getItem(i); - auto *node = addTreeEntry(std::make_pair(ws->name(), ws), item); + auto *node = addTreeEntry(std::make_pair(ws->getName(), ws), item); excludeItemFromSort(node); if (shouldBeSelected(node->text(0))) node->setSelected(true); diff --git a/MantidQt/SliceViewer/src/CompositePeaksPresenter.cpp b/MantidQt/SliceViewer/src/CompositePeaksPresenter.cpp index 2e9534377ed3d28964255c5f68fcd7706c9bd31f..e8e278330cf108bf8fce7c4c53b6ace2228ed526 100644 --- a/MantidQt/SliceViewer/src/CompositePeaksPresenter.cpp +++ b/MantidQt/SliceViewer/src/CompositePeaksPresenter.cpp @@ -477,7 +477,7 @@ private: public: explicit MatchWorkspaceName(const QString &name) : m_wsName(name) {} bool operator()(SetPeaksWorkspaces::value_type ws) { - const std::string wsName = ws->name(); + const std::string &wsName = ws->getName(); const std::string toMatch = m_wsName.toStdString(); const bool result = (wsName == toMatch); return result; diff --git a/MantidQt/SliceViewer/src/ConcretePeaksPresenter.cpp b/MantidQt/SliceViewer/src/ConcretePeaksPresenter.cpp index f4853f6d04b2db3bfeb2fd99e8e95b14eca077ab..f93acf95741e09278c5719660cd296b641c42248 100644 --- a/MantidQt/SliceViewer/src/ConcretePeaksPresenter.cpp +++ b/MantidQt/SliceViewer/src/ConcretePeaksPresenter.cpp @@ -628,7 +628,8 @@ ConcretePeaksPresenter::findVisiblePeakIndexes(const PeakBoundingBox &box) { alg->setRethrows(true); alg->initialize(); alg->setProperty("InputWorkspace", peaksWS); - alg->setProperty("OutputWorkspace", peaksWS->name() + "_peaks_in_region"); + alg->setProperty("OutputWorkspace", + peaksWS->getName() + "_peaks_in_region"); alg->setProperty("Extents", transformedViewableRegion.toExtents()); alg->setProperty("CheckPeakExtents", false); // consider all peaks as points alg->setProperty("PeakRadius", radius); diff --git a/MantidQt/SliceViewer/src/LineViewer.cpp b/MantidQt/SliceViewer/src/LineViewer.cpp index 0d5009c641600fdf4e3e103fa4549107955047e5..838dcfbfc66bb22b9e9461f1d4547bfef4fd49b2 100644 --- a/MantidQt/SliceViewer/src/LineViewer.cpp +++ b/MantidQt/SliceViewer/src/LineViewer.cpp @@ -1161,7 +1161,7 @@ std::string LineViewer::saveToProject() const { if (!m_sliceWS) return ""; - tsv.writeLine("SliceWorkspace") << m_sliceWS->name(); + tsv.writeLine("SliceWorkspace") << m_sliceWS->getName(); tsv.writeLine("XDim") << m_freeDimX; tsv.writeLine("YDim") << m_freeDimY; tsv.writeLine("AllFreeDims") << m_allDimsFree; diff --git a/MantidQt/SliceViewer/src/PeaksViewer.cpp b/MantidQt/SliceViewer/src/PeaksViewer.cpp index d7391cb253d875da7b5b7538993c77d859614d50..68bfd14a0724203d32fac343495842287b98650a 100644 --- a/MantidQt/SliceViewer/src/PeaksViewer.cpp +++ b/MantidQt/SliceViewer/src/PeaksViewer.cpp @@ -289,8 +289,8 @@ std::string PeaksViewer::saveToProject() const { auto zoomedWorkspaces = (*zoomPresenter)->presentedWorkspaces(); tsv.writeLine("ZoomedPeakIndex") << m_presenter->getZoomedPeakIndex(); tsv.writeLine("ZoomedPeakWorkspaces"); - for (auto ws : zoomedWorkspaces) { - tsv << ws->name(); + for (const auto &ws : zoomedWorkspaces) { + tsv << ws->getName(); } } @@ -317,7 +317,7 @@ std::string PeaksViewer::saveToProject() const { std::string PeaksViewer::savePresentedWorkspace( Mantid::API::IPeaksWorkspace_const_sptr ws) const { API::TSVSerialiser tsv; - tsv.writeLine("Name") << ws->name(); + tsv.writeLine("Name") << ws->getName(); tsv.writeLine("ShowBackground") << m_presenter->getShowBackground(ws); tsv.writeLine("Foreground"); @@ -439,7 +439,7 @@ void PeaksViewer::performUpdate() { if (optionalZoomedPresenter.is_initialized()) { // Is the zoomed peaks workspace the current workspace. if (optionalZoomedPresenter.get().get() == - m_presenter->getPeaksPresenter(ws->name().c_str())) { + m_presenter->getPeaksPresenter(ws->getName().c_str())) { candidateWidget->setSelectedPeak(optionalZoomedIndex); } } diff --git a/MantidQt/SliceViewer/src/PeaksWorkspaceWidget.cpp b/MantidQt/SliceViewer/src/PeaksWorkspaceWidget.cpp index 19fdc90d6a82a06d94d050e6a6cd6cde98e06216..34498f48d173b13320872eed2b948084895edf4f 100644 --- a/MantidQt/SliceViewer/src/PeaksWorkspaceWidget.cpp +++ b/MantidQt/SliceViewer/src/PeaksWorkspaceWidget.cpp @@ -148,7 +148,7 @@ void PeaksWorkspaceWidget::createTableMVC() { } void PeaksWorkspaceWidget::populate() { - m_nameText = QString(m_ws->name().c_str()); + m_nameText = QString(m_ws->getName().c_str()); ui.lblWorkspaceName->setText(m_nameText); ui.lblWorkspaceName->setToolTip(m_nameText); diff --git a/MantidQt/SliceViewer/src/SliceViewer.cpp b/MantidQt/SliceViewer/src/SliceViewer.cpp index 248f90eab330f5ee7dfb8650120c53b96b5c9194..346e7b2e3e6b3cee687bae96328d9f2ea6f008fe 100644 --- a/MantidQt/SliceViewer/src/SliceViewer.cpp +++ b/MantidQt/SliceViewer/src/SliceViewer.cpp @@ -2749,7 +2749,7 @@ std::string SliceViewer::saveToProject() const { tsv.writeSection("overlay", m_lineOverlay->saveToProject()); if (m_overlayWS) - tsv.writeLine("OverlayWorkspace") << m_overlayWS->name(); + tsv.writeLine("OverlayWorkspace") << m_overlayWS->getName(); return tsv.outputLines(); } diff --git a/MantidQt/SliceViewer/src/SliceViewerWindow.cpp b/MantidQt/SliceViewer/src/SliceViewerWindow.cpp index 068e4f5da26ceb24a4d27ca32c142d1de908cc5d..1399ad3dd89cab26a24372513365afd52fd7737f 100644 --- a/MantidQt/SliceViewer/src/SliceViewerWindow.cpp +++ b/MantidQt/SliceViewer/src/SliceViewerWindow.cpp @@ -521,7 +521,7 @@ std::string SliceViewerWindow::saveToProject(ApplicationWindow *app) { UNUSED_ARG(app); MantidQt::API::TSVSerialiser tsv, tab; tab.writeLine("geometry") << geometry(); - tab.writeLine("Workspace") << m_ws->name(); + tab.writeLine("Workspace") << m_ws->getName(); tab.writeLine("Label") << m_label; tab.writeRaw(m_slicer->saveToProject()); diff --git a/MantidQt/SpectrumViewer/src/SpectrumView.cpp b/MantidQt/SpectrumViewer/src/SpectrumView.cpp index d24c0988042c96f1e5bf20893f3fed135696e9e6..346fddf412878ac7bdc14979241dac7328d0ca41 100644 --- a/MantidQt/SpectrumViewer/src/SpectrumView.cpp +++ b/MantidQt/SpectrumViewer/src/SpectrumView.cpp @@ -113,7 +113,7 @@ void SpectrumView::renderWorkspace( if (isFirstPlot) { m_ui->imageTabs->setTabText( m_ui->imageTabs->indexOf(m_ui->imageTabs->currentWidget()), - QString::fromStdString(wksp->name())); + QString::fromStdString(wksp->getName())); m_hGraph = boost::make_shared<GraphDisplay>(m_ui->h_graphPlot, m_ui->h_graph_table, false); m_vGraph = boost::make_shared<GraphDisplay>(m_ui->v_graphPlot, @@ -124,7 +124,8 @@ void SpectrumView::renderWorkspace( auto layout = new QHBoxLayout(); layout->addWidget(spectrumPlot); widget->setLayout(layout); - tab = m_ui->imageTabs->addTab(widget, QString::fromStdString(wksp->name())); + tab = m_ui->imageTabs->addTab(widget, + QString::fromStdString(wksp->getName())); m_ui->imageTabs->setTabsClosable(true); } @@ -366,7 +367,7 @@ std::string SpectrumView::saveToProject(ApplicationWindow *app) { spec.writeLine("Workspaces"); for (auto source : m_dataSource) { - spec << source->getWorkspace()->name(); + spec << source->getWorkspace()->getName(); } int index = m_ui->imageTabs->currentIndex(); diff --git a/Vates/VatesAPI/inc/MantidVatesAPI/PresenterFactories.h b/Vates/VatesAPI/inc/MantidVatesAPI/PresenterFactories.h index bce7458c72757b22e6dbdf380fe6ec2ee2dae2be..56a1be5b7357f633108224ba73cd67b13cd32c2b 100644 --- a/Vates/VatesAPI/inc/MantidVatesAPI/PresenterFactories.h +++ b/Vates/VatesAPI/inc/MantidVatesAPI/PresenterFactories.h @@ -21,7 +21,7 @@ protected: class DLLExport NonEmptyWorkspaceNamePolicy { protected: std::string getWorkspaceName(Mantid::API::IMDWorkspace_sptr workspace) { - return workspace->name(); + return workspace->getName(); } }; diff --git a/Vates/VatesAPI/src/ConcretePeaksPresenterVsi.cpp b/Vates/VatesAPI/src/ConcretePeaksPresenterVsi.cpp index 444bd47d63b60aebb0a7aec1cb0e6321d22d5453..5dd60acc1f383e4a0f264c7a278ed994dd9850ea 100644 --- a/Vates/VatesAPI/src/ConcretePeaksPresenterVsi.cpp +++ b/Vates/VatesAPI/src/ConcretePeaksPresenterVsi.cpp @@ -54,7 +54,8 @@ std::vector<bool> ConcretePeaksPresenterVsi::getViewablePeaks() const { alg->setRethrows(true); alg->initialize(); alg->setProperty("InputWorkspace", peaksWS); - alg->setProperty("OutputWorkspace", peaksWS->name() + "_peaks_in_region"); + alg->setProperty("OutputWorkspace", + peaksWS->getName() + "_peaks_in_region"); alg->setProperty("Extents", viewable); alg->setProperty("CheckPeakExtents", true); alg->setProperty("PeakRadius", effectiveRadius);