12 #ifndef SST_CORE_ELI_STATS_INFO_H 13 #define SST_CORE_ELI_STATS_INFO_H 15 #include "sst/core/eli/elibase.h" 18 #include <type_traits> 23 template <
typename,
typename =
void>
26 static const std::vector<SST::ElementInfoStatistic>&
get()
28 static std::vector<SST::ElementInfoStatistic> var = {};
34 struct InfoStats<T, std::void_t<decltype(T::ELI_getStatistics())>>
36 static const std::vector<SST::ElementInfoStatistic>&
get() {
return T::ELI_getStatistics(); }
42 std::vector<ElementInfoStatistic> stats_;
51 const std::vector<ElementInfoStatistic>& getValidStats()
const {
return stats_; }
53 void toString(std::ostream& os)
const;
55 template <
class XMLNode>
56 void outputXML(XMLNode* node)
const 60 for (
const auto& stat : stats_ ) {
62 auto* XMLStatElement =
new XMLNode(
"Statistic");
63 XMLStatElement->SetAttribute(
"Index", idx);
64 XMLStatElement->SetAttribute(
"Name", stat.name);
65 XMLStatElement->SetAttribute(
"Description", stat.description ? stat.description :
"none");
66 XMLStatElement->SetAttribute(
"Units", stat.units ? stat.units :
"none");
67 XMLStatElement->SetAttribute(
"EnableLevel", stat.enable_level);
68 node->LinkEndChild(XMLStatElement);
77 #define SST_ELI_DOCUMENT_STATISTICS(...) \ 78 static const std::vector<SST::ElementInfoStatistic>& ELI_getStatistics() \ 80 static std::vector<SST::ElementInfoStatistic> var = { __VA_ARGS__ }; \ 81 auto parent = SST::ELI::InfoStats< \ 82 std::conditional_t<(__EliDerivedLevel > __EliBaseLevel), __LocalEliBase, __ParentEliBase>>::get(); \ 83 SST::ELI::combineEliInfo(var, parent); \ 88 #define SST_ELI_DELETE_STAT(stat) { stat, nullptr, nullptr, 0 } Definition: statsInfo.h:39
Definition: attributeInfo.h:22
Definition: statsInfo.h:24