12 #ifndef _H_SST_CORE_STATISTICS_FIELDINFO
13 #define _H_SST_CORE_STATISTICS_FIELDINFO
15 #include "sst/core/sst_types.h"
20 namespace Statistics {
22 using fieldType_t = uint32_t;
32 virtual const char* fieldName()
const = 0;
33 virtual const char* shortName()
const = 0;
39 static void checkRegisterConflict(
const char* oldName,
const char* newName);
41 static fieldType_t allocateFieldEnum();
47 static std::map<fieldType_t,StatisticFieldTypeBase*>* fields_;
48 static fieldType_t enumCounter_;
56 checkRegisterConflict(fieldName_, name);
57 checkRegisterConflict(shortName_, shortName);
59 shortName_ = shortName;
61 fieldEnum_ = allocateFieldEnum();
65 shortName_ = shortName;
66 addField(fieldEnum_,
this);
69 static const char* getFieldName(){
73 static const char* getShortName(){
77 static fieldType_t id() {
81 const char* fieldName()
const override {
82 return getFieldName();
85 const char* shortName()
const override {
86 return getShortName();
90 static Statistics::fieldType_t fieldEnum_;
91 static const char* fieldName_;
92 static const char* shortName_;
102 using fieldType_t = ::SST::Statistics::fieldType_t;
103 using fieldHandle_t = int32_t;
111 StatisticFieldInfo(
const char* statName,
const char* fieldName, fieldType_t fieldType);
115 inline const std::string&
getStatName()
const {
return m_statName;}
139 static const char* getFieldTypeShortName(fieldType_t type){
140 return StatisticFieldTypeBase::getField(type)->shortName();
143 static const char* getFieldTypeFullName(fieldType_t type){
144 return StatisticFieldTypeBase::getField(type)->fieldName();
148 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;
The class for representing Statistic Output Fields.
Definition: statfieldinfo.h:99
fieldType_t getFieldType() const
Return the field type related to this field info.
Definition: statfieldinfo.h:119
const std::string & getStatName() const
Return the statistic name related to this field info.
Definition: statfieldinfo.h:115
fieldHandle_t getFieldHandle()
Get the field handle.
Definition: statfieldinfo.h:137
void setFieldHandle(fieldHandle_t handle)
Set the field handle.
Definition: statfieldinfo.h:132
bool operator==(StatisticFieldInfo &FieldInfo1)
Compare two field info structures.
Definition: statfieldinfo.cc:33
StatisticFieldInfo(const char *statName, const char *fieldName, fieldType_t fieldType)
Construct a StatisticFieldInfo.
Definition: statfieldinfo.cc:25
const std::string & getFieldName() const
Return the field name related to this field info.
Definition: statfieldinfo.h:117
Definition: statfieldinfo.h:30
Definition: statfieldinfo.h:52
std::string getFieldUniqueName() const
Return the field type related to this field info.
Definition: statfieldinfo.cc:40