12 #ifndef SST_CORE_COMPONENTINFO_H
13 #define SST_CORE_COMPONENTINFO_H
15 #include <sst/core/sst_types.h>
16 #include <sst/core/params.h>
18 #include <unordered_set>
27 class ConfigComponent;
28 class ComponentInfoMap;
30 namespace Statistics {
43 const ComponentId_t id;
44 const std::string name;
45 const std::string slot_name;
47 const std::string type;
51 std::vector<ComponentInfo> subComponents;
54 statEnableList_t * enabledStats;
55 std::vector<double> coordinates;
57 inline void setComponent(
BaseComponent* comp) { component = comp; }
61 void finalizeLinkConfiguration();
72 inline ComponentId_t getID()
const {
return id; }
74 inline const std::string& getName()
const {
return name; }
76 inline const std::string& getSlotName()
const {
return slot_name; }
78 inline int getSlotNum()
const {
return slot_num; }
80 inline const std::string& getType()
const {
return type; }
82 inline BaseComponent* getComponent()
const {
return component; }
84 inline LinkMap* getLinkMap()
const {
return link_map; }
86 inline const Params* getParams()
const {
return params; }
89 inline std::vector<ComponentInfo>& getSubComponents() {
return subComponents; }
91 ComponentInfo* findSubComponent(std::string slot,
int slot_num);
92 ComponentInfo* findSubComponent(ComponentId_t
id);
93 std::vector<LinkId_t> getAllLinkIds()
const;
95 statEnableList_t* getStatEnableList() {
return enabledStats; }
99 std::hash<std::string> hash;
100 return hash(info->name);
106 return lhs->name == rhs->name;
112 std::hash<ComponentId_t> hash;
113 return hash(info->id);
119 return lhs->id == rhs->id;
127 std::unordered_set<ComponentInfo*, ComponentInfo::HashID, ComponentInfo::EqualsID> dataByID;
130 typedef std::unordered_set<ComponentInfo*, ComponentInfo::HashID, ComponentInfo::EqualsID>::const_iterator const_iterator;
132 const_iterator begin()
const {
133 return dataByID.begin();
136 const_iterator end()
const {
137 return dataByID.end();
143 dataByID.insert(info);
148 auto value = dataByID.find(&infoKey);
149 if ( value == dataByID.end() )
return NULL;
150 if ( SUBCOMPONENT_ID_MASK(key) != 0 ) {
152 return (*value)->findSubComponent(key);
158 return dataByID.empty();
162 for (
auto i : dataByID ) {
171 #endif // SST_CORE_COMPONENTINFO_H
Main control class for a SST Simulation.
Definition: simulation.h:72
std::vector< Statistics::StatisticInfo > statEnableList_t
Definition: componentInfo.h:37
Maps port names to the Links that are connected to it.
Definition: linkMap.h:28
Represents the configuration of a generic component.
Definition: configGraph.h:238
Definition: componentInfo.h:117
Definition: componentInfo.h:125
Definition: componentInfo.h:97
Main component object for the simulation.
Definition: baseComponent.h:104
Definition: componentInfo.h:110
Definition: componentInfo.h:104
Parameter store.
Definition: params.h:45
Definition: componentInfo.h:34