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& stat_name,
const std::string& stat_sub_id,
Params& stat_params) :
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& stat_name,
const std::string& stat_sub_id,
Params& stat_params) :
67 Statistic<std::tuple<Args...>>(comp, stat_name, stat_sub_id, stat_params)
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& stat_name,
const std::string& stat_sub_id,
Params& stat_params) :
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",
115 BaseComponent* comp,
const std::string& stat_name,
const std::string& stat_sub_id,
Params& stat_params) :
121 void clearStatisticData()
override
131 void outputStatisticFields(
StatisticFieldsOutput* UNUSED(stat_output),
bool UNUSED(end_of_sim_flag))
override
136 bool isReady()
const override {
return true; }
138 bool isNullStatistic()
const override {
return true; }
140 static bool isLoaded() {
return true; }
147 SST_ELI_REGISTER_DERIVED(
152 SST_ELI_ELEMENT_VERSION(1,0,0),
153 "Null statistic for custom (void) stats"
156 SST_ELI_INTERFACE_INFO(
"Statistic<void>")
159 BaseComponent* comp,
const std::string& stat_name,
const std::string& stat_sub_id,
Params& stat_params) :
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:67
Parameter store.
Definition params.h:65
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:124
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:172
Statistic(BaseComponent *comp, const std::string &stat_name, const std::string &stat_sub_id, Params &stat_params)
Construct a Statistic.
Definition statbase.h:473
Statistic(BaseComponent *comp, const std::string &stat_name, const std::string &stat_sub_id, Params &stat_params)
Construct a Statistic.
Definition statbase.h:432