Nektar++
|
Base class for all metrics. Metric represents a test metric that can be used to evaluate the functionality or performance of a Nektar++ executable. More...
#include <Metric.h>
Public Member Functions | |
Metric (TiXmlElement *metric, bool generate) | |
Constructor. More... | |
virtual | ~Metric ()=default |
bool | Test (std::istream &pStdout, std::istream &pStderr) |
Calls a metric's v_Test function (or v_Generate if m_generate ). More... | |
void | Generate (std::istream &pStdout, std::istream &pStderr) |
std::string | GetType () |
Return metric type. More... | |
int | GetID () |
Return metric ID. More... | |
bool | SupportsAverage () const |
Return whether this metric supports averaging results from multiple runs. More... | |
Protected Member Functions | |
virtual bool | v_Test (std::istream &pStdout, std::istream &pStderr)=0 |
Virtual function to test the metric. Should be redefined in derived classes. More... | |
virtual void | v_Generate (std::istream &pStdout, std::istream &pSrderr)=0 |
Virtual function to generate the metric. Should be redefined in derived classes. More... | |
Protected Attributes | |
int | m_id |
Stores the ID of this metric. More... | |
std::string | m_type |
Stores the type of this metric (uppercase). More... | |
bool | m_generate |
Determines whether to generate this metric or not. More... | |
bool | m_average = false |
Indicates whether a metric supports averaging results from multiple runs. More... | |
TiXmlElement * | m_metric |
Pointer to XML structure containing metric definition. More... | |
Base class for all metrics. Metric represents a test metric that can be used to evaluate the functionality or performance of a Nektar++ executable.
Nektar::Metric::Metric | ( | TiXmlElement * | metric, |
bool | generate | ||
) |
Constructor.
Definition at line 51 of file Metric.cpp.
|
virtualdefault |
void Nektar::Metric::Generate | ( | std::istream & | pStdout, |
std::istream & | pStderr | ||
) |
|
inline |
|
inline |
|
inline |
Return whether this metric supports averaging results from multiple runs.
Definition at line 85 of file Metric.h.
References m_average.
bool Nektar::Metric::Test | ( | std::istream & | pStdout, |
std::istream & | pStderr | ||
) |
Calls a metric's v_Test
function (or v_Generate
if m_generate
).
Definition at line 67 of file Metric.cpp.
References m_generate, v_Generate(), and v_Test().
|
protectedpure virtual |
Virtual function to generate the metric. Should be redefined in derived classes.
pStdout | Reference to test output stream. |
pSrderr | Reference to test error stream. |
Implemented in Nektar::MetricEigenvalue, Nektar::MetricExecutionTime, Nektar::MetricFile, Nektar::MetricFileExists, Nektar::MetricL2, Nektar::MetricLInf, Nektar::MetricNoWarning, Nektar::MetricPrecon, Nektar::MetricPyUnitTest, and Nektar::MetricRegex.
Referenced by Test().
|
protectedpure virtual |
Virtual function to test the metric. Should be redefined in derived classes.
pStdout | Reference to test output stream. |
pStderr | Reference to test error stream. |
true
if the test passes, false
otherwise. Implemented in Nektar::MetricExecutionTime, Nektar::MetricFile, Nektar::MetricFileExists, Nektar::MetricNoWarning, and Nektar::MetricRegex.
Referenced by Test().
|
protected |
Indicates whether a metric supports averaging results from multiple runs.
Definition at line 99 of file Metric.h.
Referenced by Nektar::MetricExecutionTime::MetricExecutionTime(), and SupportsAverage().
|
protected |
Determines whether to generate this metric or not.
Definition at line 96 of file Metric.h.
Referenced by Nektar::MetricEigenvalue::MetricEigenvalue(), Nektar::MetricExecutionTime::MetricExecutionTime(), Nektar::MetricFile::MetricFile(), Nektar::MetricFileExists::MetricFileExists(), Nektar::MetricL2::MetricL2(), Nektar::MetricLInf::MetricLInf(), Nektar::MetricNoWarning::MetricNoWarning(), Nektar::MetricPrecon::MetricPrecon(), Nektar::MetricPyUnitTest::MetricPyUnitTest(), Nektar::MetricRegex::MetricRegex(), and Test().
|
protected |
|
protected |
Pointer to XML structure containing metric definition.
Definition at line 101 of file Metric.h.
Referenced by Nektar::MetricEigenvalue::v_Generate(), Nektar::MetricExecutionTime::v_Generate(), Nektar::MetricFile::v_Generate(), Nektar::MetricFileExists::v_Generate(), Nektar::MetricL2::v_Generate(), Nektar::MetricLInf::v_Generate(), Nektar::MetricNoWarning::v_Generate(), Nektar::MetricPrecon::v_Generate(), Nektar::MetricPyUnitTest::v_Generate(), and Nektar::MetricRegex::v_Generate().
|
protected |
Stores the type of this metric (uppercase).
Definition at line 94 of file Metric.h.
Referenced by GetType(), Metric(), Nektar::MetricExecutionTime::MetricExecutionTime(), Nektar::MetricRegex::MetricRegex(), Nektar::MetricExecutionTime::v_Generate(), and Nektar::MetricRegex::v_Generate().