12 #ifndef SST_CORE_STATAPI_STATUNIQUECOUNT_H 13 #define SST_CORE_STATAPI_STATUNIQUECOUNT_H 15 #include "sst/core/sst_types.h" 16 #include "sst/core/statapi/statbase.h" 17 #include "sst/core/warnmacros.h" 21 namespace Statistics {
35 SST_ELI_DECLARE_STATISTIC_TEMPLATE(
38 "UniqueCountStatistic",
39 SST_ELI_ELEMENT_VERSION(1, 0, 0),
40 "Track unique occurrences of statistic",
44 BaseComponent* comp,
const std::string& stat_name,
const std::string& stat_sub_id,
Params& stat_params) :
54 virtual const std::string&
getStatTypeName()
const override {
return stat_type_; }
71 void clearStatisticData()
override { unique_set_.clear(); }
73 void registerOutputFields(StatisticFieldsOutput* stat_output)
override 75 unique_count_field_ = stat_output->registerField<uint64_t>(
"UniqueItems");
78 void outputStatisticFields(StatisticFieldsOutput* stat_output,
bool UNUSED(end_of_sim_flag))
override 80 stat_output->outputField(unique_count_field_, (uint64_t)unique_set_.size());
84 std::set<T> unique_set_;
85 StatisticOutput::fieldHandle_t unique_count_field_;
86 inline static const std::string stat_type_ =
"UniqueCount";
92 #endif // SST_CORE_STATAPI_STATUNIQUECOUNT_H This class is basically a wrapper for objects to declare the order in which their members should be s...
Definition: serializer.h:42
Creates a Statistic which counts unique values provided to it.
Definition: statuniquecount.h:32
virtual const std::string & getStatTypeName() const override
Return the Statistic type name.
Definition: statuniquecount.h:54
Forms the template defined base class for statistics gathering within SST.
Definition: elementinfo.h:46
void serialize_order(SST::Core::Serialization::serializer &ser) override
Serialization.
Definition: statuniquecount.h:56
Main component object for the simulation.
Definition: baseComponent.h:64
void addData_impl(T data) override
Present a new value to the Statistic to be included in the unique set
Definition: statuniquecount.h:68
Parameter store.
Definition: params.h:63
virtual void serialize_order(SST::Core::Serialization::serializer &ser) override
Serialization.
Definition: statbase.h:415