13 #ifndef _H_SST_CORE_UNIQUE_COUNT_STATISTIC_
14 #define _H_SST_CORE_UNIQUE_COUNT_STATISTIC_
16 #include "sst/core/sst_types.h"
17 #include "sst/core/warnmacros.h"
19 #include "sst/core/statapi/statbase.h"
23 namespace Statistics {
37 SST_ELI_DECLARE_STATISTIC_TEMPLATE(
40 "UniqueCountStatistic",
41 SST_ELI_ELEMENT_VERSION(1,0,0),
42 "Track unique occurrences of statistic",
60 uniqueSet.insert(data);
64 void clearStatisticData()
override
69 void registerOutputFields(StatisticFieldsOutput* statOutput)
override
71 uniqueCountField = statOutput->registerField<uint64_t>(
"UniqueItems");
74 void outputStatisticFields(StatisticFieldsOutput* statOutput,
bool UNUSED(EndOfSimFlag))
override
76 statOutput->outputField(uniqueCountField, (uint64_t) uniqueSet.size());
80 std::set<T> uniqueSet;
81 StatisticOutput::fieldHandle_t uniqueCountField;
Creates a Statistic which counts unique values provided to it.
Definition: statuniquecount.h:34
void setStatisticTypeName(const char *typeName)
Set an optional Statistic Type Name.
Definition: statbase.h:214
Forms the template defined base class for statistics gathering within SST.
Definition: elementinfo.h:42
Main component object for the simulation.
Definition: baseComponent.h:52
void addData_impl(T data) override
Present a new value to the Statistic to be included in the unique set.
Definition: statuniquecount.h:59
Parameter store.
Definition: params.h:44