Commit b9a2c5eb authored by David Moxey's avatar David Moxey

Some changes to remove Tester dependency on Nektar++

parent 47bbe1d5
......@@ -38,10 +38,11 @@
#include <tinyxml.h>
#include <string>
#include <LibUtilities/BasicUtils/NekFactory.hpp>
#include <map>
#include <boost/filesystem.hpp>
#define ASSERTL0(condition,msg)
namespace fs = boost::filesystem;
std::string PortablePath(const boost::filesystem::path& path);
......@@ -75,11 +76,28 @@ namespace Nektar
/// A shared pointer to an EquationSystem object
typedef std::shared_ptr<Metric> MetricSharedPtr;
/// Datatype of the NekFactory used to instantiate classes derived from the
/// Advection class.
typedef LibUtilities::NekFactory<std::string, Metric, TiXmlElement*, bool>
MetricFactory;
struct 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();
}
......
......@@ -35,10 +35,11 @@
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string.hpp>
#include <LibUtilities/BasicUtils/ErrorUtil.hpp>
#include <TestData.h>
#define ASSERTL0(condition,msg)
using namespace std;
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