12 #ifndef SST_CORE_STATAPI_STATFIELDINFO_H 13 #define SST_CORE_STATAPI_STATFIELDINFO_H 15 #include "sst/core/sst_types.h" 21 namespace Statistics {
23 using fieldType_t = uint32_t;
34 virtual const char* fieldName()
const = 0;
35 virtual const char* shortName()
const = 0;
42 static fieldType_t getField(
const char* fieldShortName);
44 static void checkRegisterConflict(
const char* oldName,
const char* newName);
46 static fieldType_t allocateFieldEnum();
52 static std::map<fieldType_t, StatisticFieldTypeBase*>* fields_;
53 static fieldType_t enumCounter_;
63 checkRegisterConflict(fieldName_, name);
64 checkRegisterConflict(shortName_, shortName);
66 shortName_ = shortName;
67 if ( fieldEnum_ == 0 ) { fieldEnum_ = allocateFieldEnum(); }
70 shortName_ = shortName;
71 addField(fieldEnum_,
this);
74 static const char* getFieldName() {
return fieldName_; }
76 static const char* getShortName() {
return shortName_; }
78 static fieldType_t id() {
return fieldEnum_; }
80 const char* fieldName()
const override {
return getFieldName(); }
82 const char* shortName()
const override {
return getShortName(); }
85 static Statistics::fieldType_t fieldEnum_;
86 static const char* fieldName_;
87 static const char* shortName_;
99 using fieldType_t = ::SST::Statistics::fieldType_t;
100 using fieldHandle_t = int32_t;
108 StatisticFieldInfo(
const char* statName,
const char* fieldName, fieldType_t fieldType);
112 inline const std::string&
getStatName()
const {
return m_statName; }
136 static const char* getFieldTypeShortName(fieldType_t type)
138 return StatisticFieldTypeBase::getField(type)->shortName();
141 static const char* getFieldTypeFullName(fieldType_t type)
143 return StatisticFieldTypeBase::getField(type)->fieldName();
146 template <
typename T>
147 static fieldType_t getFieldTypeFromTemplate()
149 return StatisticFieldType<T>::id();
156 std::string m_statName;
157 std::string m_fieldName;
158 fieldType_t m_fieldType;
159 fieldHandle_t m_fieldHandle;
165 #endif // SST_CORE_STATAPI_STATFIELDINFO_H The class for representing Statistic Output Fields.
Definition: statfieldinfo.h:96
const std::string & getStatName() const
Return the statistic name related to this field info.
Definition: statfieldinfo.h:112
fieldHandle_t getFieldHandle()
Get the field handle.
Definition: statfieldinfo.h:134
std::string getFieldUniqueName() const
Return the field type related to this field info.
Definition: statfieldinfo.cc:41
void setFieldHandle(fieldHandle_t handle)
Set the field handle.
Definition: statfieldinfo.h:129
fieldType_t getFieldType() const
Return the field type related to this field info.
Definition: statfieldinfo.h:116
bool operator==(StatisticFieldInfo &FieldInfo1)
Compare two field info structures.
Definition: statfieldinfo.cc:35
StatisticFieldInfo(const char *statName, const char *fieldName, fieldType_t fieldType)
Construct a StatisticFieldInfo.
Definition: statfieldinfo.cc:26
const std::string & getFieldName() const
Return the field name related to this field info.
Definition: statfieldinfo.h:114
Definition: statfieldinfo.h:31
Definition: statfieldinfo.h:57