12#ifndef SST_CORE_STATAPI_STATNULL_H
13#define SST_CORE_STATAPI_STATNULL_H
15#include "sst/core/sst_types.h"
16#include "sst/core/statapi/statbase.h"
17#include "sst/core/warnmacros.h"
21namespace SST::Statistics {
39template <
class T,
bool = std::is_arithmetic_v<T>>
43class NullStatisticBase<T, true> :
public Statistic<T>
47 BaseComponent* comp,
const std::string& statName,
const std::string& statSubId,
Params& statParams) :
48 Statistic<T>(comp, statName, statSubId, statParams,
true)
51 void addData_impl(T UNUSED(data))
override {}
53 void addData_impl_Ntimes(uint64_t UNUSED(N), T UNUSED(data))
override {}
55 virtual const std::string&
getStatTypeName()
const override {
return stat_type_; }
58 inline static const std::string stat_type_ =
"NULL";
61template <
class... Args>
62class NullStatisticBase<std::tuple<Args...>, false> :
public Statistic<std::tuple<Args...>>
66 BaseComponent* comp,
const std::string& statName,
const std::string& statSubId,
Params& statParams) :
67 Statistic<std::tuple<Args...>>(comp, statName, statSubId, statParams,
true)
70 void addData_impl(Args... UNUSED(data))
override {}
72 void addData_impl_Ntimes(uint64_t UNUSED(N), Args... UNUSED(data))
override {}
74 virtual const std::string&
getStatTypeName()
const override {
return stat_type_; }
77 inline static const std::string stat_type_ =
"NULL";
81class NullStatisticBase<T, false> :
public Statistic<T>
85 BaseComponent* comp,
const std::string& statName,
const std::string& statSubId,
Params& statParams) :
86 Statistic<T>(comp, statName, statSubId, statParams,
true)
89 void addData_impl(T&& UNUSED(data))
override {}
90 void addData_impl(
const T& UNUSED(data))
override {}
92 void addData_impl_Ntimes(uint64_t UNUSED(N), T&& UNUSED(data))
override {}
93 void addData_impl_Ntimes(uint64_t UNUSED(N),
const T& UNUSED(data))
override {}
95 virtual const std::string&
getStatTypeName()
const override {
return stat_type_; }
98 inline static const std::string stat_type_ =
"NULL";
105 SST_ELI_DECLARE_STATISTIC_TEMPLATE(
109 SST_ELI_ELEMENT_VERSION(1,0,0),
110 "Null object that ignores all collections",
119 void clearStatisticData()
override
129 void outputStatisticFields(
StatisticFieldsOutput* UNUSED(statOutput),
bool UNUSED(EndOfSimFlag))
override
134 bool isReady()
const override {
return true; }
136 bool isNullStatistic()
const override {
return true; }
138 static bool isLoaded() {
return loaded_; }
141 inline static bool loaded_ =
true;
148 SST_ELI_REGISTER_DERIVED(
153 SST_ELI_ELEMENT_VERSION(1,0,0),
154 "Null statistic for custom (void) stats"
157 SST_ELI_INTERFACE_INFO(
"Statistic<void>")
159 NullStatistic(BaseComponent* comp,
const std::string& statName,
const std::string& statSubId,
Params& statParams) :
163 virtual std::string
getELIName()
const override {
return "sst.NullStatistic"; }
165 virtual const std::string&
getStatTypeName()
const override {
return stat_type_; }
168 inline static const std::string stat_type_ =
"NULL";
Main component object for the simulation.
Definition baseComponent.h:62
Parameter store.
Definition params.h:58
virtual const std::string & getStatTypeName() const override
Return the Statistic type name.
Definition statnull.h:95
virtual const std::string & getStatTypeName() const override
Return the Statistic type name.
Definition statnull.h:55
virtual const std::string & getStatTypeName() const override
Return the Statistic type name.
Definition statnull.h:74
An empty statistic place holder.
Definition statnull.h:103
virtual const std::string & getStatTypeName() const
Return the Statistic type name.
Definition statbase.h:123
virtual std::string getELIName() const =0
Return the ELI type of the statistic The ELI registration macro creates this function automatically f...
Definition statoutput.h:170
Statistic(BaseComponent *comp, const std::string &stat_name, const std::string &stat_sub_id, Params &stat_params, bool null_stat=false)
Construct a Statistic.
Definition statbase.h:437