Commit b9a2c5eb authored by David Moxey's avatar David Moxey

Some changes to remove Tester dependency on Nektar++

parent 47bbe1d5
...@@ -38,10 +38,11 @@ ...@@ -38,10 +38,11 @@
#include <tinyxml.h> #include <tinyxml.h>
#include <string> #include <string>
#include <map>
#include <LibUtilities/BasicUtils/NekFactory.hpp>
#include <boost/filesystem.hpp> #include <boost/filesystem.hpp>
#define ASSERTL0(condition,msg)
namespace fs = boost::filesystem; namespace fs = boost::filesystem;
std::string PortablePath(const boost::filesystem::path& path); std::string PortablePath(const boost::filesystem::path& path);
...@@ -75,11 +76,28 @@ namespace Nektar ...@@ -75,11 +76,28 @@ namespace Nektar
/// A shared pointer to an EquationSystem object /// A shared pointer to an EquationSystem object
typedef std::shared_ptr<Metric> MetricSharedPtr; typedef std::shared_ptr<Metric> MetricSharedPtr;
/// Datatype of the NekFactory used to instantiate classes derived from the /// Datatype of the NekFactory used to instantiate classes derived from the
/// Advection class. /// Advection class.
typedef LibUtilities::NekFactory<std::string, Metric, TiXmlElement*, bool> struct MetricFactory
MetricFactory; {
typedef MetricSharedPtr (*CreatorFunction)(TiXmlElement *, bool);
std::string RegisterCreatorFunction(std::string key, CreatorFunction func)
{
m_map[key] = func;
return key;
}
MetricSharedPtr CreateInstance(
std::string key, TiXmlElement *elmt, bool generate)
{
return m_map[key](elmt, generate);
}
private:
std::map<std::string, CreatorFunction> m_map;
};
MetricFactory& GetMetricFactory(); MetricFactory& GetMetricFactory();
} }
......
...@@ -35,10 +35,11 @@ ...@@ -35,10 +35,11 @@
#include <boost/lexical_cast.hpp> #include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp> #include <boost/algorithm/string.hpp>
#include <LibUtilities/BasicUtils/ErrorUtil.hpp>
#include <TestData.h> #include <TestData.h>
#define ASSERTL0(condition,msg)
using namespace std; using namespace std;
namespace Nektar namespace Nektar
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment