12 #ifndef SST_CORE_STATS_INFO_H
13 #define SST_CORE_STATS_INFO_H
17 #include "sst/core/eli/elibase.h"
22 template <
class T,
class Enable=
void>
24 static const std::vector<SST::ElementInfoStatistic>&
get() {
25 static std::vector<SST::ElementInfoStatistic> var = { };
32 typename
MethodDetect<decltype(T::ELI_getStatistics())>::type> {
33 static const std::vector<SST::ElementInfoStatistic>&
get() {
34 return T::ELI_getStatistics();
40 std::vector<std::string> statnames;
41 std::vector<ElementInfoStatistic> stats_;
44 for (
auto& item : stats_) {
45 statnames.push_back(item.name);
58 const std::vector<ElementInfoStatistic>& getValidStats()
const {
61 const std::vector<std::string>& getStatnames()
const {
return statnames; }
63 void toString(std::ostream& os)
const;
65 template <
class XMLNode>
void outputXML(XMLNode* node)
const {
70 auto* XMLStatElement =
new XMLNode(
"Statistic");
71 XMLStatElement->SetAttribute(
"Index", idx);
72 XMLStatElement->SetAttribute(
"Name", stat.name);
73 XMLStatElement->SetAttribute(
"Description", stat.description ? stat.description :
"none");
74 XMLStatElement->SetAttribute(
"Units", stat.units ? stat.units :
"none");
75 XMLStatElement->SetAttribute(
"EnableLevel", stat.enableLevel);
76 node->LinkEndChild(XMLStatElement);
85 #define SST_ELI_DOCUMENT_STATISTICS(...) \
86 static const std::vector<SST::ElementInfoStatistic>& ELI_getStatistics() { \
87 static std::vector<SST::ElementInfoStatistic> var = { __VA_ARGS__ } ; \
Definition: statsInfo.h:38
Definition: elibase.h:105
Describes Statistics used by a Component.
Definition: elibase.h:37
Definition: statsInfo.h:23