Skip to content

Commit

Permalink
Refs #10135. Made method names consistent
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Wedel committed Sep 10, 2014
1 parent b66757d commit 5a8daa1
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 20 deletions.
Expand Up @@ -46,14 +46,14 @@ namespace Geometry
class MANTID_GEOMETRY_DLL PointGroupFactoryImpl : public Kernel::DynamicFactory<PointGroup>
{
public:
PointGroup_sptr createPointgroup(const std::string &hmSymbol) const;
PointGroup_sptr createPointGroup(const std::string &hmSymbol) const;

std::vector<std::string> getAllPointGroupSymbols() const;
std::vector<std::string> getAllPointGroupSymbols(const PointGroup::CrystalSystem &crystalSystem) const;
std::vector<std::string> getPointGroupSymbols(const PointGroup::CrystalSystem &crystalSystem) const;

/// Subscribes a point group into the factory
template <class C>
void subscribePointgroup()
void subscribePointGroup()
{
Kernel::Instantiator<C, PointGroup> *instantiator = new Kernel::Instantiator<C, PointGroup>;
PointGroup_sptr temporaryPointgroup = instantiator->createInstance();
Expand All @@ -65,7 +65,7 @@ namespace Geometry
}

/// Unsubscribes a point group from the factory
void unsubscribePointgroup(const std::string &hmSymbol)
void unsubscribePointGroup(const std::string &hmSymbol)
{
unsubscribe(hmSymbol);
removeFromCrystalSystemMap(hmSymbol);
Expand Down Expand Up @@ -95,7 +95,7 @@ typedef Mantid::Kernel::SingletonHolder<PointGroupFactoryImpl> PointGroupFactory
#define DECLARE_POINTGROUP(classname) \
namespace { \
Mantid::Kernel::RegistrationHelper register_pointgroup_##classname( \
((Mantid::Geometry::PointGroupFactory::Instance().subscribePointgroup<classname>()) \
((Mantid::Geometry::PointGroupFactory::Instance().subscribePointGroup<classname>()) \
, 0)); \
}

Expand Down
Expand Up @@ -8,7 +8,7 @@ namespace Geometry
{

/// Creates a PointGroup object from its Hermann-Mauguin symbol.
PointGroup_sptr PointGroupFactoryImpl::createPointgroup(const std::string &hmSymbol) const
PointGroup_sptr PointGroupFactoryImpl::createPointGroup(const std::string &hmSymbol) const
{
return create(hmSymbol);
}
Expand All @@ -26,7 +26,7 @@ std::vector<std::string> PointGroupFactoryImpl::getAllPointGroupSymbols() const
}

/// Returns the Hermann-Mauguin symbols of all point groups that belong to a certain crystal system.
std::vector<std::string> PointGroupFactoryImpl::getAllPointGroupSymbols(const PointGroup::CrystalSystem &crystalSystem) const
std::vector<std::string> PointGroupFactoryImpl::getPointGroupSymbols(const PointGroup::CrystalSystem &crystalSystem) const
{
std::vector<std::string> pointGroups;

Expand Down
26 changes: 13 additions & 13 deletions Code/Mantid/Framework/Geometry/test/PointGroupFactoryTest.h
Expand Up @@ -91,18 +91,18 @@ class PointGroupFactoryTest : public CxxTest::TestSuite
~PointGroupFactoryTest()
{
// Unsubscribing the fake point groups
PointGroupFactory::Instance().unsubscribePointgroup("cubicA");
PointGroupFactory::Instance().unsubscribePointgroup("cubicB");
PointGroupFactory::Instance().unsubscribePointgroup("triclinic");
PointGroupFactory::Instance().unsubscribePointGroup("cubicA");
PointGroupFactory::Instance().unsubscribePointGroup("cubicB");
PointGroupFactory::Instance().unsubscribePointGroup("triclinic");
}

void testCreatePointGroup()
{
TS_ASSERT_THROWS_NOTHING(PointGroupFactory::Instance().createPointgroup("cubicA"));
TS_ASSERT_THROWS_NOTHING(PointGroupFactory::Instance().createPointgroup("cubicB"));
TS_ASSERT_THROWS_NOTHING(PointGroupFactory::Instance().createPointgroup("triclinic"));
TS_ASSERT_THROWS_NOTHING(PointGroupFactory::Instance().createPointGroup("cubicA"));
TS_ASSERT_THROWS_NOTHING(PointGroupFactory::Instance().createPointGroup("cubicB"));
TS_ASSERT_THROWS_NOTHING(PointGroupFactory::Instance().createPointGroup("triclinic"));

TS_ASSERT_THROWS(PointGroupFactory::Instance().createPointgroup("cubicC"), Mantid::Kernel::Exception::NotFoundError);
TS_ASSERT_THROWS(PointGroupFactory::Instance().createPointGroup("cubicC"), Mantid::Kernel::Exception::NotFoundError);
}

void testGetAllPointGroupSymbols()
Expand All @@ -116,23 +116,23 @@ class PointGroupFactoryTest : public CxxTest::TestSuite

void testGetAllPointGroupSymbolsCrystalSystems()
{
std::vector<std::string> cubic = PointGroupFactory::Instance().getAllPointGroupSymbols(PointGroup::Cubic);
std::vector<std::string> cubic = PointGroupFactory::Instance().getPointGroupSymbols(PointGroup::Cubic);
TS_ASSERT_DIFFERS(findString(cubic, "cubicA"), cubic.end());
TS_ASSERT_DIFFERS(findString(cubic, "cubicB"), cubic.end());

std::vector<std::string> triclinic = PointGroupFactory::Instance().getAllPointGroupSymbols(PointGroup::Triclinic);
std::vector<std::string> triclinic = PointGroupFactory::Instance().getPointGroupSymbols(PointGroup::Triclinic);
TS_ASSERT_DIFFERS(findString(triclinic, "triclinic"), triclinic.end());
}

void testUnsubscribePointGroup()
{
TS_ASSERT_THROWS_NOTHING(PointGroupFactory::Instance().createPointgroup("cubicA"));
TS_ASSERT_THROWS_NOTHING(PointGroupFactory::Instance().createPointGroup("cubicA"));

PointGroupFactory::Instance().unsubscribePointgroup("cubicA");
PointGroupFactory::Instance().unsubscribePointGroup("cubicA");
TS_ASSERT_THROWS(PointGroupFactory::Instance().create("cubicA"), Mantid::Kernel::Exception::NotFoundError);

PointGroupFactory::Instance().subscribePointgroup<TestPointGroupCubicA>();
TS_ASSERT_THROWS_NOTHING(PointGroupFactory::Instance().createPointgroup("cubicA"));
PointGroupFactory::Instance().subscribePointGroup<TestPointGroupCubicA>();
TS_ASSERT_THROWS_NOTHING(PointGroupFactory::Instance().createPointGroup("cubicA"));
}

private:
Expand Down

0 comments on commit 5a8daa1

Please sign in to comment.