36#include <boost/algorithm/string.hpp>
52 : m_generate(generate), m_metric(metric)
54 if (!metric->Attribute(
"id"))
56 cerr <<
"Metric has no ID" << endl;
58 if (!metric->Attribute(
"type"))
60 cerr <<
"Metric has no type" << endl;
62 m_id = atoi(metric->Attribute(
"id"));
63 m_type = boost::to_upper_copy(
string(metric->Attribute(
"type")));
76 return v_Test(pStdout, pStderr);
Datatype of the NekFactory used to instantiate classes derived from the Advection class.
bool Test(std::istream &pStdout, std::istream &pStderr)
Calls a metric's v_Test function (or v_Generate if m_generate).
Metric(TiXmlElement *metric, bool generate)
Constructor.
virtual bool v_Test(std::istream &pStdout, std::istream &pStderr)=0
Virtual function to test the metric. Should be redefined in derived classes.
virtual void v_Generate(std::istream &pStdout, std::istream &pSrderr)=0
Virtual function to generate the metric. Should be redefined in derived classes.
int m_id
Stores the ID of this metric.
std::string m_type
Stores the type of this metric (uppercase).
bool m_generate
Determines whether to generate this metric or not.
MetricFactory & GetMetricFactory()