41 std::vector<std::string> statnames;
42 std::vector<ElementInfoStatistic> stats_;
46 for (
auto& item : stats_ ) {
47 statnames.push_back(item.name);
53 explicit ProvidesStats(T* UNUSED(t)) :
54 stats_(InfoStats<T>::get())
60 const std::vector<ElementInfoStatistic>& getValidStats()
const {
return stats_; }
61 const std::vector<std::string>& getStatnames()
const {
return statnames; }
63 void toString(std::ostream& os)
const;
65 template <
class XMLNode>
66 void outputXML(XMLNode* node)
const
72 auto* XMLStatElement =
new XMLNode(
"Statistic");
73 XMLStatElement->SetAttribute(
"Index", idx);
74 XMLStatElement->SetAttribute(
"Name", stat.name);
75 XMLStatElement->SetAttribute(
"Description", stat.description ? stat.description :
"none");
76 XMLStatElement->SetAttribute(
"Units", stat.units ? stat.units :
"none");
77 XMLStatElement->SetAttribute(
"EnableLevel", stat.enableLevel);
78 node->LinkEndChild(XMLStatElement);