12 #ifndef _H_SST_CORE_STATISTICS_FIELDINFO
13 #define _H_SST_CORE_STATISTICS_FIELDINFO
15 #include "sst/core/sst_types.h"
19 namespace Statistics {
21 using fieldType_t = uint32_t;
31 virtual const char* fieldName()
const = 0;
32 virtual const char* shortName()
const = 0;
38 static void checkRegisterConflict(
const char* oldName,
const char* newName);
40 static fieldType_t allocateFieldEnum();
46 static std::map<fieldType_t,StatisticFieldTypeBase*>* fields_;
47 static fieldType_t enumCounter_;
55 checkRegisterConflict(fieldName_, name);
56 checkRegisterConflict(shortName_, shortName);
58 shortName_ = shortName;
60 fieldEnum_ = allocateFieldEnum();
64 shortName_ = shortName;
65 addField(fieldEnum_,
this);
68 static const char* getFieldName(){
72 static const char* getShortName(){
76 static fieldType_t id() {
80 const char* fieldName()
const override {
81 return getFieldName();
84 const char* shortName()
const override {
85 return getShortName();
89 static Statistics::fieldType_t fieldEnum_;
90 static const char* fieldName_;
91 static const char* shortName_;
101 using fieldType_t = ::SST::Statistics::fieldType_t;
102 using fieldHandle_t = int32_t;
110 StatisticFieldInfo(
const char* statName,
const char* fieldName, fieldType_t fieldType);
114 inline const std::string&
getStatName()
const {
return m_statName;}
138 static const char* getFieldTypeShortName(fieldType_t type){
139 return StatisticFieldTypeBase::getField(type)->shortName();
142 static const char* getFieldTypeFullName(fieldType_t type){
143 return StatisticFieldTypeBase::getField(type)->fieldName();
147 static fieldType_t getFieldTypeFromTemplate(){
148 return StatisticFieldType<T>::id();
155 std::string m_statName;
156 std::string m_fieldName;
157 fieldType_t m_fieldType;
158 fieldHandle_t m_fieldHandle;
The class for representing Statistic Output Fields
Definition: statfieldinfo.h:98
fieldType_t getFieldType() const
Return the field type related to this field info.
Definition: statfieldinfo.h:118
const std::string & getStatName() const
Return the statistic name related to this field info.
Definition: statfieldinfo.h:114
fieldHandle_t getFieldHandle()
Get the field handle.
Definition: statfieldinfo.h:136
void setFieldHandle(fieldHandle_t handle)
Set the field handle.
Definition: statfieldinfo.h:131
bool operator==(StatisticFieldInfo &FieldInfo1)
Compare two field info structures.
Definition: statfieldinfo.cc:32
StatisticFieldInfo(const char *statName, const char *fieldName, fieldType_t fieldType)
Construct a StatisticFieldInfo.
Definition: statfieldinfo.cc:24
const std::string & getFieldName() const
Return the field name related to this field info.
Definition: statfieldinfo.h:116
Definition: statfieldinfo.h:29
Definition: statfieldinfo.h:51
std::string getFieldUniqueName() const
Return the field type related to this field info.
Definition: statfieldinfo.cc:39