diff --git a/tests/Metric.h b/tests/Metric.h index e088d4b20e7ef69a2de91ed742399506e7018fdc..95663ff2c98f5be25520deb7acade539eb92cdd6 100644 --- a/tests/Metric.h +++ b/tests/Metric.h @@ -38,10 +38,11 @@ #include #include - -#include +#include #include +#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 MetricSharedPtr; - + /// Datatype of the NekFactory used to instantiate classes derived from the /// Advection class. - typedef LibUtilities::NekFactory - 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 m_map; + }; MetricFactory& GetMetricFactory(); } diff --git a/tests/TestData.cpp b/tests/TestData.cpp index d98039d29d3ba501781da52827f59b4327b45f35..11d75dad1a4e9a094bdb058942742aab75e42a85 100644 --- a/tests/TestData.cpp +++ b/tests/TestData.cpp @@ -35,10 +35,11 @@ #include #include -#include #include +#define ASSERTL0(condition,msg) + using namespace std; namespace Nektar