12 #ifndef SST_CORE_ELI_STATS_INFO_H 13 #define SST_CORE_ELI_STATS_INFO_H 15 #include "sst/core/eli/elibase.h" 23 template <
class T,
class Enable =
void>
26 static const std::vector<SST::ElementInfoStatistic>&
get()
28 static std::vector<SST::ElementInfoStatistic> var = {};
36 static const std::vector<SST::ElementInfoStatistic>&
get() {
return T::ELI_getStatistics(); }
42 std::vector<std::string> statnames;
43 std::vector<ElementInfoStatistic> stats_;
47 for (
auto& item : stats_ ) {
48 statnames.push_back(item.name);
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);
88 #define SST_ELI_DOCUMENT_STATISTICS(...) \ 89 static const std::vector<SST::ElementInfoStatistic>& ELI_getStatistics() \ 91 static std::vector<SST::ElementInfoStatistic> var = { __VA_ARGS__ }; \ 92 auto parent = SST::ELI::InfoStats< \ 93 std::conditional<(__EliDerivedLevel > __EliBaseLevel), __LocalEliBase, __ParentEliBase>::type>::get(); \ 94 SST::ELI::combineEliInfo(var, parent); \ 99 #define SST_ELI_DELETE_STAT(stat) \ 101 stat, nullptr, nullptr, 0 \ Definition: statsInfo.h:39
Definition: elibase.h:129
Describes Statistics used by a Component.
Definition: elibase.h:37
Definition: statsInfo.h:24