51 m_regex =
"^CG iterations made = (\\d+) .*";
54 TiXmlElement *value = metric->FirstChildElement(
"value");
62 ASSERTL0(value->Attribute(
"tolerance"),
63 "Missing tolerance in preconditioner metric");
65 "Missing value in preconditioner metric.");
74 std::vector<MetricRegexFieldValue> tmp(1);
83 value = value->NextSiblingElement(
"value");
96 for (
int i = 0; i <
m_matches.size(); ++i)
99 "Wrong number of matches for regular expression.");
102 TiXmlElement *value =
new TiXmlElement(
"value");
109 value->SetAttribute(
"tolerance", tol);
110 value->LinkEndChild(
new TiXmlText(
m_matches[i][0].m_value));
#define ASSERTL0(condition, msg)
std::string RegisterCreatorFunction(std::string key, CreatorFunction func)
TiXmlElement * m_metric
Pointer to XML structure containing metric definition.
bool m_generate
Determines whether to generate this metric or not.
void v_Generate(std::istream &pStdout, std::istream &pStderr) override
Virtual function to generate the metric. Should be redefined in derived classes.
std::string m_varTolerance
static std::string defaultTolerance
MetricPrecon(TiXmlElement *metric, bool generate)
static MetricSharedPtr create(TiXmlElement *metric, bool generate)
void v_Generate(std::istream &pStdout, std::istream &pStderr) override
Test output against a regex expression and set of matches.
std::vector< std::vector< MetricRegexFieldValue > > m_matches
Stores the multiple matches defined in each <MATCH> tag.
std::regex m_regex
Storage for the boost regex.
bool EmptyString(const char *s)
Check to see whether the given string s is empty (or null).
MetricFactory & GetMetricFactory()
Data structure for a Regex value to match.