Skip to content

Commit

Permalink
Re #6811. Remove unused (apart from in the test) method.
Browse files Browse the repository at this point in the history
  • Loading branch information
RussellTaylor committed Apr 1, 2013
1 parent 15670e8 commit d6f2b43
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 50 deletions.
15 changes: 4 additions & 11 deletions Code/Mantid/Framework/API/inc/MantidAPI/AlgorithmManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,7 @@ namespace API
/** The AlgorithmManagerImpl class is responsible for controlling algorithm
instances. It incorporates the algorithm factory and initializes algorithms.
@author Dickon Champion, ISIS, RAL
@date 30/10/2007
Copyright © 2007-9 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
Copyright © 2007-2013 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
This file is part of Mantid.
Expand Down Expand Up @@ -77,8 +74,6 @@ class MANTID_API_DLL AlgorithmManagerImpl
{
return static_cast<int>(m_managed_algs.size());
}
/// Returns the names and categories of all algorithms
const std::vector<std::pair<std::string, std::string> > getNamesAndCategories() const;

/// Return the pointer to an algorithm with the given ID
IAlgorithm_sptr getAlgorithm(AlgorithmID id) const;
Expand All @@ -97,14 +92,12 @@ class MANTID_API_DLL AlgorithmManagerImpl
private:
friend struct Mantid::Kernel::CreateUsingNew<AlgorithmManagerImpl>;

///Class cannot be instantiated by normal means
AlgorithmManagerImpl();
///destructor
~AlgorithmManagerImpl();
///Copy constructor
AlgorithmManagerImpl(const AlgorithmManagerImpl&);

/// Standard Assignment operator
/// Unimplemented copy constructor
AlgorithmManagerImpl(const AlgorithmManagerImpl&);
/// Unimplemented assignment operator
AlgorithmManagerImpl& operator =(const AlgorithmManagerImpl&);

/// Reference to the logger class
Expand Down
19 changes: 0 additions & 19 deletions Code/Mantid/Framework/API/src/AlgorithmManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,25 +45,6 @@ namespace Mantid
return AlgorithmFactory::Instance().create(algName,version); // Throws on fail:
}

/** Gets the names and categories of all the currently available algorithms
*
* @return A vector of pairs of algorithm names and categories
*/
const std::vector<std::pair<std::string,std::string> >
AlgorithmManagerImpl::getNamesAndCategories() const
{
Mutex::ScopedLock _lock(this->m_managedMutex);
std::vector<std::pair<std::string,std::string> > retVector;

for (unsigned int i=0; i < m_managed_algs.size(); ++i)
{
std::pair<std::string,std::string> alg(m_managed_algs[i]->name(),m_managed_algs[i]->category());
retVector.push_back(alg);
}

return retVector;
}

/** Creates and initialises an instance of an algorithm.
*
* The algorithm gets tracked in the list of "managed" algorithms,
Expand Down
20 changes: 0 additions & 20 deletions Code/Mantid/Framework/API/test/AlgorithmManagerTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,26 +125,6 @@ class AlgorithmManagerTest : public CxxTest::TestSuite
TS_ASSERT_THROWS(AlgorithmManager::Instance().create("aaaaaa"), std::runtime_error );
}

void testGetNamesAndCategories()
{
AlgorithmManager::Instance().clear();
TS_ASSERT_THROWS_NOTHING( AlgorithmManager::Instance().create("AlgTest") );
TS_ASSERT_THROWS_NOTHING(AlgorithmManager::Instance().create("AlgTestSecond") );
std::vector<std::pair<std::string,std::string> > names = AlgorithmManager::Instance().getNamesAndCategories();
TS_ASSERT_EQUALS(names.size(), 2);
if (names.size() > 0)
{
TS_ASSERT_EQUALS(names[0].first, "AlgTest");
TS_ASSERT_EQUALS(names[0].second, "Cat4");
}
if (names.size() > 1)
{
TS_ASSERT_EQUALS(names[1].first, "AlgTestSecond");
TS_ASSERT_EQUALS(names[1].second, "Cat3");
}

}

void testClear()
{
AlgorithmManager::Instance().clear();
Expand Down

0 comments on commit d6f2b43

Please sign in to comment.