1 #ifndef SST_CORE_STATS_INFO_H
2 #define SST_CORE_STATS_INFO_H
6 #include <sst/core/eli/elibase.h>
11 template <
class T,
class Enable=
void>
13 static const std::vector<SST::ElementInfoStatistic>&
get() {
14 static std::vector<SST::ElementInfoStatistic> var = { };
21 typename
MethodDetect<decltype(T::ELI_getStatistics())>::type> {
22 static const std::vector<SST::ElementInfoStatistic>&
get() {
23 return T::ELI_getStatistics();
29 std::vector<std::string> statnames;
30 std::vector<ElementInfoStatistic> stats_;
33 for (
auto& item : stats_) {
34 statnames.push_back(item.name);
47 const std::vector<ElementInfoStatistic>& getValidStats()
const {
50 const std::vector<std::string>& getStatnames()
const {
return statnames; }
52 void toString(std::ostream& os)
const;
54 template <
class XMLNode>
void outputXML(XMLNode* node)
const {
59 auto* XMLStatElement =
new XMLNode(
"Statistic");
60 XMLStatElement->SetAttribute(
"Index", idx);
61 XMLStatElement->SetAttribute(
"Name", stat.name);
62 XMLStatElement->SetAttribute(
"Description", stat.description ? stat.description :
"none");
63 XMLStatElement->SetAttribute(
"Units", stat.units ? stat.units :
"none");
64 XMLStatElement->SetAttribute(
"EnableLevel", stat.enableLevel);
65 node->LinkEndChild(XMLStatElement);
74 #define SST_ELI_DOCUMENT_STATISTICS(...) \
75 static const std::vector<SST::ElementInfoStatistic>& ELI_getStatistics() { \
76 static std::vector<SST::ElementInfoStatistic> var = { __VA_ARGS__ } ; \
Definition: statsInfo.h:27
Definition: elibase.h:105
Describes Statistics used by a Component.
Definition: elibase.h:37
Definition: statsInfo.h:12